sd_xl_turbo_lora / README.md
shiroppo's picture
Update README.md
b8370a6
|
raw
history blame
967 Bytes
metadata
license: creativeml-openrail-m
pipeline_tag: text-to-image

LoRA based on Stability AI SDXL-Turbo, for more information on the main model: https://huggingface.co/stabilityai/sdxl-turbo xyz_grid-0015-2494203713-20231201144837.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 = "the_prompt"

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