Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -212,15 +212,15 @@ pipeline = XoraVideoPipeline(
|
|
212 |
vae=vae,
|
213 |
).to(device)
|
214 |
|
|
|
|
|
|
|
|
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
txt2vid_current_num_frames = gr.State(value=257) # 10.3μ΄
|
220 |
|
221 |
-
img2vid_current_height = gr.State(value=320) # μμ λ¨
|
222 |
-
img2vid_current_width = gr.State(value=512) # μμ λ¨
|
223 |
-
img2vid_current_num_frames = gr.State(value=257) # 10.3μ΄
|
224 |
|
225 |
# Preset options for resolution and frame configuration
|
226 |
# Convert frames to seconds assuming 25 FPS
|
@@ -251,28 +251,18 @@ preset_options = [
|
|
251 |
{"label": "[16:9] 544x320, 9.6μ΄", "width": 544, "height": 320, "num_frames": 241},
|
252 |
{"label": "[16:9] 512x320, 10.3μ΄", "width": 512, "height": 320, "num_frames": 257},
|
253 |
]
|
254 |
-
|
255 |
def preset_changed(preset):
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
)
|
267 |
-
else:
|
268 |
-
return (
|
269 |
-
None,
|
270 |
-
None,
|
271 |
-
None,
|
272 |
-
gr.update(visible=True),
|
273 |
-
gr.update(visible=True),
|
274 |
-
gr.update(visible=True),
|
275 |
-
)
|
276 |
|
277 |
|
278 |
def generate_video_from_text(
|
|
|
212 |
vae=vae,
|
213 |
).to(device)
|
214 |
|
215 |
+
# State λ³μλ€μ μ΄κΈ°κ° μμ
|
216 |
+
txt2vid_current_height = gr.State(value=320)
|
217 |
+
txt2vid_current_width = gr.State(value=512)
|
218 |
+
txt2vid_current_num_frames = gr.State(value=257) # 10.3μ΄
|
219 |
|
220 |
+
img2vid_current_height = gr.State(value=320)
|
221 |
+
img2vid_current_width = gr.State(value=512)
|
222 |
+
img2vid_current_num_frames = gr.State(value=257) # 10.3μ΄
|
|
|
223 |
|
|
|
|
|
|
|
224 |
|
225 |
# Preset options for resolution and frame configuration
|
226 |
# Convert frames to seconds assuming 25 FPS
|
|
|
251 |
{"label": "[16:9] 544x320, 9.6μ΄", "width": 544, "height": 320, "num_frames": 241},
|
252 |
{"label": "[16:9] 512x320, 10.3μ΄", "width": 512, "height": 320, "num_frames": 257},
|
253 |
]
|
254 |
+
# preset_changed ν¨μ λ¨μν
|
255 |
def preset_changed(preset):
|
256 |
+
selected = next(item for item in preset_options if item["label"] == preset)
|
257 |
+
return (
|
258 |
+
selected["height"],
|
259 |
+
selected["width"],
|
260 |
+
selected["num_frames"],
|
261 |
+
gr.update(visible=False),
|
262 |
+
gr.update(visible=False),
|
263 |
+
gr.update(visible=False),
|
264 |
+
)
|
265 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
|
268 |
def generate_video_from_text(
|