Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -171,9 +171,13 @@ Image editing and manipulation model guidance-distilled from FLUX.1 Kontext [pro
|
|
| 171 |
""")
|
| 172 |
with gr.Row():
|
| 173 |
with gr.Column():
|
| 174 |
-
|
|
|
|
| 175 |
with gr.Row():
|
| 176 |
with gr.Tabs() as tabs:
|
|
|
|
|
|
|
|
|
|
| 177 |
with gr.TabItem("Draw"):
|
| 178 |
input_image = gr.Paint(
|
| 179 |
type="pil",
|
|
@@ -181,23 +185,33 @@ Image editing and manipulation model guidance-distilled from FLUX.1 Kontext [pro
|
|
| 181 |
canvas_size = (1200,1200),
|
| 182 |
layers = False
|
| 183 |
)
|
| 184 |
-
with gr.TabItem("Upload"):
|
| 185 |
-
input_image_upload = gr.Image(label="Upload the drawing", type="pil")
|
| 186 |
gr.Examples(
|
| 187 |
examples=[[img] for img in BASE_EXAMPLES],
|
| 188 |
inputs=[input_image_upload],
|
| 189 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
| 191 |
prompt = gr.Text(
|
| 192 |
label="Prompt",
|
| 193 |
-
show_label=False,
|
| 194 |
max_lines=1,
|
| 195 |
value = "make it real",
|
| 196 |
placeholder="Enter your prompt for editing (e.g., 'Remove glasses', 'Add a hat')",
|
| 197 |
container=False,
|
| 198 |
)
|
| 199 |
-
run_button = gr.Button("Run", scale=0)
|
| 200 |
-
with gr.Accordion("Advanced Settings", open=False):
|
| 201 |
|
| 202 |
seed = gr.Slider(
|
| 203 |
label="Seed",
|
|
@@ -224,15 +238,6 @@ Image editing and manipulation model guidance-distilled from FLUX.1 Kontext [pro
|
|
| 224 |
value=28,
|
| 225 |
step=1
|
| 226 |
)
|
| 227 |
-
with gr.Column():
|
| 228 |
-
with gr.Row():
|
| 229 |
-
overlay_image = gr.Image(label="Upload face photo", type="pil")
|
| 230 |
-
gr.Examples(
|
| 231 |
-
examples=[[img] for img in FACE_EXAMPLES],
|
| 232 |
-
inputs=[overlay_image],
|
| 233 |
-
)
|
| 234 |
-
|
| 235 |
-
with gr.Column():
|
| 236 |
result = gr.Image(label="Result", show_label=False, interactive=False)
|
| 237 |
result_input = gr.Image(label="Result", show_label=False, interactive=False)
|
| 238 |
reuse_button = gr.Button("Reuse this image", visible=False)
|
|
@@ -244,7 +249,7 @@ Image editing and manipulation model guidance-distilled from FLUX.1 Kontext [pro
|
|
| 244 |
["monster.png", "make this monster ride a skateboard on the beach"],
|
| 245 |
["cat.png", "make this cat happy"]
|
| 246 |
],
|
| 247 |
-
inputs=[
|
| 248 |
outputs=[result, seed],
|
| 249 |
fn=infer_example,
|
| 250 |
cache_examples="lazy"
|
|
|
|
| 171 |
""")
|
| 172 |
with gr.Row():
|
| 173 |
with gr.Column():
|
| 174 |
+
gr.Markdown("Select/Upload/Draw a person ⬇️")
|
| 175 |
+
# input_image = gr.Image(label="Upload drawing", type="pil")
|
| 176 |
with gr.Row():
|
| 177 |
with gr.Tabs() as tabs:
|
| 178 |
+
with gr.TabItem("Upload"):
|
| 179 |
+
input_image_upload = gr.Image(label="Upload drawing", type="pil")
|
| 180 |
+
|
| 181 |
with gr.TabItem("Draw"):
|
| 182 |
input_image = gr.Paint(
|
| 183 |
type="pil",
|
|
|
|
| 185 |
canvas_size = (1200,1200),
|
| 186 |
layers = False
|
| 187 |
)
|
|
|
|
|
|
|
| 188 |
gr.Examples(
|
| 189 |
examples=[[img] for img in BASE_EXAMPLES],
|
| 190 |
inputs=[input_image_upload],
|
| 191 |
)
|
| 192 |
+
|
| 193 |
+
with gr.Column():
|
| 194 |
+
gr.Markdown("Select/Upload a face photo ⬇️")
|
| 195 |
+
with gr.Row():
|
| 196 |
+
overlay_image = gr.Image(label="Upload face photo", type="pil")
|
| 197 |
+
gr.Examples(
|
| 198 |
+
examples=[[img] for img in FACE_EXAMPLES],
|
| 199 |
+
inputs=[overlay_image],
|
| 200 |
+
)
|
| 201 |
+
|
| 202 |
+
with gr.Column():
|
| 203 |
+
gr.Markdown("Press “Run” to get results")
|
| 204 |
with gr.Row():
|
| 205 |
+
run_button = gr.Button("Run")
|
| 206 |
+
with gr.Accordion("Advanced Settings", open=False):
|
| 207 |
+
|
| 208 |
prompt = gr.Text(
|
| 209 |
label="Prompt",
|
|
|
|
| 210 |
max_lines=1,
|
| 211 |
value = "make it real",
|
| 212 |
placeholder="Enter your prompt for editing (e.g., 'Remove glasses', 'Add a hat')",
|
| 213 |
container=False,
|
| 214 |
)
|
|
|
|
|
|
|
| 215 |
|
| 216 |
seed = gr.Slider(
|
| 217 |
label="Seed",
|
|
|
|
| 238 |
value=28,
|
| 239 |
step=1
|
| 240 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
result = gr.Image(label="Result", show_label=False, interactive=False)
|
| 242 |
result_input = gr.Image(label="Result", show_label=False, interactive=False)
|
| 243 |
reuse_button = gr.Button("Reuse this image", visible=False)
|
|
|
|
| 249 |
["monster.png", "make this monster ride a skateboard on the beach"],
|
| 250 |
["cat.png", "make this cat happy"]
|
| 251 |
],
|
| 252 |
+
inputs=[input_image_upload, prompt],
|
| 253 |
outputs=[result, seed],
|
| 254 |
fn=infer_example,
|
| 255 |
cache_examples="lazy"
|