Untitled

From Sweet Dormouse, 5 Months ago, written in Plain Text, viewed 2 times.
URL https://paste.blessuren.de/view/a4bc85ad Embed
Download Paste or View Raw
  1. from diffusers import StableDiffusionXLPipeline
  2. import torch
  3.  
  4. pipe = StableDiffusionXLPipeline.from_pretrained(
  5.     "stabilityai/sdxl-turbo",
  6.     torch_dtype=torch.float16,
  7.     variant="fp16"
  8. ).to("mps")  # mps = Apple Metal GPU
  9.  
  10. pipe.set_progress_bar_config(disable=False)
  11.  
  12. prompt = "a mystical forest with glowing trees, cinematic lighting, 4k"
  13. image = pipe(prompt=prompt, guidance_scale=0.0, num_inference_steps=4).images[0]
  14. image.save("turbo_output.png")
  15.  
  16.  
  17.  

Reply to "Untitled"

Here you can reply to the paste above