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
57.48k stars 6.09k forks source link

The efficiency issue of batch processing. #1811

Open hackingchen opened 1 year ago

hackingchen commented 1 year ago

Workflow Description: Batch image generation using ControlNet's OpenPose (approximately 100 poses). After KSampler, images go through resizing, facial repair, hand repair, and are finally saved.

Execution Process: Execution failed due to insufficient VRAM. Reduced the batch size (poses) to 50, which allowed execution but at a much slower speed, taking twice the time compared to the web UI. Upon observing the processing flow, I noticed that ComfyUI processes 50 poses together, resizing, repairing, and saving them in parallel, which leads to VRAM depletion and reduced efficiency. In contrast, the web UI processes images sequentially, one after the other.

Expectation: Is there a node or a workflow that can achieve sequential operations similar to the web UI?

thecat99z commented 1 year ago

Extra options >> Batch count