Skip to content

Instantly share code, notes, and snippets.

@scottt
Created May 26, 2025 03:20
Show Gist options
  • Select an option

  • Save scottt/5545b3872e74dbe7587748dd5032e1bf to your computer and use it in GitHub Desktop.

Select an option

Save scottt/5545b3872e74dbe7587748dd5032e1bf to your computer and use it in GitHub Desktop.
from diffusers import StableDiffusionXLPipeline
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16
).to("cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt, num_inference_steps=30).images[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment