Spaces:
Running
on
A10G
Running
on
A10G
roll back load
Browse files- visualizer_drag_gradio.py +7 -10
visualizer_drag_gradio.py
CHANGED
@@ -225,8 +225,7 @@ with gr.Blocks() as app:
|
|
225 |
})
|
226 |
|
227 |
# init image
|
228 |
-
|
229 |
-
app.load(lambda state: init_images(state), global_state, global_state)
|
230 |
with gr.Row():
|
231 |
|
232 |
with gr.Row():
|
@@ -245,7 +244,6 @@ with gr.Blocks() as app:
|
|
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,13 +387,12 @@ with gr.Blocks() as app:
|
|
389 |
|
390 |
return global_state, global_state["images"]['image_show']
|
391 |
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
)
|
399 |
|
400 |
def on_click_reset_image(global_state):
|
401 |
"""Reset image to the original one and clear all states
|
|
|
225 |
})
|
226 |
|
227 |
# init image
|
228 |
+
global_state = init_images(global_state)
|
|
|
229 |
with gr.Row():
|
230 |
|
231 |
with gr.Row():
|
|
|
244 |
choices=list(valid_checkpoints_dict.keys()),
|
245 |
label="Pretrained Model",
|
246 |
value=init_pkl,
|
|
|
247 |
)
|
248 |
|
249 |
# Latent
|
|
|
387 |
|
388 |
return global_state, global_state["images"]['image_show']
|
389 |
|
390 |
+
form_pretrained_dropdown.change(
|
391 |
+
on_change_pretrained_dropdown,
|
392 |
+
inputs=[form_pretrained_dropdown, global_state],
|
393 |
+
outputs=[global_state, form_image],
|
394 |
+
queue=True,
|
395 |
+
)
|
|
|
396 |
|
397 |
def on_click_reset_image(global_state):
|
398 |
"""Reset image to the original one and clear all states
|