Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,9 @@ async def get_camera_motions():
|
|
22 |
return []
|
23 |
|
24 |
async def generate_video(client, prompt, loop=False, aspect_ratio="16:9", camera_motion=None, extend_id=None, reverse_extend_id=None, interpolate_ids=None, progress=gr.Progress()):
|
|
|
|
|
|
|
25 |
generation_params = {
|
26 |
"prompt": prompt,
|
27 |
"loop": loop,
|
@@ -117,6 +120,9 @@ async def text_to_video(prompt, loop, aspect_ratio, camera_motion, extend_id, re
|
|
117 |
print(f"์๋ณธ ํ๋กฌํํธ: {prompt}")
|
118 |
print(f"๋ฒ์ญ๋ ํ๋กฌํํธ: {translated_prompt}")
|
119 |
|
|
|
|
|
|
|
120 |
interpolate_ids = None
|
121 |
if interpolate_id1 and interpolate_id2:
|
122 |
interpolate_ids = [interpolate_id1, interpolate_id2]
|
@@ -142,6 +148,9 @@ async def image_to_video(prompt, image_url, loop, aspect_ratio, camera_motion, p
|
|
142 |
print(f"์๋ณธ ํ๋กฌํํธ: {prompt}")
|
143 |
print(f"๋ฒ์ญ๋ ํ๋กฌํํธ: {translated_prompt}")
|
144 |
|
|
|
|
|
|
|
145 |
generation_params = {
|
146 |
"prompt": translated_prompt + (f" {camera_motion}" if camera_motion else ""),
|
147 |
"loop": loop,
|
@@ -208,7 +217,7 @@ with gr.Blocks() as demo:
|
|
208 |
loop = gr.Checkbox(label="๋ฃจํ (๋น๋์ค๋ฅผ ๋ฐ๋ณต ์ฌ์ํ ์ง ์ค์ )", value=False)
|
209 |
aspect_ratio = gr.Dropdown(
|
210 |
label="ํ๋ฉด ๋น์จ",
|
211 |
-
choices=["16:9 (์์ด๋์คํฌ๋ฆฐ)", "1:1 (์ ์ฌ๊ฐํ)", "9:16 (์ธ๋ก ์์)", "4:3 (ํ์ค)", "3:4 (์ธ๋ก ํ์ค)"],
|
212 |
value="16:9 (์์ด๋์คํฌ๋ฆฐ)"
|
213 |
)
|
214 |
camera_motion = gr.Dropdown(label="์นด๋ฉ๋ผ ๋ชจ์
(์นด๋ฉ๋ผ ์์ง์ ํจ๊ณผ ์ ํ)")
|
@@ -235,7 +244,7 @@ with gr.Blocks() as demo:
|
|
235 |
img_loop = gr.Checkbox(label="๋ฃจํ (๋น๋์ค๋ฅผ ๋ฐ๋ณต ์ฌ์ํ ์ง ์ค์ )", value=False)
|
236 |
img_aspect_ratio = gr.Dropdown(
|
237 |
label="ํ๋ฉด ๋น์จ",
|
238 |
-
choices=["16:9 (์์ด๋์คํฌ๋ฆฐ)", "1:1 (์ ์ฌ๊ฐํ)", "9:16 (์ธ๋ก ์์)", "4:3 (ํ์ค)", "3:4 (์ธ๋ก ํ์ค)"],
|
239 |
value="16:9 (์์ด๋์คํฌ๋ฆฐ)"
|
240 |
)
|
241 |
img_camera_motion = gr.Dropdown(label="์นด๋ฉ๋ผ ๋ชจ์
(์นด๋ฉ๋ผ ์์ง์ ํจ๊ณผ ์ ํ)")
|
|
|
22 |
return []
|
23 |
|
24 |
async def generate_video(client, prompt, loop=False, aspect_ratio="16:9", camera_motion=None, extend_id=None, reverse_extend_id=None, interpolate_ids=None, progress=gr.Progress()):
|
25 |
+
# aspect_ratio์์ ์ค์ ๋น์จ๋ง ์ถ์ถ
|
26 |
+
aspect_ratio = aspect_ratio.split()[0]
|
27 |
+
|
28 |
generation_params = {
|
29 |
"prompt": prompt,
|
30 |
"loop": loop,
|
|
|
120 |
print(f"์๋ณธ ํ๋กฌํํธ: {prompt}")
|
121 |
print(f"๋ฒ์ญ๋ ํ๋กฌํํธ: {translated_prompt}")
|
122 |
|
123 |
+
# aspect_ratio์์ ์ค์ ๋น์จ๋ง ์ถ์ถ
|
124 |
+
aspect_ratio = aspect_ratio.split()[0]
|
125 |
+
|
126 |
interpolate_ids = None
|
127 |
if interpolate_id1 and interpolate_id2:
|
128 |
interpolate_ids = [interpolate_id1, interpolate_id2]
|
|
|
148 |
print(f"์๋ณธ ํ๋กฌํํธ: {prompt}")
|
149 |
print(f"๋ฒ์ญ๋ ํ๋กฌํํธ: {translated_prompt}")
|
150 |
|
151 |
+
# aspect_ratio์์ ์ค์ ๋น์จ๋ง ์ถ์ถ
|
152 |
+
aspect_ratio = aspect_ratio.split()[0]
|
153 |
+
|
154 |
generation_params = {
|
155 |
"prompt": translated_prompt + (f" {camera_motion}" if camera_motion else ""),
|
156 |
"loop": loop,
|
|
|
217 |
loop = gr.Checkbox(label="๋ฃจํ (๋น๋์ค๋ฅผ ๋ฐ๋ณต ์ฌ์ํ ์ง ์ค์ )", value=False)
|
218 |
aspect_ratio = gr.Dropdown(
|
219 |
label="ํ๋ฉด ๋น์จ",
|
220 |
+
choices=["16:9 (์์ด๋์คํฌ๋ฆฐ)", "1:1 (์ ์ฌ๊ฐํ)", "9:16 (์ธ๋ก ์์)", "4:3 (ํ์ค)", "3:4 (์ธ๋ก ํ์ค)", "21:9 (์ธํธ๋ผ์์ด๋)", "9:21 (์ธ๋ก ์ธํธ๋ผ์์ด๋)"],
|
221 |
value="16:9 (์์ด๋์คํฌ๋ฆฐ)"
|
222 |
)
|
223 |
camera_motion = gr.Dropdown(label="์นด๋ฉ๋ผ ๋ชจ์
(์นด๋ฉ๋ผ ์์ง์ ํจ๊ณผ ์ ํ)")
|
|
|
244 |
img_loop = gr.Checkbox(label="๋ฃจํ (๋น๋์ค๋ฅผ ๋ฐ๋ณต ์ฌ์ํ ์ง ์ค์ )", value=False)
|
245 |
img_aspect_ratio = gr.Dropdown(
|
246 |
label="ํ๋ฉด ๋น์จ",
|
247 |
+
choices=["16:9 (์์ด๋์คํฌ๋ฆฐ)", "1:1 (์ ์ฌ๊ฐํ)", "9:16 (์ธ๋ก ์์)", "4:3 (ํ์ค)", "3:4 (์ธ๋ก ํ์ค)", "21:9 (์ธํธ๋ผ์์ด๋)", "9:21 (์ธ๋ก ์ธํธ๋ผ์์ด๋)"],
|
248 |
value="16:9 (์์ด๋์คํฌ๋ฆฐ)"
|
249 |
)
|
250 |
img_camera_motion = gr.Dropdown(label="์นด๋ฉ๋ผ ๋ชจ์
(์นด๋ฉ๋ผ ์์ง์ ํจ๊ณผ ์ ํ)")
|