File size: 912 Bytes
9968cae
 
438c264
9968cae
6d8f4d6
cb4cc24
 
438c264
 
cb4cc24
 
 
 
 
 
 
 
 
 
 
 
 
2140611
cb4cc24
438c264
e7959a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
license: creativeml-openrail-m
pipeline_tag: text-to-image
---
LoRA based on Stability AI SDXL-Turbo, for more information on the main checkpoints: https://huggingface.co/stabilityai/sdxl-turbo
![xyz_grid-0007-2494203713-20231130151159.png](https://cdn-uploads.huggingface.co/production/uploads/64186a8b5d6f3d15c64cd821/L1-TOyK9XEErR0M5lwu4W.png)

- **Text-to-image**:
```py
import torch
from diffusers import LCMScheduler, AutoPipelineForText2Image

model_id = "stabilityai/stable-diffusion-xl-base-1.0"
adapter_id = "latent-consistency/lcm-lora-sdxl"

pipe = AutoPipelineForText2Image.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16")
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.to("cuda")

pipe.load_lora_weights("shiroppo/sd_xl_turbo_lora")
pipe.fuse_lora()

prompt = "1 dog"

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