comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
52.35k stars 5.52k forks source link

[Feature Request] Batch image processing #23

Open jamesWalker55 opened 1 year ago

jamesWalker55 commented 1 year ago

This would allow mass-processing of images, being particularly useful for processing video frames.

It would be even better if you could use multiple sets of images in pairs, e.g. using one node for img2img frames frame0001.png, frame0002.png, ..., and another node for ControlNet inputs segment0001.png, segment0002.png, ..., then combine these two image sets in the pipeline.

comfyanonymous commented 1 year ago

A way to do batch processing in the GUI itself is planned but right now you can do it with scripts: https://github.com/comfyanonymous/ComfyUI/blob/master/script_examples/basic_api_example.py

AbyszOne commented 1 year ago

I`ll looking for this being implemented too. Multibatch is a really powerful and missing feature anywhere, yet.

gitpulled commented 1 year ago

A way to do batch processing in the GUI itself is planned but right now you can do it with scripts: https://github.com/comfyanonymous/ComfyUI/blob/master/script_examples/basic_api_example.py

Batch like folder batches? Or batch like create X images from one prompt?

eldragon0 commented 1 year ago

Unfortunately I don't think a simple script will cover the more advance usage for this function as described above. One of more recent processes uses 3 separate batches of images to run through for frame generation. One batch is the output of controlnets, (potentially up to 5 outputs there, all be it from one image input), one batch for lighting, which is the default input image and one batch for a mask that will likely change frame to frame.

terryxxxxx commented 1 year ago

I also really need this feature

Slarper commented 1 year ago

A way to do batch processing in the GUI itself is planned but right now you can do it with scripts: https://github.com/comfyanonymous/ComfyUI/blob/master/script_examples/basic_api_example.py

The script uses a prompt json ( not a workflow json) to send. So I write an extension to acquire the prompt.json Extract for the .js and put it into ComfyUI\web\extensions folder.

savePrompt.zip

image

WASasquatch commented 1 year ago

Added a batch image loader to WAS Node Suite. It relies on a seed to make sure it runs cause the IS_CHANGED method is useless beyond a image xD But the seed isn't doing anything.

https://github.com/WASasquatch/was-node-suite-comfyui

image

gacela80 commented 11 months ago

Hi newbie here made this batch face restore workflow. I copy/pasted from different workflows I found. I think... it works like a charm but maybe can get better. sharing to see if it helps out anybody and please let me know if I am doing this right or if there is any way to improve. You have to go to extra options and put the number of images in folder to batch count. Batch_Face_Restore_1_workflow

gseth commented 9 months ago

Thank you for this Node!!

RolfHihi commented 9 months ago

How are you images named I get some issues with the order of how the images are loaded Frame_099 Frame_100 Frame_110

robinjhuang commented 3 months ago

@jamesWalker55 Is there anything left for this feature request? Currently supported by some custom nodes.