ComfyUI
ComfyUI copied to clipboard
[REDUCE MODEL SWAPPING TO SAVE TIME/POWER] Update graph.py
Updated grouped graph.py for latest ComfyUI
Hey, would you be able to provide more details about your changes, and some examples of workflows that would be faster if your PR was to be merged?
benchmark_20251014_150924_VANILLA_237s.json benchmark_20251014_151419_OPTIM_167s.json Sure thing, the only change is that when possible, nodes requiring the same model are executed in groups.
e.g.: Multiple image gens will first generate all conditionings, then run all samplings, followed by all decode's, reducing the chatter between RAM/VRAM, overall saving time and electricity, reducing carbon footprint.
If I may interfere I think I have seen a similar behavior with what is described here when I was using https://github.com/stduhpf/ComfyUI-WanMoeKSampler.git custom node. The way that node works, maybe not intentional, makes the loading of both high and low noise wan safetensors to happen before ever starting any Ksampler processing. I noticed that it might be better considering all the reading from disk + disk swap file is involved. I have no idea if this PR does exactly that since I can't read code to save my life. Also I didn't make any actual objective comparisons between regular wan 2.2 workflows and wanmoeksampler workflows.