queu loading
Browse files
visualizer_drag_gradio.py
CHANGED
|
@@ -225,8 +225,8 @@ with gr.Blocks() as app:
|
|
| 225 |
})
|
| 226 |
|
| 227 |
# init image
|
| 228 |
-
global_state = init_images(global_state)
|
| 229 |
-
|
| 230 |
with gr.Row():
|
| 231 |
|
| 232 |
with gr.Row():
|
|
@@ -260,7 +260,7 @@ with gr.Blocks() as app:
|
|
| 260 |
step=1,
|
| 261 |
value=global_state.value['params']['seed'],
|
| 262 |
interactive=True,
|
| 263 |
-
|
| 264 |
label="Seed",
|
| 265 |
)
|
| 266 |
form_lr_number = gr.Number(
|
|
@@ -333,7 +333,7 @@ with gr.Blocks() as app:
|
|
| 333 |
# Right --> Image
|
| 334 |
with gr.Column(scale=8):
|
| 335 |
form_image = ImageMask(
|
| 336 |
-
value=global_state.value['images']['image_show'],
|
| 337 |
brush_radius=20).style(
|
| 338 |
width=768,
|
| 339 |
height=768) # NOTE: hard image size code here.
|
|
@@ -909,5 +909,5 @@ with gr.Blocks() as app:
|
|
| 909 |
|
| 910 |
print("SHAReD: Start app", parser.parse_args())
|
| 911 |
gr.close_all()
|
| 912 |
-
app.queue(concurrency_count=5, max_size=
|
| 913 |
app.launch(share=args.share, show_api=False)
|
|
|
|
| 225 |
})
|
| 226 |
|
| 227 |
# init image
|
| 228 |
+
# global_state = init_images(global_state)
|
| 229 |
+
app.load(lambda state: init_images(state), global_state, global_state)
|
| 230 |
with gr.Row():
|
| 231 |
|
| 232 |
with gr.Row():
|
|
|
|
| 260 |
step=1,
|
| 261 |
value=global_state.value['params']['seed'],
|
| 262 |
interactive=True,
|
| 263 |
+
randomize=True,
|
| 264 |
label="Seed",
|
| 265 |
)
|
| 266 |
form_lr_number = gr.Number(
|
|
|
|
| 333 |
# Right --> Image
|
| 334 |
with gr.Column(scale=8):
|
| 335 |
form_image = ImageMask(
|
| 336 |
+
# value=global_state.value['images']['image_show'],
|
| 337 |
brush_radius=20).style(
|
| 338 |
width=768,
|
| 339 |
height=768) # NOTE: hard image size code here.
|
|
|
|
| 909 |
|
| 910 |
print("SHAReD: Start app", parser.parse_args())
|
| 911 |
gr.close_all()
|
| 912 |
+
app.queue(concurrency_count=5, max_size=200, api_open=False)
|
| 913 |
app.launch(share=args.share, show_api=False)
|