sd_xl_turbo_lora / README.md
shiroppo's picture
Update README.md
93b9a06
|
raw
history blame
No virus
968 Bytes
metadata
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

Diffusers

pip install diffusers transformers accelerate --upgrade
  • Text-to-image:
import torch
from diffusers import LCMScheduler, AutoPipelineForText2Image

model_id = "stabilityai/stable-diffusion-xl-base-1.0"
adapter_id = "shiroppo/sd_xl_turbo_lora"

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(adapter_id)
pipe.fuse_lora()

prompt = "1 dog"

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