ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

[Feature Request] Batch image processing

Open jamesWalker55 opened this issue 2 years ago • 11 comments

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.

jamesWalker55 avatar Feb 23 '23 16:02 jamesWalker55

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

comfyanonymous avatar Feb 23 '23 16:02 comfyanonymous

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

AbyszOne avatar Feb 24 '23 03:02 AbyszOne

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?

gitpulled avatar Feb 26 '23 06:02 gitpulled

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.

eldragon0 avatar Mar 20 '23 18:03 eldragon0

I also really need this feature

terryxxxxx avatar Mar 23 '23 06:03 terryxxxxx

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

Slarper avatar Mar 25 '23 17:03 Slarper

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

WASasquatch avatar Mar 25 '23 19:03 WASasquatch

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

gacela80 avatar Oct 24 '23 13:10 gacela80

Thank you for this Node!!

gseth avatar Dec 11 '23 20:12 gseth

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

RolfHihi avatar Jan 02 '24 09:01 RolfHihi

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

robinjhuang avatar Jul 03 '24 20:07 robinjhuang