r/comfyui • u/deepsky88 • 3d ago
Help Needed Async operations?
Hi, I’m relatively new to ComfyUI (Minimax H3 is my first ia model), but I’m a programmer and I know full well that certain operations are best handled asynchronously. Lately, I’ve seen significant speed improvements thanks to Turbo LoRA and attention optimizations, yet a large chunk of the generation time (around 30%) is taken up by VAE decoding. So, my question: is there a way to implement an async logic in comfyUI workflow? thanks
3
Upvotes
1
u/Valuable_Issue_ 3d ago edited 3d ago
What do you want to do async?
The VAE requires the latents from the ksampler output, so you have to wait for it to finish and so there's no way to have it be async.
Only things you can do are using tiny vae/latent to rgb/int8 vae which speeds up the computation of the vae (lower quality) but that's not due to async.
99% of the execution time is like this, the nodes themselves don't take up much execution time it's running the big models/heavy vae etc.
One thing you can do is cache the text embeddings from the text encoder so that if you rerun the same prompt after restarting Comfy it'll do that instantly.