Idor980 commited on
Commit
87ccd86
1 Parent(s): 0e0e5e6

update space

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -22,8 +22,11 @@ else:
22
  )
23
  pipe = pipe.to(device)
24
 
 
 
 
25
  MAX_SEED = np.iinfo(np.int32).max
26
- MAX_IMAGE_SIZE = 256
27
 
28
 
29
  def infer(
@@ -123,7 +126,7 @@ with gr.Blocks(css=css) as demo:
123
  minimum=256,
124
  maximum=MAX_IMAGE_SIZE,
125
  step=32,
126
- value=256,
127
  )
128
 
129
  height = gr.Slider(
@@ -131,7 +134,7 @@ with gr.Blocks(css=css) as demo:
131
  minimum=256,
132
  maximum=MAX_IMAGE_SIZE,
133
  step=32,
134
- value=256,
135
  )
136
 
137
  with gr.Row():
@@ -169,4 +172,4 @@ with gr.Blocks(css=css) as demo:
169
  outputs=[result],
170
  )
171
 
172
- demo.queue().launch()
 
22
  )
23
  pipe = pipe.to(device)
24
 
25
+ # Quantize the model
26
+ pipe.unet = torch.quantization.convert(pipe.unet, inplace=True)
27
+
28
  MAX_SEED = np.iinfo(np.int32).max
29
+ MAX_IMAGE_SIZE = 512
30
 
31
 
32
  def infer(
 
126
  minimum=256,
127
  maximum=MAX_IMAGE_SIZE,
128
  step=32,
129
+ value=512,
130
  )
131
 
132
  height = gr.Slider(
 
134
  minimum=256,
135
  maximum=MAX_IMAGE_SIZE,
136
  step=32,
137
+ value=512,
138
  )
139
 
140
  with gr.Row():
 
172
  outputs=[result],
173
  )
174
 
175
+ demo.queue().launch(share=True)