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] - The Prompt Reader doesn't populate when image is loaded, and can display the wrong information to the user. #50

Open Jellybit opened 9 months ago

Jellybit commented 9 months ago

Description

I feel like the only person running into this, since no one has mentioned it here so far, but whenever I drag an image or manually choose an image for the prompt reader node, the boxes stay blank. It can populate with the wrong information if changing images, causing problems if the user isn't aware that the prompt info doesn't match the current image. I added steps into the Reproduction Steps that you can follow.

Here's what it ends up looking like. It displays information from the wrong image.

image

Sorry if I'm doing something stupid. I'm on ComfyUI: 1930d1533d.

Reproduction steps

  1. Add an SD Prompt Reader node
  2. Add an SD Prompt Saver node (not necessary, but done because the usage instructions says to do that, even if you're not using it)
  3. Connect the Prompt Reader node to the Prompt Saver image input (not required for the bug, but just to be safe).
  4. Drag an image into the standalone SD Prompt Reader program, to confirm that it has metadata that can be read.
  5. In the SD Prompt Reader node, either drag the image from step 4 onto the node, or click on the "choose file to upload" button, and choose the file in step 4.
  6. Notice that nothing is being populated. It's completely blank.
  7. Add the generation to the queue.
  8. Notice that it's populated.
  9. Add several generations to the queue.
  10. Change the image in the SD Prompt Reader node.
  11. Notice that it doesn't change due to actions taking place, but only when adding it to a queue.

Image file

No response

leo0eloi commented 9 months ago

Hi Friend! I has same issue.

receyuki commented 9 months ago

First, let me explain why the metadata shown in the Prompt Reader node may not match the current image. When you select an image, the change in the image preview is real-time, but reading metadata can only be triggered by image generation. Therefore, the complete process is as follows:

Select the image → Update the image preview → Press the Queue button → The prompt reader reads the metadata from the image → Outputs the metadata → Updates the text box.

Anytime you see metadata, it is data from the image used by the previous generation. This is a feature of comfyui (python script can only be triggered by image generation), and I currently have no solution to this.

Jellybit commented 9 months ago

Anytime you see metadata, it is data from the image used by the previous generation. This is a feature of comfyui (python script can only be triggered by image generation), and I currently have no solution to this.

I see. Some nodes have a right click "View Info..." action that lets you view model data when you set a Lora or Checkpoint. Is it maybe possible to right click to populate your node in the same way? Similarly, the latent node has a right click action that swaps the height/width. RGThree has general right click actions on empty space that can convert several nodes in the graph, or can bring you to a place to rate the add-on on Github. Or is there a way to get it to hook into the "Refresh" action, which repopulates all the checkpoints/loras?

Sorry, I'm sure you've thought this through. I just wanted to bring up any possibilities that may have been missed. Generating an image/video/whatever seems a bit wasteful if it can be avoided.

receyuki commented 9 months ago

Some nodes have a right click "View Info..." action that lets you view model data when you set a Lora or Checkpoint. Is it maybe possible to right click to populate your node in the same way? Similarly, the latent node has a right click action that swaps the height/width. RGThree has general right click actions on empty space that can convert several nodes in the graph, or can bring you to a place to rate the add-on on Github. Or is there a way to get it to hook into the "Refresh" action, which repopulates all the checkpoints/loras?

This is very useful to me! As far as I know, this can only trigger JS code, not Python code. Anyway, I will go check their source code.

receyuki commented 9 months ago

Bad news: my guess was correct, no one can trigger Python code using the right-click menu. That's to say, I can't use right-click to update the text box.

dicksondickson commented 6 months ago

Install https://github.com/rgthree/rgthree-comfy Then you can execute selected nodes.

Jellybit commented 6 months ago

Install https://github.com/rgthree/rgthree-comfy Then you can execute selected nodes.

Ohhh, I have that. I didn't know it had that feature. SO many features on that one. In case anyone else finds this, it seems to be the "Queue Selected Output Nodes (rgthree)" feature. Thanks!