By distilling classifier-free guidance into the model's input, LCM can generate high-quality images in very short inference time. We compare the inference time at the setting of 768 x 768 resolution, CFG scale w=8, batchsize=4, using a A800 GPU.
Usage
You can try out Latency Consistency Models directly on:
To run the model yourself, you can leverage the 🧨 Diffusers library:
Install the library:
pip install diffusers transformers accelerate
Run the model:
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7", custom_pipeline="latent_consistency_txt2img", custom_revision="main")
# To save GPU memory, torch.float16 can be used, but it may compromise image quality.
pipe.to(torch_device="cuda", torch_dtype=torch.float32)
prompt = "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k"# Can be set to 1~50 steps. LCM support fast inference even <= 4 steps. Recommend: 1~8 steps.
num_inference_steps = 4
images = pipe(prompt=prompt, num_inference_steps=num_inference_steps, guidance_scale=8.0, lcm_origin_steps=50, output_type="pil").images
BibTeX
@misc{luo2023latent,
title={Latent Consistency Models: Synthesizing High-Resolution Images with Few-Step Inference},
author={Simian Luo and Yiqin Tan and Longbo Huang and Jian Li and Hang Zhao},
year={2023},
eprint={2310.04378},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Runs of ckpt LCM_Dreamshaper_v7 on huggingface.co
81
Total runs
1
24-hour runs
1
3-day runs
-1
7-day runs
24
30-day runs
More Information About LCM_Dreamshaper_v7 huggingface.co Model
LCM_Dreamshaper_v7 huggingface.co is an AI model on huggingface.co that provides LCM_Dreamshaper_v7's model effect (), which can be used instantly with this ckpt LCM_Dreamshaper_v7 model. huggingface.co supports a free trial of the LCM_Dreamshaper_v7 model, and also provides paid use of the LCM_Dreamshaper_v7. Support call LCM_Dreamshaper_v7 model through api, including Node.js, Python, http.
LCM_Dreamshaper_v7 huggingface.co is an online trial and call api platform, which integrates LCM_Dreamshaper_v7's modeling effects, including api services, and provides a free online trial of LCM_Dreamshaper_v7, you can try LCM_Dreamshaper_v7 online for free by clicking the link below.
ckpt LCM_Dreamshaper_v7 online free url in huggingface.co:
LCM_Dreamshaper_v7 is an open source model from GitHub that offers a free installation service, and any user can find LCM_Dreamshaper_v7 on GitHub to install. At the same time, huggingface.co provides the effect of LCM_Dreamshaper_v7 install, users can directly use LCM_Dreamshaper_v7 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.