Skip to content
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

[BUG] - Error on Pasted Image #64

Open
gonzalu opened this issue Mar 3, 2024 · 8 comments
Open

[BUG] - Error on Pasted Image #64

gonzalu opened this issue Mar 3, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@gonzalu
Copy link

gonzalu commented Mar 3, 2024

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

@gonzalu gonzalu added the bug Something isn't working label Mar 3, 2024
@receyuki
Copy link
Owner

receyuki commented Mar 4, 2024

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
Copy link
Author

gonzalu commented Mar 6, 2024

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
Copy link
Owner

receyuki commented Mar 6, 2024

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
Copy link
Author

gonzalu commented Mar 6, 2024

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
Copy link
Owner

receyuki commented Mar 7, 2024

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
Copy link
Author

gonzalu commented Mar 7, 2024

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
Copy link
Owner

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
Copy link
Author

gonzalu commented Mar 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants