Text-to-Image
Diffusers
Safetensors
lcm-ssd-1b / README.md
patrickvonplaten's picture
Create README.md
94db4f8
|
raw
history blame
563 Bytes
from diffusers import UNet2DConditionModel, DiffusionPipeline, LCMScheduler

unet = UNet2DConditionModel.from_pretrained("latent-consistency/lcm-ssd-1b", torch_dtype=torch.float16, variant="fp16")
pipe = DiffusionPipeline.from_pretrained("segmind/SSD-1B", unet=unet, torch_dtype=torch.float16, variant="fp16")

pipe.scheduler = LCMScheduler.from_config(sd_pipe.scheduler.config)
pipe.set_progress_bar_config(disable=None)

prompt = "a red car standing on the side of the street"

image = pipe(prompt, num_inference_steps=4, guidance_scale=8.0).images[0]