fffiloni commited on
Commit
60c3317
·
verified ·
1 Parent(s): a590af7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,15 +1,17 @@
1
  import gradio as gr
2
- from diffusers import StableDiffusionPipeline
 
3
  import torch
4
 
5
- model_id = "runwayml/stable-diffusion-v1-5"
6
- pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32, safety_checker=None)
 
7
 
8
 
9
  def infer(prompt):
10
 
11
  prompt = "a photo of an astronaut riding a horse on mars"
12
- image = pipe(prompt=prompt, guidance_scale=10.0, num_inference_steps=6, width=256, height=256).images[0]
13
 
14
  return image
15
 
 
1
  import gradio as gr
2
+ #from diffusers import StableDiffusionPipeline
3
+ from diffuser import AutoPipelineForText2Image
4
  import torch
5
 
6
+ #model_id = "runwayml/stable-diffusion-v1-5"
7
+ model_id = "stabilityai/sdxl-turbo"
8
+ pipe = AutoPipelineForText2Image.from_pretrained(model_id, torch_dtype=torch.float32, safety_checker=None)
9
 
10
 
11
  def infer(prompt):
12
 
13
  prompt = "a photo of an astronaut riding a horse on mars"
14
+ image = pipe(prompt=prompt, guidance_scale=10.0, num_inference_steps=2, width=256, height=256).images[0]
15
 
16
  return image
17