radames HF staff commited on
Commit
bc1ccd9
β€’
1 Parent(s): b2af35b

limit one model

Browse files
Files changed (1) hide show
  1. visualizer_drag_gradio.py +9 -5
visualizer_drag_gradio.py CHANGED
@@ -179,6 +179,8 @@ with gr.Blocks() as app:
179
  ## Interactive Point-based Manipulation on the Generative Image Manifold
180
  ### Unofficial Gradio Demo
181
 
 
 
182
  <a href="https://huggingface.co/spaces/radames/DragGan?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
183
  <img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a> for no queue on your own hardware.</p>
184
 
@@ -243,6 +245,7 @@ with gr.Blocks() as app:
243
  choices=list(valid_checkpoints_dict.keys()),
244
  label="Pretrained Model",
245
  value=init_pkl,
 
246
  )
247
 
248
  # Latent
@@ -386,11 +389,12 @@ with gr.Blocks() as app:
386
 
387
  return global_state, global_state["images"]['image_show']
388
 
389
- form_pretrained_dropdown.change(
390
- on_change_pretrained_dropdown,
391
- inputs=[form_pretrained_dropdown, global_state],
392
- outputs=[global_state, form_image],
393
- )
 
394
 
395
  def on_click_reset_image(global_state):
396
  """Reset image to the original one and clear all states
 
179
  ## Interactive Point-based Manipulation on the Generative Image Manifold
180
  ### Unofficial Gradio Demo
181
 
182
+ **Due to high demand, only one model can be run at a time, or you can duplicate the space and run your own copy.**
183
+
184
  <a href="https://huggingface.co/spaces/radames/DragGan?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
185
  <img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a> for no queue on your own hardware.</p>
186
 
 
245
  choices=list(valid_checkpoints_dict.keys()),
246
  label="Pretrained Model",
247
  value=init_pkl,
248
+ interactive=not IS_SPACE
249
  )
250
 
251
  # Latent
 
389
 
390
  return global_state, global_state["images"]['image_show']
391
 
392
+ if not IS_SPACE:
393
+ form_pretrained_dropdown.change(
394
+ on_change_pretrained_dropdown,
395
+ inputs=[form_pretrained_dropdown, global_state],
396
+ outputs=[global_state, form_image],
397
+ )
398
 
399
  def on_click_reset_image(global_state):
400
  """Reset image to the original one and clear all states