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] - SDParameterGenerator doesn't load the seed value from previously generated images #44

Closed alessandroperilli closed 9 months ago

alessandroperilli commented 10 months ago

Description

If I generate an image with a workflow that includes the SDParameterGenerator node (like the AP Workflow or the default ComfyUI workflow in the image below), and I later drag that image into the ComfyUI canvas, or Load it via the floating menu, all generation parameters are correctly loaded except the seed value. That remains to -1.

Reproduction steps

  1. Load the default ComfyUI workflow.
  2. Convert any control in the KSampler from widget to input
  3. Link the KSampler input to the corresponding output in the SDParameterGenerator node
  4. Generate a couple of images
  5. Load the before last image and notice that the seed remains at -1

Image file

Screenshot 2024-01-13 at 10 04 46
receyuki commented 10 months ago

This is not a bug. Since I borrowed the entire seed generator from rgthree, my understanding is that it works by storing the seed in a location that is not part of the workflow. Therefore, to implement this feature technically, I would need to rewrite rgthree’s seed generator (something I don’t believe is worthwhile doing). Alternatively, you could ask rgthree if he would be interested in modifying it to suit your preferences, and then I could learn from his updated code lol.

alessandroperilli commented 10 months ago

I'd be happy to do that, but are we sure? I perfectly remembered that dragging a previously-generated image into the ComfyUI canvas would load the seed number inside the SDParametersGenerator node without issues. And I have one AP Workflow user who tells me it used to work fine with AP Workflow 6.0 and now it's not working with 7.0.

Given that I changed absolutely nothing in the workflow about the seed in the transition from 6 to 7, and given the behaviour I just described above, I thought something changed in the node itself.

I have no idea how this feature is implemented. Is it possible that @rgthree changed something in his custom node suite and that impacted the behavior of your SDParametersGenerator node? (Sorry if it's a stupid question)

alessandroperilli commented 10 months ago

It's working now... I just tried again and the seed loads without issues, as usual. I have no idea what's happening :)

alessandroperilli commented 10 months ago

I'm closing this for the time being.

receyuki commented 10 months ago

You're right, I will go over rgthree's code again carefully. His code works perfectly, the problem should be with my modifications.

alessandroperilli commented 9 months ago

Thank you for fixing this!