File size: 604 Bytes
8cec54a
 
 
1da5291
8cec54a
60458f9
1da5291
 
 
8cec54a
1da5291
 
8cec54a
1da5291
 
 
8cec54a
1da5291
8cec54a
1da5291
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
library_name: peft
base_model: segmind/tiny-sd
pipeline_tag: text-to-image
---
# Usage
```python
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)
```