Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,17 +97,11 @@ def process_image_and_text(subject_image, adapter_dict, prompt, _unused1, _unuse
|
|
| 97 |
|
| 98 |
# ββββββββββ Header HTML ββββββββββ
|
| 99 |
header_html = """
|
| 100 |
-
<h1>ZenCtrl Inpainting</h1>
|
| 101 |
-
<div align
|
| 102 |
-
<a href
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
<a href="https://fotographer.ai/zen-control" target="_blank" style="margin:10px;">
|
| 106 |
-
<img src="https://img.shields.io/badge/Website-Landing_Page-blue" alt="LP">
|
| 107 |
-
</a>
|
| 108 |
-
<a href="https://x.com/FotographerAI" target="_blank" style="margin:10px;">
|
| 109 |
-
<img src="https://img.shields.io/twitter/follow/FotographerAI?style=social" alt="X">
|
| 110 |
-
</a>
|
| 111 |
</div>
|
| 112 |
"""
|
| 113 |
|
|
@@ -117,9 +111,9 @@ with gr.Blocks(css=css, title="ZenCtrl Inpainting") as demo:
|
|
| 117 |
|
| 118 |
gr.HTML(header_html)
|
| 119 |
gr.Markdown(
|
| 120 |
-
"**Generate context-aware images of your subject with ZenCtrlβs inpainting playground.**
|
| 121 |
-
"
|
| 122 |
-
"
|
| 123 |
)
|
| 124 |
|
| 125 |
with gr.Row():
|
|
@@ -141,8 +135,13 @@ with gr.Blocks(css=css, title="ZenCtrl Inpainting") as demo:
|
|
| 141 |
bg_img = gr.Image(label="Background", visible=True)
|
| 142 |
|
| 143 |
# ---------- Example wrapper ---------------------------------
|
| 144 |
-
def _load_and_show(subj_path, bg_path,
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
# ---------- Examples ----------------------------------------
|
| 148 |
gr.Examples(
|
|
|
|
| 97 |
|
| 98 |
# ββββββββββ Header HTML ββββββββββ
|
| 99 |
header_html = """
|
| 100 |
+
<h1>ZenCtrl Inpainting Beta</h1>
|
| 101 |
+
<div align=\"center\" style=\"line-height: 1;\">
|
| 102 |
+
<a href=\"https://discord.com/invite/b9RuYQ3F8k\" target=\"_blank\" style=\"margin: 10px;\" name=\"discord_link\"><img src=\"https://img.shields.io/badge/Discord-Join-7289da.svg?logo=discord\" alt=\"Discord\" style=\"display: inline-block; vertical-align: middle;\"></a>
|
| 103 |
+
<a href=\"https://fotographer.ai/zen-control\" target=\"_blank\" style=\"margin: 10px;\" name=\"lp_link\"><img src=\"https://img.shields.io/badge/Website-Landing_Page-blue\" alt=\"LP\" style=\"display: inline-block; vertical-align: middle;\"></a>
|
| 104 |
+
<a href=\"https://x.com/FotographerAI\" target=\"_blank\" style=\"margin: 10px;\" name=\"twitter_link\"><img src=\"https://img.shields.io/twitter/follow/FotographerAI?style=social\" alt=\"X\" style=\"display: inline-block; vertical-align: middle;\"></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
</div>
|
| 106 |
"""
|
| 107 |
|
|
|
|
| 111 |
|
| 112 |
gr.HTML(header_html)
|
| 113 |
gr.Markdown(
|
| 114 |
+
"**Generate context-aware images of your subject with ZenCtrlβs inpainting playground.** Upload a subject + optional mask, write a prompt, and hit **Generate**. \n"
|
| 115 |
+
"Open *Advanced Settings* for an AI-generated background. \n\n"
|
| 116 |
+
"**Note:** The model was trained mainly on interior scenes and other *rigid* objects. Results on people or highly deformable items may contain visual distortions."
|
| 117 |
)
|
| 118 |
|
| 119 |
with gr.Row():
|
|
|
|
| 135 |
bg_img = gr.Image(label="Background", visible=True)
|
| 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 Image.open(out_path)
|
| 145 |
|
| 146 |
# ---------- Examples ----------------------------------------
|
| 147 |
gr.Examples(
|