Skip to content

Official repo for 【TLCM: Training-efficient Latent Consistency Model for Image Generation with 2-8 Steps】

Notifications You must be signed in to change notification settings

OPPO-Mente-Lab/TLCM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TLCM: Training-efficient Latent Consistency Model for Image Generation with 2-8 Steps

📃 Paper • 🤗 Checkpoints

Our method accelerates LDMs via data-free multistep latent consistency distillation (MLCD), and data-free latent consistency distillation is proposed to efficiently guarantee the inter-segment consistency in MLCD.

Furthermore, we introduce bags of techniques, e.g., distribution matching, adversarial learning, and preference learning, to enhance TLCM’s performance at few-step inference without any real data.

TLCM demonstrates a high level of flexibility by enabling adjustment of sampling steps within the range of 2 to 8 while still producing competitive outputs compared to full-step approaches.

Install Dependency

pip install diffusers 
pip install transformers accelerate

Example Use

We provide an example inference script in the directory of this repo. You should download the Lora path from here and use a base model, such as SDXL1.0 , as the recommended option. After that, you can activate the generation with the following code:

python inference.py --prompt {Your prompt} --output_dir {Your output directory} --lora_path {Lora_directory} --base_model_path {Base_model_directory} --infer-steps 4

More parameters are presented in paras.py. You can modify them according to your requirements.

Art Gallery

Here we present some examples with different samping steps.

2-Steps Sampling

图片1 图片2 图片3 图片4

3-Steps Sampling

图片1 图片2 图片3 图片4

4-Steps Sampling

图片1 图片2 图片3 图片4

8-Steps Sampling

图片1 图片2 图片3 图片4

Addition

We also provide the latent lpips model here. More details are presented in the paper.

Citation


About

Official repo for 【TLCM: Training-efficient Latent Consistency Model for Image Generation with 2-8 Steps】

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages