openfree commited on
Commit
c69a6bc
ยท
verified ยท
1 Parent(s): c720814

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -24
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
- if preset != "Custom":
253
- selected = next(item for item in preset_options if item["label"] == preset)
254
- return (
255
- selected["height"],
256
- selected["width"],
257
- selected["num_frames"],
258
- gr.update(visible=False),
259
- gr.update(visible=False),
260
- gr.update(visible=False),
261
- )
262
- else:
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="",