Comfy-Org / Comfy-Org/ComfyUI

Suggestion: Enable CUDA graph to speed up stable diffusion

Open
#1,379 3 comments 0 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

Hi, I am a fan of ComfyUI and I love your stable diffusion GUI. It is amazing how you can create realistic images with a graph interface and no coding.

I have a suggestion for improving the performance of ComfyUI. Have you heard of CUDA graph compilation? It is a PyTorch feature that lets you capture and replay CUDA operations with less CPU overhead. It can make GPU workloads faster, especially if they have many short kernels or repeat many times.

I think CUDA graph compilation could help ComfyUI run faster and more efficiently. Stable diffusion involves many iterations and operations on the GPU, such as sampling, denoising, and attention. By using CUDA graph, ComfyUI could reduce the time and cost of launching each operation to the GPU, and achieve faster and more efficient image generation.

Could you please try to support CUDA graph in ComfyUI and see how it affects the speed and quality of image generation? I would really appreciate it if you could explore this possibility and share your results.

Thank you for your great work on ComfyUI. I hope you will consider my idea and let me know what you think.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.