Spaces:
Running
on
Zero
Running
on
Zero
Refactor output handling in app.py to use state variables for better clarity and maintainability, while removing unnecessary CSS specification in the Blocks context.
Browse files
app.py
CHANGED
|
@@ -219,7 +219,7 @@ css = """
|
|
| 219 |
}
|
| 220 |
"""
|
| 221 |
|
| 222 |
-
with gr.Blocks(
|
| 223 |
with gr.Column(elem_id="col-container"):
|
| 224 |
gr.HTML("""
|
| 225 |
<div id="logo-title">
|
|
@@ -380,18 +380,18 @@ with gr.Blocks(css=css) as demo:
|
|
| 380 |
height,
|
| 381 |
width,
|
| 382 |
],
|
| 383 |
-
outputs=[stage2_result,
|
| 384 |
)
|
| 385 |
|
| 386 |
stage2_event.then(
|
| 387 |
fn=infer_combined,
|
| 388 |
inputs=[
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
stage1_weight,
|
| 396 |
stage2_weight,
|
| 397 |
],
|
|
@@ -399,4 +399,4 @@ with gr.Blocks(css=css) as demo:
|
|
| 399 |
)
|
| 400 |
|
| 401 |
if __name__ == "__main__":
|
| 402 |
-
demo.queue().launch(mcp_server=True)
|
|
|
|
| 219 |
}
|
| 220 |
"""
|
| 221 |
|
| 222 |
+
with gr.Blocks() as demo:
|
| 223 |
with gr.Column(elem_id="col-container"):
|
| 224 |
gr.HTML("""
|
| 225 |
<div id="logo-title">
|
|
|
|
| 380 |
height,
|
| 381 |
width,
|
| 382 |
],
|
| 383 |
+
outputs=[stage2_result, state_image, state_seed, state_guidance, state_steps, state_height, state_width],
|
| 384 |
)
|
| 385 |
|
| 386 |
stage2_event.then(
|
| 387 |
fn=infer_combined,
|
| 388 |
inputs=[
|
| 389 |
+
state_image,
|
| 390 |
+
state_seed,
|
| 391 |
+
state_guidance,
|
| 392 |
+
state_steps,
|
| 393 |
+
state_height,
|
| 394 |
+
state_width,
|
| 395 |
stage1_weight,
|
| 396 |
stage2_weight,
|
| 397 |
],
|
|
|
|
| 399 |
)
|
| 400 |
|
| 401 |
if __name__ == "__main__":
|
| 402 |
+
demo.queue().launch(mcp_server=True, css=css)
|