Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ img2vid_current_num_frames = gr.State(value=81)
|
|
66 |
preset_options = [
|
67 |
# 16:9 ๋น์จ (์ต๋/์ต์)
|
68 |
{"label": "16:9 HD (1216x684)", "width": 1216, "height": 684, "num_frames": 41, "aspect": "16:9"},
|
69 |
-
{"label": "16:9 (512x320)", "width": 512, "height": 320, "num_frames": 81, "aspect": "16:9"},
|
70 |
|
71 |
# 4:3 ๋น์จ (์ต๋/์ต์)
|
72 |
{"label": "4:3 (1024x768)", "width": 1024, "height": 768, "num_frames": 49, "aspect": "4:3"},
|
@@ -80,12 +80,10 @@ preset_options = [
|
|
80 |
{"label": "3:2 (1200x800)", "width": 1200, "height": 800, "num_frames": 49, "aspect": "3:2"},
|
81 |
|
82 |
# 9:16 ๋น์จ (์ต์)
|
83 |
-
{"label": "9:16 (432x768)", "width": 432, "height": 768, "num_frames": 81, "aspect": "9:16"}
|
84 |
-
|
85 |
-
# ์ปค์คํ
์ต์
|
86 |
-
{"label": "Custom", "width": None, "height": None, "num_frames": None, "aspect": "custom"}
|
87 |
]
|
88 |
|
|
|
89 |
# Custom constraints
|
90 |
custom_constraints = {
|
91 |
"width": {
|
@@ -249,25 +247,17 @@ pipeline = XoraVideoPipeline(
|
|
249 |
).to(device)
|
250 |
|
251 |
def preset_changed(preset):
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
return (
|
264 |
-
None,
|
265 |
-
None,
|
266 |
-
None,
|
267 |
-
gr.update(visible=True),
|
268 |
-
gr.update(visible=True),
|
269 |
-
gr.update(visible=True),
|
270 |
-
)
|
271 |
|
272 |
def generate_video_from_text(
|
273 |
prompt="",
|
|
|
66 |
preset_options = [
|
67 |
# 16:9 ๋น์จ (์ต๋/์ต์)
|
68 |
{"label": "16:9 HD (1216x684)", "width": 1216, "height": 684, "num_frames": 41, "aspect": "16:9"},
|
69 |
+
{"label": "16:9 (512x320)", "width": 512, "height": 320, "num_frames": 81, "aspect": "16:9"},
|
70 |
|
71 |
# 4:3 ๋น์จ (์ต๋/์ต์)
|
72 |
{"label": "4:3 (1024x768)", "width": 1024, "height": 768, "num_frames": 49, "aspect": "4:3"},
|
|
|
80 |
{"label": "3:2 (1200x800)", "width": 1200, "height": 800, "num_frames": 49, "aspect": "3:2"},
|
81 |
|
82 |
# 9:16 ๋น์จ (์ต์)
|
83 |
+
{"label": "9:16 (432x768)", "width": 432, "height": 768, "num_frames": 81, "aspect": "9:16"}
|
|
|
|
|
|
|
84 |
]
|
85 |
|
86 |
+
|
87 |
# Custom constraints
|
88 |
custom_constraints = {
|
89 |
"width": {
|
|
|
247 |
).to(device)
|
248 |
|
249 |
def preset_changed(preset):
|
250 |
+
selected = next(item for item in preset_options if item["label"] == preset)
|
251 |
+
return (
|
252 |
+
selected["height"],
|
253 |
+
selected["width"],
|
254 |
+
selected["num_frames"],
|
255 |
+
gr.update(visible=False),
|
256 |
+
gr.update(visible=False),
|
257 |
+
gr.update(visible=False),
|
258 |
+
)
|
259 |
+
|
260 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
|
262 |
def generate_video_from_text(
|
263 |
prompt="",
|