Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -174,23 +174,27 @@ async def image_to_video(prompt, image_url, loop, aspect_ratio, camera_motion, p
|
|
174 |
return None, f"An error occurred: {str(e)}"
|
175 |
|
176 |
with gr.Blocks() as demo:
|
177 |
-
gr.Markdown("# Luma AI
|
178 |
|
179 |
-
with gr.Tab("
|
180 |
-
prompt = gr.Textbox(label="
|
181 |
-
generate_btn = gr.Button("
|
182 |
-
video_output = gr.Video(label="
|
183 |
-
error_output = gr.Textbox(label="
|
184 |
|
185 |
-
with gr.Accordion("
|
186 |
-
loop = gr.Checkbox(label="
|
187 |
-
aspect_ratio = gr.Dropdown(
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
|
|
|
|
|
|
191 |
with gr.Row():
|
192 |
-
interpolate_id1 = gr.Textbox(label="
|
193 |
-
interpolate_id2 = gr.Textbox(label="
|
194 |
|
195 |
generate_btn.click(
|
196 |
text_to_video,
|
@@ -198,17 +202,21 @@ with gr.Blocks() as demo:
|
|
198 |
outputs=[video_output, error_output]
|
199 |
)
|
200 |
|
201 |
-
with gr.Tab("
|
202 |
-
img_prompt = gr.Textbox(label="
|
203 |
-
img_url = gr.Textbox(label="
|
204 |
-
img_generate_btn = gr.Button("
|
205 |
-
img_video_output = gr.Video(label="
|
206 |
-
img_error_output = gr.Textbox(label="
|
207 |
|
208 |
-
with gr.Accordion("
|
209 |
-
img_loop = gr.Checkbox(label="
|
210 |
-
img_aspect_ratio = gr.Dropdown(
|
211 |
-
|
|
|
|
|
|
|
|
|
212 |
|
213 |
img_generate_btn.click(
|
214 |
image_to_video,
|
@@ -221,7 +229,7 @@ with gr.Blocks() as demo:
|
|
221 |
motions = await get_camera_motions()
|
222 |
return gr.update(choices=motions), gr.update(choices=motions)
|
223 |
except Exception as e:
|
224 |
-
print(f"
|
225 |
return gr.update(choices=[]), gr.update(choices=[])
|
226 |
|
227 |
demo.load(update_camera_motions, outputs=[camera_motion, img_camera_motion])
|
|
|
174 |
return None, f"An error occurred: {str(e)}"
|
175 |
|
176 |
with gr.Blocks() as demo:
|
177 |
+
gr.Markdown("# Luma AI ํ
์คํธ-๋น๋์ค ์์ฑ ๋ฐ๋ชจ")
|
178 |
|
179 |
+
with gr.Tab("ํ
์คํธ๋ก ๋น๋์ค ๋ง๋ค๊ธฐ"):
|
180 |
+
prompt = gr.Textbox(label="ํ๋กฌํํธ (๋น๋์ค์ ๋ํ ์ค๋ช
์ ์
๋ ฅํ์ธ์)")
|
181 |
+
generate_btn = gr.Button("๋น๋์ค ์์ฑ")
|
182 |
+
video_output = gr.Video(label="์์ฑ๋ ๋น๋์ค")
|
183 |
+
error_output = gr.Textbox(label="์ค๋ฅ ๋ฉ์์ง", visible=True)
|
184 |
|
185 |
+
with gr.Accordion("๊ณ ๊ธ ์ต์
", open=False):
|
186 |
+
loop = gr.Checkbox(label="๋ฃจํ (๋น๋์ค๋ฅผ ๋ฐ๋ณต ์ฌ์ํ ์ง ์ค์ )", value=False)
|
187 |
+
aspect_ratio = gr.Dropdown(
|
188 |
+
label="ํ๋ฉด ๋น์จ",
|
189 |
+
choices=["16:9 (์์ด๋์คํฌ๋ฆฐ)", "1:1 (์ ์ฌ๊ฐํ)", "9:16 (์ธ๋ก ์์)", "4:3 (ํ์ค)", "3:4 (์ธ๋ก ํ์ค)"],
|
190 |
+
value="16:9 (์์ด๋์คํฌ๋ฆฐ)"
|
191 |
+
)
|
192 |
+
camera_motion = gr.Dropdown(label="์นด๋ฉ๋ผ ๋ชจ์
(์นด๋ฉ๋ผ ์์ง์ ํจ๊ณผ ์ ํ)")
|
193 |
+
extend_id = gr.Textbox(label="ํ์ฅํ ๋น๋์ค ID (๊ธฐ์กด ๋น๋์ค๋ฅผ ์ด์ด์ ์์ฑํ ๋ ์
๋ ฅ)")
|
194 |
+
reverse_extend_id = gr.Textbox(label="์ญ๋ฐฉํฅ ํ์ฅํ ๋น๋์ค ID (๊ธฐ์กด ๋น๋์ค์ ์๋ถ๋ถ์ ์์ฑํ ๋ ์
๋ ฅ)")
|
195 |
with gr.Row():
|
196 |
+
interpolate_id1 = gr.Textbox(label="๋ณด๊ฐ ๋น๋์ค ID 1 (๋ ๋น๋์ค ์ฌ์ด๋ฅผ ๋ณด๊ฐํ ๋ ์ฒซ ๋ฒ์งธ ๋น๋์ค ID)")
|
197 |
+
interpolate_id2 = gr.Textbox(label="๋ณด๊ฐ ๋น๋์ค ID 2 (๋ ๋น๋์ค ์ฌ์ด๋ฅผ ๋ณด๊ฐํ ๋ ๋ ๋ฒ์งธ ๋น๋์ค ID)")
|
198 |
|
199 |
generate_btn.click(
|
200 |
text_to_video,
|
|
|
202 |
outputs=[video_output, error_output]
|
203 |
)
|
204 |
|
205 |
+
with gr.Tab("์ด๋ฏธ์ง๋ก ๋น๋์ค ๋ง๋ค๊ธฐ"):
|
206 |
+
img_prompt = gr.Textbox(label="ํ๋กฌํํธ (์ด๋ฏธ์ง๋ฅผ ๋ฐํ์ผ๋ก ์์ฑํ ๋น๋์ค์ ๋ํ ์ค๋ช
)")
|
207 |
+
img_url = gr.Textbox(label="์ด๋ฏธ์ง URL (๋ณํํ๊ณ ์ ํ๋ ์ด๋ฏธ์ง์ ์น ์ฃผ์)")
|
208 |
+
img_generate_btn = gr.Button("์ด๋ฏธ์ง๋ก ๋น๋์ค ์์ฑ")
|
209 |
+
img_video_output = gr.Video(label="์์ฑ๋ ๋น๋์ค")
|
210 |
+
img_error_output = gr.Textbox(label="์ค๋ฅ ๋ฉ์์ง", visible=True)
|
211 |
|
212 |
+
with gr.Accordion("๊ณ ๊ธ ์ต์
", open=False):
|
213 |
+
img_loop = gr.Checkbox(label="๋ฃจํ (๋น๋์ค๋ฅผ ๋ฐ๋ณต ์ฌ์ํ ์ง ์ค์ )", value=False)
|
214 |
+
img_aspect_ratio = gr.Dropdown(
|
215 |
+
label="ํ๋ฉด ๋น์จ",
|
216 |
+
choices=["16:9 (์์ด๋์คํฌ๋ฆฐ)", "1:1 (์ ์ฌ๊ฐํ)", "9:16 (์ธ๋ก ์์)", "4:3 (ํ์ค)", "3:4 (์ธ๋ก ํ์ค)"],
|
217 |
+
value="16:9 (์์ด๋์คํฌ๋ฆฐ)"
|
218 |
+
)
|
219 |
+
img_camera_motion = gr.Dropdown(label="์นด๋ฉ๋ผ ๋ชจ์
(์นด๋ฉ๋ผ ์์ง์ ํจ๊ณผ ์ ํ)")
|
220 |
|
221 |
img_generate_btn.click(
|
222 |
image_to_video,
|
|
|
229 |
motions = await get_camera_motions()
|
230 |
return gr.update(choices=motions), gr.update(choices=motions)
|
231 |
except Exception as e:
|
232 |
+
print(f"์นด๋ฉ๋ผ ๋ชจ์
์
๋ฐ์ดํธ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}")
|
233 |
return gr.update(choices=[]), gr.update(choices=[])
|
234 |
|
235 |
demo.load(update_camera_motions, outputs=[camera_motion, img_camera_motion])
|