hysts HF staff commited on
Commit
ed17f11
β€’
1 Parent(s): 524787a
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +13 -37
  3. requirements.txt +2 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“š
4
  colorFrom: purple
5
  colorTo: green
6
  sdk: gradio
7
- sdk_version: 3.44.4
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: purple
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 3.45.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -174,18 +174,8 @@ with gr.Blocks(css="style.css") as demo:
174
  cache_examples=CACHE_EXAMPLES,
175
  )
176
 
177
- inputs = [
178
- prompt,
179
- negative_prompt,
180
- seed,
181
- width,
182
- height,
183
- guidance_scale_prior,
184
- guidance_scale,
185
- num_inference_steps_prior,
186
- num_inference_steps,
187
- ]
188
- prompt.submit(
189
  fn=randomize_seed_fn,
190
  inputs=[seed, randomize_seed],
191
  outputs=seed,
@@ -193,34 +183,20 @@ with gr.Blocks(css="style.css") as demo:
193
  api_name=False,
194
  ).then(
195
  fn=generate,
196
- inputs=inputs,
 
 
 
 
 
 
 
 
 
 
197
  outputs=result,
198
  api_name="run",
199
  )
200
- negative_prompt.submit(
201
- fn=randomize_seed_fn,
202
- inputs=[seed, randomize_seed],
203
- outputs=seed,
204
- queue=False,
205
- api_name=False,
206
- ).then(
207
- fn=generate,
208
- inputs=inputs,
209
- outputs=result,
210
- api_name=False,
211
- )
212
- run_button.click(
213
- fn=randomize_seed_fn,
214
- inputs=[seed, randomize_seed],
215
- outputs=seed,
216
- queue=False,
217
- api_name=False,
218
- ).then(
219
- fn=generate,
220
- inputs=inputs,
221
- outputs=result,
222
- api_name=False,
223
- )
224
 
225
  if __name__ == "__main__":
226
  demo.queue(max_size=20).launch()
 
174
  cache_examples=CACHE_EXAMPLES,
175
  )
176
 
177
+ gr.on(
178
+ triggers=[prompt.submit, negative_prompt.submit, run_button.click],
 
 
 
 
 
 
 
 
 
 
179
  fn=randomize_seed_fn,
180
  inputs=[seed, randomize_seed],
181
  outputs=seed,
 
183
  api_name=False,
184
  ).then(
185
  fn=generate,
186
+ inputs=[
187
+ prompt,
188
+ negative_prompt,
189
+ seed,
190
+ width,
191
+ height,
192
+ guidance_scale_prior,
193
+ guidance_scale,
194
+ num_inference_steps_prior,
195
+ num_inference_steps,
196
+ ],
197
  outputs=result,
198
  api_name="run",
199
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
 
201
  if __name__ == "__main__":
202
  demo.queue(max_size=20).launch()
requirements.txt CHANGED
@@ -1,6 +1,7 @@
1
  accelerate==0.23.0
2
  diffusers==0.21.2
3
- gradio==3.44.4
 
4
  torch==2.0.0
5
  torchvision==0.15.1
6
  transformers==4.33.2
 
1
  accelerate==0.23.0
2
  diffusers==0.21.2
3
+ gradio==3.45.2
4
+ spaces==0.15.0
5
  torch==2.0.0
6
  torchvision==0.15.1
7
  transformers==4.33.2