If my work helps you, consider giving it a star.
This repository is the ComfyUI custom node implementation of TCD Sampler mentioned in the TCD paper.
TCD, inspired by Consistency Models, is a novel distillation technology that enables the distillation of knowledge from pre-trained diffusion models into a few-step sampler. It is well known LCM has some problems in generating clear and detailed images. TCD significantly improves image quality than LCM, also with fewer steps. And TCD allows for adjusting the level of random noise in the samples, producing results with varying degrees of detail.
That is:
- TCD generates better details than LCM in same denoise steps.
- TCD can control the richness of details through parameters.
- In addition, TCD will also produce better results than LCM when steps are large.
Some of my other projects that may help you.
- [2024.4.28] 🚀 official PR WIP.
- [2024.4.28] Initial repo.
The examples directory has workflow example. There are images generated with TCD and LCM in the assets folder.
TCD maintains superior generative quality at high NFEs (steps).
TCD result | LCM result | |
---|---|---|
low NFEs | ||
high NFEs |
Note
Except for cfg
, step
, and sampler
, other parameters remain the same.
ddim 30 step | dpmpp_2m 30 step | TCD 4 step | LCM 4 step |
---|---|---|---|
The above comparison results show that TCD can produce better results than LCM details, no longer so blurry and bland.
Some LoRAs available on TCD.
TCD LoRAs from TCD Team.
Hyper-SD 1-Step Unified LoRAs from ByteDance Team.
git clone https://github.com/JettHu/ComfyUI-TCD
# Or use ComfyUI-Manager
- model, model loaded by
Load Checkpoint
and other MODEL loaders.
- steps: The number of steps to use during denoising (same as KSampler node).
- scheduler: The type of schedule to use (same as KSampler node).
- I only kept
simple
andsgm_uniform
.simple
behaves the same as diffusers. Andsgm_uniform
is another scheduler recommended by comfyui author using lcm.
- I only kept
- denoise: How much information of the latents should be erased by noise (same as KSampler node).
- eta: A stochastic parameter (referred to as
gamma
in the paper) used to control the stochasticity (detail-richness of the results) in every step. When eta = 0, it represents deterministic sampling, whereas eta = 1 indicates full stochastic sampling. It is recommended to fine-tune this parameter when adjusting steps larger and using different LoRAs. The default is 0.3.