25a99e05cc144dba382d935dff8166cb0c90dba1
cui-teacache-lu2
referenced from https://github.com/spawner1145/TeaCache/blob/main/TeaCache4Lumina2/teacache_lumina2.py
firstly transplanted by @fexli
retransplanted by @spawner
Installation
Manual installation
// switch to your project's root directory
cd custom_nodes
git clone https://github.com/spawner1145/CUI-Lumina2-TeaCache.git
Installation via comfyui-manager
- Open ComfyUI WebUI
- Navigate to
Manager->Install Custom Node - Enter
CUI-Lumina2-TeaCachein theSearchfield, and clickSearch - Click
Install
usage
- Connect the
TeaCachenode between theUNet LoaderandKSamplerin your workflow. - Set the
rel_l1_threshparameter to a value greater than 0.
Note:
- Higher
rel_l1_threshvalues will improve generation efficiency (manifested as shorter generation times), at the cost of reduced image quality. - The optimal value should be determined through empirical testing based on your specific quality/efficiency requirements.
reference
TeaCache can speedup Lumina-Image-2.0 without much visual quality degradation, in a training-free manner. The following image shows the results generated by TeaCache-Lumina-Image-2.0 with various rel_l1_thresh values: 0 (original), 0.2 (1.25x speedup), 0.3 (1.5625x speedup), 0.4 (2.0833x speedup), 0.5 (2.5x speedup).
📈 Inference Latency Comparisons on a single 4090 (step 50)
| Lumina-Image-2.0 | TeaCache (0.2) | TeaCache (0.3) | TeaCache (0.4) | TeaCache (0.5) |
|---|---|---|---|---|
| ~25 s | ~20 s | ~16 s | ~12 s | ~10 s |
special thanks
fexli
The original TeaCache transplant of Lumina2 in cui
welltop-cn
model patch code design
Languages
Python
100%