Views
No views yet




| Model | Params / M |
|---|---|
| lcm-lora-sdv1-5 | 67.5 |
| Segmind-VegaRT | 119 |
| lcm-lora-sdxl | 197 |
peft, accelerate and transformers.
audio dataset from the Hugging Face Hub:1pip install --upgrade pip
2pip install --upgrade diffusers transformers accelerate peftsegmind/Segmind-Vega first. Next, the scheduler needs to be changed to LCMScheduler and we can reduce the number of inference steps to just 2 to 8 steps.
Please make sure to either disable guidance_scale or use values between 1.0 and 2.0.1import torch
2from diffusers import LCMScheduler, AutoPipelineForText2Image
3
4model_id = "segmind/Segmind-Vega"
5adapter_id = "segmind/Segmind-VegaRT"
6
7pipe = AutoPipelineForText2Image.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16")
8pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
9pipe.to("cuda")
10
11# load and fuse lcm lora
12pipe.load_lora_weights(adapter_id)
13pipe.fuse_lora()
14
15
16prompt = "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k"
17
18# disable guidance_scale by passing 0
19image = pipe(prompt=prompt, num_inference_steps=4, guidance_scale=0).images[0]