Diffusion LAIR Models
Collection
Model checkpoints for SD1.5 and SDXL post-trained with the LAIR objective (https://arxiv.org/pdf/2605.26491) • 2 items • Updated
How to use austin-k-wang/DiffusionLAIR-SDXL with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("austin-k-wang/DiffusionLAIR-SDXL", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]stabilityai/stable-diffusion-xl-base-1.0462165984030d82259a11f4367a4eed129e94a7bThis model is distributed under the CreativeML Open RAIL++-M license. Users must comply with the use-based restrictions specified in the license.
import torch
from diffusers import (
AutoencoderKL,
StableDiffusionXLPipeline,
UNet2DConditionModel,
)
model_id = "austin-k-wang/DiffusionLAIR-SDXL"
base_model_id = "stabilityai/stable-diffusion-xl-base-1.0"
unet = UNet2DConditionModel.from_pretrained(
model_id,
subfolder="unet",
torch_dtype=torch.float16,
use_safetensors=True,
)
vae = AutoencoderKL.from_pretrained(
"madebyollin/sdxl-vae-fp16-fix",
torch_dtype=torch.float16,
)
pipe = StableDiffusionXLPipeline.from_pretrained(
base_model_id,
unet=unet,
vae=vae,
variant="fp16",
torch_dtype=torch.float16,
use_safetensors=True,
).to("cuda")
generator = torch.Generator(device="cuda").manual_seed(42)
image = pipe(
"a cinematic photograph of a futuristic city at sunset",
generator=generator,
guidance_scale=5.0,
num_inference_steps=30,
).images[0]
image.save("output.png")
For lower-VRAM inference, replace .to("cuda") with:
pipe.enable_model_cpu_offload()
Base model
stabilityai/stable-diffusion-xl-base-1.0