You have ever stuck slower inference speeds with various image/video generation models. Here, the solution is to use TeachCache. Timestep Embedding Aware Cache (TeaCache), a game-changing, training-free caching technique that optimizes performance across timesteps for diffusion models. Whether you are working with images, videos, or audio, TeaCache significantly accelerates your workflow while maintaining stunning output quality.
TeaCache is now fully integrated into ComfyUI, making it effortlessly compatible with native nodes. Users can incorporate TeaCache into their workflows simply by connecting the designated node to ComfyUI’s native nodes, ensuring an intuitive and streamlined experience.
Most of the project is released under Apache2.0 license. For more in-depth understanding, people can find access their research paper.
It offers substantial speedups across multiple diffusion models while maintaining high visual fidelity. Depending on the model in use, it delivers up to:
- 1.2x to 1.6x lossless speedup, ensuring zero compromise in output quality.
- 1.7x to 2x accelerated inference, with minimal visual degradation.
Installation
1. New user need to
install ComfyUI. Older user should update ComfyUI from the Manager by clicking on "
Update ComfyUI".
2. Now you can install it in two ways.
Automatic Install:
Navigate to ComfyUI Manager and click on Custom nodes Manager. Then just search for "ComfyUI-TeaCache" and at last click on "Install".
Manual Install:
Now, move inside Custom nodes folder. By typing "cmd" command in folder address bar, open command prompt. Then, type the following command to clone repository.
git clone https://github.com/welltop-cn/ComfyUI-TeaCache.git
Install the required dependencies:
For normal ComfyUI user:
pip install -r requirements.txt
For ComfyUI portable user, move inside "ComfyUI_windows_portable" folder. Open command prompt and type these command:
python_embeded\python.exe -m pip install -r requirements.txt
3. Restart ComfyUI to take effect.
Workflow
1. After getting installed, you will get the workflow inside "ComfyUI/custom_nodes/ComfyUI-TeaCache/examples" folder. All the workflows are as follows:
(a) Teacache_cogvideox.json Workflow
(b) Teacache_flux.json Workflow
(c) Teacache_hunyuanvideo.json Workflow
(d) Teacache_ltx_video.json Workflow
(e) Teacache_pulid_flux.json Workfow
2. Drag and drop into ComfyUI and start generation with efficient speed.