Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -444,7 +444,7 @@ def generate_video(gallery_images, mode, prompt, height, width,
|
|
| 444 |
return video_path, current_seed
|
| 445 |
|
| 446 |
control_modes = """
|
| 447 |
-
**3
|
| 448 |
- **Reference** Generate a video incorporating elements from input reference images
|
| 449 |
- **First - Last Frame** Generate a video using first and last frame conditioning defined by input images
|
| 450 |
- **Random Transitions** Generate a video with intermediate transitions between multiple input images
|
|
@@ -457,35 +457,35 @@ with gr.Blocks() as demo:
|
|
| 457 |
|
| 458 |
with gr.Row():
|
| 459 |
with gr.Column():
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
prompt_input = gr.Textbox(label="Prompt", value=MODE_PROMPTS["reference"])
|
| 490 |
duration_seconds_input = gr.Slider(
|
| 491 |
minimum=round(MIN_FRAMES_MODEL/FIXED_FPS,1),
|
|
|
|
| 444 |
return video_path, current_seed
|
| 445 |
|
| 446 |
control_modes = """
|
| 447 |
+
**3 Control Modes Available:**
|
| 448 |
- **Reference** Generate a video incorporating elements from input reference images
|
| 449 |
- **First - Last Frame** Generate a video using first and last frame conditioning defined by input images
|
| 450 |
- **Random Transitions** Generate a video with intermediate transitions between multiple input images
|
|
|
|
| 457 |
|
| 458 |
with gr.Row():
|
| 459 |
with gr.Column():
|
| 460 |
+
with gr.Group():
|
| 461 |
+
# Radio button for mode selection with updated names
|
| 462 |
+
mode_radio = gr.Radio(
|
| 463 |
+
choices=["Reference", "First - Last frame", "Random Transitions"],
|
| 464 |
+
value="reference",
|
| 465 |
+
label="Control Mode",
|
| 466 |
+
#info="Reference: upload reference images to take elements from | First - Last Frame: upload 1st and last frames| Random Transitions: upload images to be used as frame anchors"
|
| 467 |
+
)
|
| 468 |
+
# Gallery component for multiple image upload
|
| 469 |
+
gallery_component = gr.Gallery(
|
| 470 |
+
label="upload 1 or more images",
|
| 471 |
+
show_label=True,
|
| 472 |
+
elem_id="gallery",
|
| 473 |
+
columns=3,
|
| 474 |
+
rows=2,
|
| 475 |
+
object_fit="contain",
|
| 476 |
+
height="auto",
|
| 477 |
+
type="pil",
|
| 478 |
+
allow_preview=True
|
| 479 |
+
)
|
| 480 |
+
|
| 481 |
+
|
| 482 |
+
# Background removal checkbox moved here - right beneath control modes
|
| 483 |
+
remove_bg_checkbox = gr.Checkbox(
|
| 484 |
+
label="Remove Background",
|
| 485 |
+
value=False,
|
| 486 |
+
info="removes background from input images, enable to prevent unwanted background elements in the generated video"
|
| 487 |
+
)
|
| 488 |
+
|
| 489 |
prompt_input = gr.Textbox(label="Prompt", value=MODE_PROMPTS["reference"])
|
| 490 |
duration_seconds_input = gr.Slider(
|
| 491 |
minimum=round(MIN_FRAMES_MODEL/FIXED_FPS,1),
|