openfree commited on
Commit
2f4d425
β€’
1 Parent(s): 349da64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -28
app.py CHANGED
@@ -212,15 +212,15 @@ pipeline = XoraVideoPipeline(
212
  vae=vae,
213
  ).to(device)
214
 
 
 
 
 
215
 
216
- # ν˜„μž¬ μ„ νƒλœ 값듀을 μ €μž₯ν•  μƒνƒœ λ³€μˆ˜λ“€
217
- txt2vid_current_height = gr.State(value=320) # μˆ˜μ •λ¨
218
- txt2vid_current_width = gr.State(value=512) # μˆ˜μ •λ¨
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
- if preset != "Custom":
257
- selected = next(item for item in preset_options if item["label"] == preset)
258
- # height, width, num_frames 값을 global λ³€μˆ˜λ‘œ μ—…λ°μ΄νŠΈ
259
- return (
260
- selected["height"],
261
- selected["width"],
262
- selected["num_frames"],
263
- gr.update(visible=False),
264
- gr.update(visible=False),
265
- gr.update(visible=False),
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(