Downloads · 30 days
22
2% of all-time downloads
akameswa/lcm-lora-tiny-sd
lcm-lora-tiny-sd is a text-to-image model from akameswa. Use it when you need an image from a text prompt. It is set up for peft.
Downloads · 30 days
22
2% of all-time downloads
All-time downloads
1.1K
Public
Repo size
294 MB
Likes
1
Public
Click a slice to open those files.
.safetensors352 MB · 86%
From the Hugging Face model README
from peft import PeftModel
from diffusers import LCMScheduler, AutoPipelineForText2Image
model_id = "segmind/tiny-sd"
adapter_id = "akameswa/lcm-lora-tiny-sd"
pipe = AutoPipelineForText2Image.from_pretrained(model_id)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.to("cuda")
PeftModel.from_pretrained(pipe.unet, adapter_id)
prompt = "a dog wearing a knitted hat on the floor"
image = pipe(prompt=prompt, num_inference_steps=4, guidance_scale=1.0).images[0]
display(image)
pipe.fuse_lora(lora_scale=1.0)
pipe.unload_lora_weights()
for param in pipe.unet.parameters():
param.data = param.data.contiguous()
pipe.save_pretrained("./lcm-tiny-sd")