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

[BUG] - Error on Pasted Image #64

Open gonzalu opened 8 months ago

gonzalu commented 8 months ago

Description

I just pasted an image from clipboard and got error. Other pasted images have not shown this error.

Reproduction steps

  1. In photoshop, select all, CTRL+C
  2. in Comfy UI, select SD Prompt Reader Node and press CTRL+V
  3. Queue Prompt
  4. Get error above.

Image file

Reader gets error on pasted image

image

receyuki commented 8 months ago

I didn't even know you could directly paste an image into a node, so I hadn't considered the situation you encountered. In fact, the content copied from places like Photoshop doesn't contain any metadata, so even if I add relevant features, you still won't be able to read any metadata from the image. Or perhaps you just want to use it like the Load Image node?

gonzalu commented 8 months ago

Yeah I use it as both a prompt metadata reader and a image loader. Very convenient actually.

I figured you could add a function to dump the raw EXIF and IPTC from the file as an option ... I just need access to the data and it doesn't have to be necessarily well formatted for my needs.

Currently I open the file in notepad because I am in the middle of a workflow and don't want to interrupt my session.

Thank you as always.

receyuki commented 8 months ago

About the error of pasting images, I will fix it in a few days, and the reader will at least be able to work like the built-in image loader (only output IMAGE and MUSK). About reading EXIF, my suggestion is to use some other professional software or notepad just like you are doing now. If I need to add EXIF reading feature, I would need to add a lot of new logic, but I cannot guarantee EXIF can always be read properly (most EXIF libraries in python works like shit, other tools would work better).

gonzalu commented 8 months ago

Here is an example of what I meant from the Crys Tools node package

image

It gives me everything that I need. Unfortunately, it is a lot of plumbing :D If the SD Prompt Reader could do this,, it would be fantastic.

I will test with a pasted clipboard and see what shows up.

receyuki commented 8 months ago

I just merged the fix into the main branch, you can update it directly. I also tried Crys Tools, it did much better than I expected, so I tend to not reinvent the wheel, but for now I can't find a way to make it work with the prompt reader node. Other than that, I would like to know which specific part of the EXIF data you need in your workflow? In my test, the pasted images only included information like sRGB, gamma, DPI, size, date, and resolution.

gonzalu commented 8 months ago

The size/resolution alone would be fantastic from the PASTED image. The image dimensions if known. I mainly paste actual file images not from Photoshop clipboard. That is rare.

If the image is from a file whatever is in the Exif would be relevant. Even if it is a RAW output widget. and or a field that you populate within the node like you do with the positive/negative and settings fields :D

What I love about your app is that I do not need to have too much plumbing. It is all self-contained. Crys tools are awesome, but I have to do a lot of connecting to get what I want :D

Thank you so much for even entertaining my wishes lol.

receyuki commented 8 months ago

After some consideration, I have finally decided not to add the EXIF reading reature. The reasons are as follows:

  1. Crys Tools does it very well. Even if I add EXIF output, the content and format will almost be the same as the metadata RAW of "Load image with metadata", so you would still need some plumbing.
  2. If I decide to add this feature, I would be compelling myself to support all formats that can be read by comfyui, which is actually very challenging, even Crys Tools only provides very basic support.
  3. The size and resolution you need most are not actually in the EXIF (Crys Tools manually added it to the very beginning of EXIF).
  4. Different libraries or software handle EXIF TAG names completely differently, which makes the EXIF I extract unusable for secondary use.

In my opinion, the biggest advantage of ComfyUI is its modularity. You can customise it to whatever you need. By combining nodes from different node groups, you can complete many jobs that are totally unimaginable.

gonzalu commented 7 months ago

Thank you, Rhys!

Manny Gonzalez

On Thu, Mar 21, 2024 at 1:52 PM Rhys Yang @.***> wrote:

After some consideration, I have finally decided not to add the EXIF reading reature. The reasons are as follows:

  1. Crys Tools does it very well. Even if I add EXIF output, the content and format will almost be the same as the metadata RAW of "Load image with metadata", so you would still need some plumbing.
  2. If I decide to add this feature, I would be compelling myself to support all formats that can be read by comfyui, which is actually very challenging, even Crys Tools only provides very basic support.
  3. The size and resolution you need most are not actually in the EXIF (Crys Tools manually added it to the very beginning of EXIF).
  4. Different libraries or software handle EXIF TAG names completely differently, which makes the EXIF I extract unusable for secondary use.

In my opinion, the biggest advantage of ComfyUI is its modularity. You can customise it to whatever you need. By combining nodes from different node groups, you can complete many jobs that are totally unimaginable.

— Reply to this email directly, view it on GitHub https://github.com/receyuki/comfyui-prompt-reader-node/issues/64#issuecomment-2012208752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHWZVPWKQTKHC6WYCZHT2LDYZLJZNAVCNFSM6AAAAABEEEHWUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGIYDQNZVGI . You are receiving this because you authored the thread.Message ID: @.***>