Merge pull request #748 from zanllp/feature/comfyui-flux-prompt-compatibility
Enhance prompt parsing compatibility with ComfyUI Fluxpull/757/head
commit
7215a4cadf
|
|
@ -30,7 +30,7 @@ class ComfyUIParser:
|
|||
else:
|
||||
params = get_comfyui_exif_data(img)
|
||||
info = comfyui_exif_data_to_str(params)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
logger.error('parse comfyui image failed. prompt:')
|
||||
logger.error(img.info.get('prompt'))
|
||||
return ImageGenerationInfo()
|
||||
|
|
|
|||
|
|
@ -422,7 +422,8 @@ def get_comfyui_exif_data(img: Image):
|
|||
meta["Model"] = data[KSampler_entry["model"][0]]["inputs"]["ckpt_name"]
|
||||
meta["Source Identifier"] = "ComfyUI"
|
||||
def get_text_from_clip(idx: str) :
|
||||
text = data[idx]["inputs"]["text"]
|
||||
inputs = data[idx]["inputs"]
|
||||
text = inputs["text"] if "text" in inputs else inputs["t5xxl"]
|
||||
if isinstance(text, list): # type:CLIPTextEncode (NSP) mode:Wildcards
|
||||
text = data[text[0]]["inputs"]["text"]
|
||||
return text.strip()
|
||||
|
|
|
|||
Loading…
Reference in New Issue