receyuki / comfyui-prompt-reader-node

The ultimate solution for managing image metadata and multi-tool compatibility. ComfyUI node version of the SD Prompt Reader
MIT License
289 stars 22 forks source link

Error Message while executing new image load #63

Closed gonzalu closed 8 months ago

gonzalu commented 9 months ago

Description

Apologies for double posting

I am getting the following error when trying to parse any image:

Error occurred when executing SDPromptReader:

invalid literal for int() with base 10: 'None'

File "E:\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 161, in load_image
seed = int(
^^^^

and a sample image. Have tried a few and all fail. Was working earlier this week.

00031-generated-875797394946022

Thank you!

Reproduction steps

  1. load the node
  2. Drag+Drop image on to node
  3. Press Queue Prompt

Image file

image

gonzalu commented 8 months ago

Looks like there was a change in ComfyUI main that broke a number of custom nodes. Maybe this is related.

https://github.com/comfyanonymous/ComfyUI/commit/c2cb8e889b6a6d45eba26a534bf57aff86b320eb

receyuki commented 8 months ago

Due to custom nodes and complex workflows potentially causing issues with SD Prompt Reader's ability to read image metadata correctly, it is recommended to embed the Prompt Saver Node within the workflow to ensure maximum compatibility.

Perhaps I should put this sentence in the most conspicuous place in the readme.

gonzalu commented 8 months ago

Ah ok, my bad if I did not RTFM :D

Let me go play and report back... so sorry if I missed an important step!

Thanks for the wonderful node.

gonzalu commented 8 months ago

OK, so using your example workflow, I get this error...

I deleted the custom node completely and reinstalled via Manager.

I then deleted it again and installed it manually. Ensured all requirements were met. Still not working.

Just let me know if it is me doing something wrong. Happy to correct anything I may be doing now correctly. All I know is that the SD Prompt Reader used to work up until a few days ago regardless of what image I loaded ;)

Thanks again,

image

receyuki commented 8 months ago

Can you post this ComfyUI01796(2).png here

gonzalu commented 8 months ago

ComfyUI_01796_

gonzalu commented 8 months ago

I am not sure that is the name of the file I drag and dropped in the node but...

here is what it looks like after I hit the Queue Prompt button after closing the error

image

gonzalu commented 8 months ago

Every time I drop the file in the node, the node increases the number in parenthesis... same file.

receyuki commented 8 months ago

You might have misunderstood what I meant. ComfyUI doesn't store metadata but only the complete workflow. In order to make the prompt reader node correctly read the metadata, I need to support each custom node individually, which is a never-ending task. Therefore, I've created the prompt saver node.

To ensure the prompt reader or other tools can read the metadata of the image, you need to save the image through the prompt saver node. Therefore, you need to embed the prompt saver node and the parameter generator node into your workflow to generate images that can be read by any tool..

gonzalu commented 8 months ago

Ah gotcha... no worries.

My bad ... I literally thought the node would read ANY metadata and parse at a minimum the PROSITIVE/NEGATIVE and whatever it can find... Looks like the PNG that breaks for me is saved with some other custom node that places the entire workflow in a different spot in the PNG.

No worries... When your node does pick up the data from a file, it is FANTASTIC. I have come to rely on it :D hence why I was frustrated trying to figure out what I was doing wrong.

As always, MANY MANY thanks and I appreciate you... really wonderful nodes :D

receyuki commented 8 months ago

No worries. Feel free to ask me any questions :)

gonzalu commented 8 months ago

Is there a way the node can gracefully keep going if the image is not supported instead of erroring out? It currently freezes the workflow if a bad image is loaded. It would be great if it just collects the filename, dimensions and the image itself. I use the image output for img2image and currently did not want to use yet another image loader if this single one can do both for me :D I don;t always need the settings and positive/negative.

Thanks much!

Cheers,

receyuki commented 8 months ago

I'm currently planning to add more user-friendly warnings.