Spaces:
Running
Running
刘宇轩
commited on
Commit
·
24b7aa6
1
Parent(s):
59b46e8
tab change
Browse files
app.py
CHANGED
|
@@ -305,7 +305,7 @@ quick_subjects = [[x] for x in quick_subjects]
|
|
| 305 |
with gr.Blocks().queue() as demo:
|
| 306 |
gr.HTML("""
|
| 307 |
<div style="text-align: center; font-size: 32px; font-weight: bold; margin-bottom: 20px;">
|
| 308 |
-
FreeLighting:
|
| 309 |
</div>
|
| 310 |
""")
|
| 311 |
with gr.Row():
|
|
@@ -314,6 +314,40 @@ with gr.Blocks().queue() as demo:
|
|
| 314 |
gr.Markdown("We use an open source segmentation model to generate image mask")
|
| 315 |
|
| 316 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
with gr.TabItem("text-guided relighting") as t2v_tab:
|
| 318 |
with gr.Row():
|
| 319 |
with gr.Column():
|
|
@@ -361,38 +395,6 @@ with gr.Blocks().queue() as demo:
|
|
| 361 |
example_quick_prompts.click(lambda x, y: ', '.join(y.split(', ')[:2] + [x[0]]), inputs=[example_quick_prompts, prompt], outputs=prompt, show_progress=False, queue=False)
|
| 362 |
example_quick_subjects.click(lambda x: x[0], inputs=example_quick_subjects, outputs=prompt, show_progress=False, queue=False)
|
| 363 |
|
| 364 |
-
with gr.TabItem("image-guided relighting") as i2v_tab:
|
| 365 |
-
with gr.Row():
|
| 366 |
-
with gr.Column():
|
| 367 |
-
with gr.Row():
|
| 368 |
-
image = gr.Image(label="original_image", type="pil", height=480)
|
| 369 |
-
ref_img = gr.Image(label="reference_image", type="pil", height=480)
|
| 370 |
-
image_mask = gr.Image(label="image_mask", type="pil", height=480)
|
| 371 |
-
with gr.Row():
|
| 372 |
-
seed = gr.Number(value=12345, label="random seed", precision=0)
|
| 373 |
-
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
|
| 374 |
-
button = gr.Button("generate")
|
| 375 |
-
with gr.Column():
|
| 376 |
-
relighting_image = gr.Image(label="relighted_image", type="pil", height=480)
|
| 377 |
-
|
| 378 |
-
with gr.Row():
|
| 379 |
-
gr.Examples(
|
| 380 |
-
examples=db_examples.image_guided_examples,
|
| 381 |
-
inputs=[
|
| 382 |
-
image, ref_img, seed, steps
|
| 383 |
-
, relighting_image
|
| 384 |
-
],
|
| 385 |
-
outputs=[relighting_image],
|
| 386 |
-
examples_per_page=1024
|
| 387 |
-
)
|
| 388 |
-
|
| 389 |
-
button.click(
|
| 390 |
-
fn=call_image_guided_relighting,
|
| 391 |
-
inputs=[
|
| 392 |
-
image, ref_img, seed, steps
|
| 393 |
-
],
|
| 394 |
-
outputs=[relighting_image, image_mask],
|
| 395 |
-
)
|
| 396 |
|
| 397 |
|
| 398 |
demo.launch()
|
|
|
|
| 305 |
with gr.Blocks().queue() as demo:
|
| 306 |
gr.HTML("""
|
| 307 |
<div style="text-align: center; font-size: 32px; font-weight: bold; margin-bottom: 20px;">
|
| 308 |
+
FreeLighting: A Next-generation Relighting Model with Background Replica from Any Perspective Angle
|
| 309 |
</div>
|
| 310 |
""")
|
| 311 |
with gr.Row():
|
|
|
|
| 314 |
gr.Markdown("We use an open source segmentation model to generate image mask")
|
| 315 |
|
| 316 |
with gr.Tabs():
|
| 317 |
+
with gr.TabItem("image-guided relighting") as i2v_tab:
|
| 318 |
+
with gr.Row():
|
| 319 |
+
with gr.Column():
|
| 320 |
+
with gr.Row():
|
| 321 |
+
image = gr.Image(label="original_image", type="pil", height=480)
|
| 322 |
+
ref_img = gr.Image(label="reference_image", type="pil", height=480)
|
| 323 |
+
image_mask = gr.Image(label="image_mask", type="pil", height=480)
|
| 324 |
+
with gr.Row():
|
| 325 |
+
seed = gr.Number(value=12345, label="random seed", precision=0)
|
| 326 |
+
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
|
| 327 |
+
button = gr.Button("generate")
|
| 328 |
+
with gr.Column():
|
| 329 |
+
relighting_image = gr.Image(label="relighted_image", type="pil", height=480)
|
| 330 |
+
|
| 331 |
+
with gr.Row():
|
| 332 |
+
gr.Examples(
|
| 333 |
+
examples=db_examples.image_guided_examples,
|
| 334 |
+
inputs=[
|
| 335 |
+
image, ref_img, seed, steps
|
| 336 |
+
, relighting_image
|
| 337 |
+
],
|
| 338 |
+
outputs=[relighting_image],
|
| 339 |
+
examples_per_page=1024
|
| 340 |
+
)
|
| 341 |
+
|
| 342 |
+
button.click(
|
| 343 |
+
fn=call_image_guided_relighting,
|
| 344 |
+
inputs=[
|
| 345 |
+
image, ref_img, seed, steps
|
| 346 |
+
],
|
| 347 |
+
outputs=[relighting_image, image_mask],
|
| 348 |
+
)
|
| 349 |
+
|
| 350 |
+
|
| 351 |
with gr.TabItem("text-guided relighting") as t2v_tab:
|
| 352 |
with gr.Row():
|
| 353 |
with gr.Column():
|
|
|
|
| 395 |
example_quick_prompts.click(lambda x, y: ', '.join(y.split(', ')[:2] + [x[0]]), inputs=[example_quick_prompts, prompt], outputs=prompt, show_progress=False, queue=False)
|
| 396 |
example_quick_subjects.click(lambda x: x[0], inputs=example_quick_subjects, outputs=prompt, show_progress=False, queue=False)
|
| 397 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
|
| 399 |
|
| 400 |
demo.launch()
|