fffiloni commited on
Commit
a590af7
1 Parent(s): af9458b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -3,19 +3,26 @@ 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)
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=12, width=256, height=256).images[0]
13
 
14
  return image
15
 
16
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
17
 
18
- with gr.Column():
19
 
20
  with gr.Row():
21
  prompt = gr.Text(
 
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
 
16
+ css="""
17
+ #col-container {
18
+ margin: 0 auto;
19
+ max-width: 720px;
20
+ }
21
+ """
22
+
23
+ with gr.Blocks(css=css) as demo:
24
 
25
+ with gr.Column(elem_id="col-container"):
26
 
27
  with gr.Row():
28
  prompt = gr.Text(