Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,12 +136,13 @@ with gr.Blocks(css=css, title="ZenCtrl Inpainting") as demo:
|
|
| 136 |
|
| 137 |
# ---------- Example wrapper ---------------------------------
|
| 138 |
def _load_and_show(subj_path, bg_path, prompt_text):
|
| 139 |
-
"""
|
| 140 |
-
Return pre-rendered result corresponding to the subject image.
|
| 141 |
-
Converts e.g. examples/sofa1.png → examples/sofa1_out.png
|
| 142 |
-
"""
|
| 143 |
out_path = subj_path.replace(".png", "_out.png")
|
| 144 |
-
return (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
# ---------- Examples ----------------------------------------
|
| 147 |
gr.Examples(
|
|
@@ -154,7 +155,7 @@ with gr.Blocks(css=css, title="ZenCtrl Inpainting") as demo:
|
|
| 154 |
["examples/car.png", "examples/car_bg.png", "car on the road"], #"examples/car_out.png"],
|
| 155 |
],
|
| 156 |
inputs=[subj_img, ref_img, promptbox], # three inputs
|
| 157 |
-
outputs=[output_img], #
|
| 158 |
fn=_load_and_show,
|
| 159 |
label="Visual Presets – Subject · Background · Prompt",
|
| 160 |
examples_per_page="all",
|
|
|
|
| 136 |
|
| 137 |
# ---------- Example wrapper ---------------------------------
|
| 138 |
def _load_and_show(subj_path, bg_path, prompt_text):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
out_path = subj_path.replace(".png", "_out.png")
|
| 140 |
+
return (
|
| 141 |
+
Image.open(subj_path),
|
| 142 |
+
Image.open(bg_path),
|
| 143 |
+
prompt_text,
|
| 144 |
+
Image.open(out_path)
|
| 145 |
+
)
|
| 146 |
|
| 147 |
# ---------- Examples ----------------------------------------
|
| 148 |
gr.Examples(
|
|
|
|
| 155 |
["examples/car.png", "examples/car_bg.png", "car on the road"], #"examples/car_out.png"],
|
| 156 |
],
|
| 157 |
inputs=[subj_img, ref_img, promptbox], # three inputs
|
| 158 |
+
outputs=[subj_img, ref_img, promptbox, output_img], #
|
| 159 |
fn=_load_and_show,
|
| 160 |
label="Visual Presets – Subject · Background · Prompt",
|
| 161 |
examples_per_page="all",
|