ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Feature Request: Pause or Confirm Node (Supports Seed Cherry-Picking)

Open zer0TF opened this issue 2 years ago • 8 comments

Would like to have a node type that is basically a "Pause", or "Confirm [Yes/No]" before continuing. It could work similarly to the Reroute node, accepting any input/output.

When that node is executed, pause and let the user either continue or stop/cancel the run.

The workflow I'm trying to create that I'm having trouble doing is:

  • Random seed for each run
  • Run txt2img
  • Pause here, wait for human input. Look at preview to determine if it's a good seed
  • If it's a good seed, run latent upscaling (or something else that is more time-consuming)
  • If it's not a good seed, stop the job (i.e. start the next job in the queue to evaluate another random seed)

Is this possible today, if not, what would the best way be to implement something like this?

zer0TF avatar Jul 20 '23 22:07 zer0TF

To cancel execution at any time: see queue -> cancel

If you want it to explicitly pause and be able to continue later, you can use the Preview Bridge node from Impact Pack. It has some additional functionality beyond that too. Here's how that works: video . Mute nodes by setting mode to 'never' or with ctrl+m

You can also enable previews in samplers by adding --preview-method auto in the .bat file that you use to launch ComfyUI. For higher quality previews follow the instructions in readme

Bocian-1 avatar Jul 21 '23 07:07 Bocian-1

Thanks @Bocian-1. In the video, how did they resume the workflow after editing the image? I didn't quite catch that part.

It looks like it could be a good workaround for now, but it would still be a nice feature to have to be able to pause and continue a workflow without resorting to workarounds as well.

zer0TF avatar Jul 21 '23 18:07 zer0TF

The preview bridge isn't actually pausing the workflow. It just stores an image and outputs it. It will always output the image it had stored at the moment that you queue prompt, not the one it stores at the moment the node executes. Instead of resuming the workflow you just queue a new prompt. Essentially it acts as a staggering mechanism.

Muting the node after it just ensures that the part of the workflow following the preview bridge doesn't execute first making you wait through a bunch of unnecessary operations.

Bocian-1 avatar Jul 21 '23 19:07 Bocian-1

https://github.com/chrisgoringe/cg-image-picker does what you want

chrisgoringe avatar Feb 01 '24 08:02 chrisgoringe

Currently I'm using api to invoke comfyui api. But it was interrupted by Preview Image chooser. Is there any way to get these images and show it to user for choosing?

Arthur-xu avatar Jun 19 '24 15:06 Arthur-xu

Preview Image Chooser isn't compatible with the API, it communicates directly with the web UI.

chrisgoringe avatar Jun 19 '24 21:06 chrisgoringe

Preview Image Chooser isn't compatible with the API, it communicates directly with the web UI.

Oh. that explain it. Thanks for your clarification. Wondering is it possible to achieve this from your point of view? https://github.com/chrisgoringe/cg-image-picker

Arthur-xu avatar Jun 20 '24 12:06 Arthur-xu

Maybe raise that as a question on the image picker GitHub and I'll address it there

chrisgoringe avatar Jun 21 '24 02:06 chrisgoringe

Would like to have a node type that is basically a "Pause", or "Confirm [Yes/No]" before continuing. It could work similarly to the Reroute node, accepting any input/output.

When that node is executed, pause and let the user either continue or stop/cancel the run.

The workflow I'm trying to create that I'm having trouble doing is:

  • Random seed for each run
  • Run txt2img
  • Pause here, wait for human input. Look at preview to determine if it's a good seed
  • If it's a good seed, run latent upscaling (or something else that is more time-consuming)
  • If it's not a good seed, stop the job (i.e. start the next job in the queue to evaluate another random seed)

Is this possible today, if not, what would the best way be to implement something like this?

I need the counter to reset to 0 when the process starts, then increment as the batch is executed, and then reset to 0 again after stopping or when the amount is complete. Such a simple task, but I have no idea how to do it?

KLL535 avatar Jan 11 '25 00:01 KLL535

https://github.com/chrisgoringe/cg-image-filter is a replacement for image-picker mentioned above

chrisgoringe avatar Jan 11 '25 01:01 chrisgoringe

https://github.com/chrisgoringe/cg-image-filter is a replacement for image-picker mentioned above

@chrisgoringe looks interesting. How is it improves over cg-image-picker? Considering now which one should I install.

Onkitova avatar Jan 20 '25 10:01 Onkitova

Image filter doesn’t do everything image picker did, but focuses on the main use cases. Its advantages are:

  • images are shown full screen
  • simpler to use
  • code is much more stable and less likely to clash with other nodes or changes in comfy ui
  • comes with nodes that do other similar things in a compatible way (mask edit, text edit)
  • much more likely that I will maintain it!

Unless you need one of the unusual features from picker, install filter.

And if there is a feature it lacks, request it on the GitHub.

On Mon, 20 Jan 2025 at 3:37 pm, Onkitova @.***> wrote:

https://github.com/chrisgoringe/cg-image-filter is a replacement for image-picker mentioned above

@chrisgoringe https://github.com/chrisgoringe looks interesting. How is it improves over cg-image-picker https://github.com/chrisgoringe/cg-image-picker? Considering now which one should I install.

— Reply to this email directly, view it on GitHub https://github.com/comfyanonymous/ComfyUI/issues/951#issuecomment-2601967806, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBLMA2OZPIRTZ2IIOHCPML2LTDHJAVCNFSM6AAAAABU7MBTCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBRHE3DOOBQGY . You are receiving this because you were mentioned.Message ID: @.***>

chrisgoringe avatar Jan 20 '25 10:01 chrisgoringe