-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New undetected data from ComfyUI generated image #756
Comments
Update to the latest IIB |
Sorry, problem persist. |
How did you save this image from ComfyUI? The information in this image is missing a field with the key 'workflow', so it didn't go through the IIB ComfyUI parser, which caused this exception. |
No, is it's my own program using the comfyUI API. I think the image returned by the API is missing some data. ComfyUI open those images without problems. I will investigate. Thanks. |
Could you send me the details of 'prompt' and 'workflow' values? |
I sorted the JSON keys but the problem persists. I think you must use the value of 'prompt', not the value of 'workflow'. You can simply ignore the 'workflow' value if not exists. I'm looking for why ComfyUI API do not provide that. |
'workflow' is only used to determine whether the image was generated by ComfyUI; in fact, it is still 'prompt' during parsing. sd-webui-infinite-image-browsing/scripts/iib/tool.py Lines 396 to 403 in 1a0f071
|
Ok, I will try then embeed a workflow in the image to resolve the problem. Thanks! |
Ops! Not possible. ComfyUI API requires saving the workflows in different format (saved by "save API format") than the format used by the ComfyUI itself. The only option is checking ComfyUI generation not using the 'workflow' attribute. It's possible to infer ComfyUI by some property of the 'prompt' variable? I put here an example of the 'prompt' structure for sdxl workflow in the API format. sdxl = ''' |
I'll check how to implement it later. |
Well, I tried to comment the 'workflorw' part and IB runs perfectly. I don't know if this has some others implication but for me is perfect. def is_img_created_by_comfyui(img: Image): Thank you and congratulations for your software. |
I am aware that it is very difficult to extract the data from any image generated by ComfyUI, but I have detected another image in which it does not read them correctly. If you find it useful, I have the python code to extract the prompt from JSON from the workflow that goes inside the image. Basically you have to go through the nodes until you find the CLIPTextEncode or CLIPTextEncodeFlux type and, in case there are several, it is usual that the one with the smallest id is the positive prompt.
I also attach the python code with which I extract these contents from JSON.
I love your application. Thank you.
def get_prompt (self): # get the prompts in the workflow for node in self.workflow.values(): if node["class_type"] == "CLIPTextEncode": # sd style if 'inputs' in node and 'text' in node['inputs']: print(node['inputs']['text']) elif node["class_type"] == "CLIPTextEncodeFlux": # flux style if 'inputs' in node and 't5xxl' in node['inputs']: print(node['inputs']['t5xxl'])
`
The text was updated successfully, but these errors were encountered: