Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,7 +123,7 @@ CSS = """
|
|
| 123 |
with gr.Blocks(css=CSS, title="Stitch β vertical flow") as demo:
|
| 124 |
gr.Markdown("## Stitch β Upload 3 images (top), then stitch 1β2 and 2β3, then merge.")
|
| 125 |
|
| 126 |
-
# Top row: 1 - 2 - 3 (
|
| 127 |
with gr.Row():
|
| 128 |
with gr.Column(scale=1, min_width=280):
|
| 129 |
img1 = gr.Image(label="Image 1 upload", type="pil")
|
|
@@ -132,24 +132,37 @@ with gr.Blocks(css=CSS, title="Stitch β vertical flow") as demo:
|
|
| 132 |
with gr.Column(scale=1, min_width=280):
|
| 133 |
img3 = gr.Image(label="Image 3 upload", type="pil")
|
| 134 |
|
| 135 |
-
# Seed
|
| 136 |
seed = gr.Number(value=0, precision=0, label="Seed (0 = random)")
|
| 137 |
|
| 138 |
-
# Stitch 1β2
|
| 139 |
with gr.Row():
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
with gr.Row():
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
# Wire buttons
|
| 155 |
btn12.click(stitch_12, inputs=[prompt12, seed, img1, img2], outputs=[vid12])
|
|
|
|
| 123 |
with gr.Blocks(css=CSS, title="Stitch β vertical flow") as demo:
|
| 124 |
gr.Markdown("## Stitch β Upload 3 images (top), then stitch 1β2 and 2β3, then merge.")
|
| 125 |
|
| 126 |
+
# Top row: 1 - 2 - 3 (side-by-side)
|
| 127 |
with gr.Row():
|
| 128 |
with gr.Column(scale=1, min_width=280):
|
| 129 |
img1 = gr.Image(label="Image 1 upload", type="pil")
|
|
|
|
| 132 |
with gr.Column(scale=1, min_width=280):
|
| 133 |
img3 = gr.Image(label="Image 3 upload", type="pil")
|
| 134 |
|
| 135 |
+
# Seed under the uploads
|
| 136 |
seed = gr.Number(value=0, precision=0, label="Seed (0 = random)")
|
| 137 |
|
| 138 |
+
# Stitch 1β2: LEFT = prompt+button, RIGHT = video
|
| 139 |
with gr.Row():
|
| 140 |
+
with gr.Column(scale=1, min_width=420):
|
| 141 |
+
prompt12 = gr.Textbox(
|
| 142 |
+
placeholder="Prompt for stitching 1β2",
|
| 143 |
+
lines=2, label="Prompt (1β2)", elem_classes=["rounded"]
|
| 144 |
+
)
|
| 145 |
+
btn12 = gr.Button("Stitch 1β2", elem_classes=["pill"], full_width=True)
|
| 146 |
+
with gr.Column(scale=1, min_width=420):
|
| 147 |
+
vid12 = gr.Video(label="Video (1β2)", interactive=False)
|
| 148 |
+
|
| 149 |
+
# Stitch 2β3: LEFT = prompt+button, RIGHT = video
|
| 150 |
with gr.Row():
|
| 151 |
+
with gr.Column(scale=1, min_width=420):
|
| 152 |
+
prompt23 = gr.Textbox(
|
| 153 |
+
placeholder="Prompt for stitching 2β3",
|
| 154 |
+
lines=2, label="Prompt (2β3)", elem_classes=["rounded"]
|
| 155 |
+
)
|
| 156 |
+
btn23 = gr.Button("Stitch 2β3", elem_classes=["pill"], full_width=True)
|
| 157 |
+
with gr.Column(scale=1, min_width=420):
|
| 158 |
+
vid23 = gr.Video(label="Video (2β3)", interactive=False)
|
| 159 |
+
|
| 160 |
+
# Final merge: LEFT = button, RIGHT = final video
|
| 161 |
+
with gr.Row():
|
| 162 |
+
with gr.Column(scale=1, min_width=420):
|
| 163 |
+
btn_all = gr.Button("Stitch All (concatenate 1β2 then 2β3)", elem_classes=["pill"], full_width=True)
|
| 164 |
+
with gr.Column(scale=1, min_width=420):
|
| 165 |
+
vid_all = gr.Video(label="Final Combined Video", interactive=False)
|
| 166 |
|
| 167 |
# Wire buttons
|
| 168 |
btn12.click(stitch_12, inputs=[prompt12, seed, img1, img2], outputs=[vid12])
|