openfree commited on
Commit
e8534ac
Β·
verified Β·
1 Parent(s): 14ff93f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -19
app.py CHANGED
@@ -53,37 +53,35 @@ system_prompt_i2v = """당신은 이미지 기반 λΉ„λ””μ˜€ 생성을 μœ„ν•œ ν”„
53
  # Default preset
54
  default_preset = "16:9 (512x320)"
55
 
56
- # 초기 default_preset "16:9 (512x320)"에 λ§žμΆ”μ–΄ num_frames μ΄ˆκΈ°κ°’ μ„€μ •
57
- txt2vid_current_height = gr.State(value=320)
58
- txt2vid_current_width = gr.State(value=512)
59
- txt2vid_current_num_frames = gr.State(value=257) # 10.3초 (257 ν”„λ ˆμž„)
60
-
61
- img2vid_current_height = gr.State(value=320)
62
- img2vid_current_width = gr.State(value=512)
63
- img2vid_current_num_frames = gr.State(value=257) # 10.3초 (257 ν”„λ ˆμž„)
64
-
65
-
66
- # preset_options μˆ˜μ • - 16:9 μ΅œμ†Œ 크기 λ³€κ²½
67
  preset_options = [
68
  # 16:9 λΉ„μœ¨ (μ΅œλŒ€/μ΅œμ†Œ)
69
- {"label": "16:9 HD (1216x684)", "width": 1216, "height": 684, "num_frames": 41, "aspect": "16:9"},
70
- {"label": "16:9 (512x320)", "width": 512, "height": 320, "num_frames": 81, "aspect": "16:9"},
71
 
72
  # 4:3 λΉ„μœ¨ (μ΅œλŒ€/μ΅œμ†Œ)
73
- {"label": "4:3 (1024x768)", "width": 1024, "height": 768, "num_frames": 49, "aspect": "4:3"},
74
- {"label": "4:3 (640x480)", "width": 640, "height": 480, "num_frames": 73, "aspect": "4:3"},
75
 
76
  # 1:1 λΉ„μœ¨ (μ΅œλŒ€/μ΅œμ†Œ)
77
- {"label": "1:1 (896x896)", "width": 896, "height": 896, "num_frames": 57, "aspect": "1:1"},
78
- {"label": "1:1 (512x512)", "width": 512, "height": 512, "num_frames": 81, "aspect": "1:1"},
79
 
80
  # 3:2 λΉ„μœ¨ (μ΅œλŒ€)
81
- {"label": "3:2 (1200x800)", "width": 1200, "height": 800, "num_frames": 49, "aspect": "3:2"},
82
 
83
  # 9:16 λΉ„μœ¨ (μ΅œμ†Œ)
84
- {"label": "9:16 (432x768)", "width": 432, "height": 768, "num_frames": 81, "aspect": "9:16"}
85
  ]
86
 
 
 
 
 
 
 
 
 
87
 
88
 
89
  # Load Hugging Face token if needed
 
53
  # Default preset
54
  default_preset = "16:9 (512x320)"
55
 
56
+ # preset_options μˆ˜μ • - 각 해상도별 μ •ν™•ν•œ ν”„λ ˆμž„ 수 적용
 
 
 
 
 
 
 
 
 
 
57
  preset_options = [
58
  # 16:9 λΉ„μœ¨ (μ΅œλŒ€/μ΅œμ†Œ)
59
+ {"label": "16:9 HD (1216x684)", "width": 1216, "height": 684, "num_frames": 41, "aspect": "16:9"}, # 1.6초
60
+ {"label": "16:9 (512x320)", "width": 512, "height": 320, "num_frames": 257, "aspect": "16:9"}, # 10.3초
61
 
62
  # 4:3 λΉ„μœ¨ (μ΅œλŒ€/μ΅œμ†Œ)
63
+ {"label": "4:3 (1024x768)", "width": 1024, "height": 768, "num_frames": 49, "aspect": "4:3"}, # 2.0초
64
+ {"label": "4:3 (640x480)", "width": 640, "height": 480, "num_frames": 121, "aspect": "4:3"}, # 4.8초
65
 
66
  # 1:1 λΉ„μœ¨ (μ΅œλŒ€/μ΅œμ†Œ)
67
+ {"label": "1:1 (896x896)", "width": 896, "height": 896, "num_frames": 73, "aspect": "1:1"}, # 2.9초
68
+ {"label": "1:1 (512x512)", "width": 512, "height": 512, "num_frames": 233, "aspect": "1:1"}, # 9.3초
69
 
70
  # 3:2 λΉ„μœ¨ (μ΅œλŒ€)
71
+ {"label": "3:2 (1200x800)", "width": 1200, "height": 800, "num_frames": 41, "aspect": "3:2"}, # 1.6초
72
 
73
  # 9:16 λΉ„μœ¨ (μ΅œμ†Œ)
74
+ {"label": "9:16 (432x768)", "width": 432, "height": 768, "num_frames": 241, "aspect": "9:16"} # 9.6초
75
  ]
76
 
77
+ # State λ³€μˆ˜λ“€μ˜ μ΄ˆκΈ°κ°’λ„ μˆ˜μ • (512x320 κΈ°μ€€)
78
+ txt2vid_current_height = gr.State(value=320)
79
+ txt2vid_current_width = gr.State(value=512)
80
+ txt2vid_current_num_frames = gr.State(value=257) # 10.3초
81
+
82
+ img2vid_current_height = gr.State(value=320)
83
+ img2vid_current_width = gr.State(value=512)
84
+ img2vid_current_num_frames = gr.State(value=257) # 10.3초
85
 
86
 
87
  # Load Hugging Face token if needed