You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2026. It is now read-only.
fromdiffusersimportDiffusionPipeline,StableDiffusionPipelineimporttorchfromconsistencydecoderimportConsistencyDecoder, save_image, load_imagepipe=DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7", custom_pipeline="latent_consistency_txt2img", custom_revision="main", revision="fb9c5d")
decoder_consistency=ConsistencyDecoder(device="cuda:0") # Model size: 2.49 GBpipe.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=4latent=pipe(prompt=prompt, num_inference_steps=num_inference_steps, guidance_scale=8.0, output_type="latent").images[0]
latent=latent.unsqueeze(0).to("cuda:0")
sample_consistency=decoder_consistency(latent)
save_image(sample_consistency, "con.png")
Thanks to open your work.
Btw, I ran the code:
I got the image:
What is wrong?