mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-12 02:00:04 +08:00
modified the photomaker_v2 node.
This commit is contained in:
parent
1ed629a567
commit
890355989f
@ -213,14 +213,14 @@ class PhotoMakerEncodeV2:
|
|||||||
special_token = "photomaker"
|
special_token = "photomaker"
|
||||||
pixel_values = comfy.clip_vision.clip_preprocess(image.to(photomaker.load_device)).float()
|
pixel_values = comfy.clip_vision.clip_preprocess(image.to(photomaker.load_device)).float()
|
||||||
try:
|
try:
|
||||||
if "photomaker" in text:
|
if special_token in text:
|
||||||
text = text.replace("photomaker"," photomaker ")
|
text = text.replace(special_token, " " + special_token + " ")
|
||||||
index = text.split(" ").index(special_token) + 1
|
index = text.split(" ").index(special_token) + 1
|
||||||
except ValueError:
|
except ValueError:
|
||||||
index = -1
|
index = -1
|
||||||
|
|
||||||
tokens = clip.tokenize(text, return_word_ids=True)
|
tokens = clip.tokenize(text, return_word_ids=True)
|
||||||
logger.debug(f"photomaker in prompt index:{index}, photomaker is running:{index>0}")
|
logger.info(f"photomaker index in prompt:{index},alarm: It's will failure when index >= 77, photomaker embeds id:{index >0 and index < 77}")
|
||||||
|
|
||||||
out_tokens = {}
|
out_tokens = {}
|
||||||
for k in tokens:
|
for k in tokens:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user