Shalmoni commited on
Commit
da58b88
Β·
verified Β·
1 Parent(s): 0247b0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -15
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 (three columns)
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 (standalone, not inside the Row above)
136
  seed = gr.Number(value=0, precision=0, label="Seed (0 = random)")
137
 
138
- # Stitch 1β†’2 (prompt+button row, then video below)
139
  with gr.Row():
140
- prompt12 = gr.Textbox(placeholder="Prompt for stitching 1β†’2", lines=2, label="Prompt (1β†’2)", elem_classes=["rounded"])
141
- btn12 = gr.Button("Stitch 1β†’2", elem_classes=["pill"])
142
- vid12 = gr.Video(label="Video (1β†’2)", interactive=False)
143
-
144
- # Stitch 2β†’3
 
 
 
 
 
145
  with gr.Row():
146
- prompt23 = gr.Textbox(placeholder="Prompt for stitching 2β†’3", lines=2, label="Prompt (2β†’3)", elem_classes=["rounded"])
147
- btn23 = gr.Button("Stitch 2β†’3", elem_classes=["pill"])
148
- vid23 = gr.Video(label="Video (2β†’3)", interactive=False)
149
-
150
- # Final merge
151
- btn_all = gr.Button("Stitch All (concatenate 1β†’2 then 2β†’3)", elem_classes=["pill"])
152
- vid_all = gr.Video(label="Final Combined Video", interactive=False)
 
 
 
 
 
 
 
 
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])