mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 19:36:33 +00:00
fix(PhotoMaker): avoid GGML_ASSERT if trigger word 'img' was not found in prompt (#1835)
This commit is contained in:
1 parent
af92790ffc
commit
735a4ef520
1 file changed
+1
-1
@@ -56,7 +56,7 @@ tokenize_photomaker_trigger(FrozenCLIPEmbedderWithCustomWords& clip_conditioner,
|
|||||||
true);
|
true);
|
||||||
std::vector<bool> class_token_mask;
|
std::vector<bool> class_token_mask;
|
||||||
for (int i = 0; i < tokens.size(); i++) {
|
for (int i = 0; i < tokens.size(); i++) {
|
||||||
class_token_mask.push_back(class_idx + 1 <= i && i < class_idx + 1 + trigger_token_count);
|
class_token_mask.push_back(class_idx >= 0 && class_idx + 1 <= i && i < class_idx + 1 + trigger_token_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_tuple(tokens, weights, class_token_mask);
|
return std::make_tuple(tokens, weights, class_token_mask);
|
||||||
|
|||||||
Reference in new issue
Block a user