Stable Cascade
SDXL
SDXL images were generated with 25 steps using the FP16 variant
from diffusers import StableDiffusionXLPipeline
import torch
= StableDiffusionXLPipeline.from_pretrained(
pipeline "stabilityai/stable-diffusion-xl-base-1.0",
=torch.float16,
torch_dtype="fp16",
variant=True,
use_safetensors=False,
add_watermarker
).to(DEVICE)
= pipeline(prompt,
image =torch.Generator("cuda").manual_seed(seed),
generator=25).images[0]
num_inference_steps
"output.jpg") image.save(
SDXL Turbo
SDXL Turbo were generated with the diffuser defaults / guidance_scale of 0 / num_inference_steps = 1
from diffusers import AutoPipelineForText2Image, AutoPipelineForImage2Image
import torch
= AutoPipelineForText2Image.from_pretrained(
pipeline "stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16"
).to(DEVICE)
torch.manual_seed(seed)
with torch.no_grad():
= pipeline(
image =prompt,
prompt=0.0,
guidance_scale=1
num_inference_steps0]
).images[
"output.jpg") image.save(