fantaxy commited on
Commit
4774218
ยท
verified ยท
1 Parent(s): b68b74e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +65 -48
app.py CHANGED
@@ -307,55 +307,73 @@ css = """
307
  footer {
308
  visibility: hidden;
309
  }
310
- """
311
-
312
-
313
- with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as iface:
314
-
315
- with gr.Column():
316
- txt2vid_prompt = gr.Textbox(
317
- label="Step 1: Enter Your Prompt (ํ•œ๊ธ€ ๋˜๋Š” ์˜์–ด)",
318
- placeholder="์ƒ์„ฑํ•˜๊ณ  ์‹ถ์€ ๋น„๋””์˜ค๋ฅผ ์„ค๋ช…ํ•˜์„ธ์š” (์ตœ์†Œ 50์ž)...",
319
- value="๊ธด ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ์™€ ๋ฐ์€ ํ”ผ๋ถ€๋ฅผ ๊ฐ€์ง„ ์—ฌ์„ฑ์ด ๊ธด ๊ธˆ๋ฐœ ๋จธ๋ฆฌ๋ฅผ ๊ฐ€์ง„ ๋‹ค๋ฅธ ์—ฌ์„ฑ์„ ํ–ฅํ•ด ๋ฏธ์†Œ ์ง“์Šต๋‹ˆ๋‹ค. ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ ์—ฌ์„ฑ์€ ๊ฒ€์€ ์žฌํ‚ท์„ ์ž…๊ณ  ์žˆ์œผ๋ฉฐ ์˜ค๋ฅธ์ชฝ ๋บจ์— ์ž‘๊ณ  ๊ฑฐ์˜ ๋ˆˆ์— ๋„์ง€ ์•Š๋Š” ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์นด๋ฉ”๋ผ ์•ต๊ธ€์€ ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ ์—ฌ์„ฑ์˜ ์–ผ๊ตด์— ์ดˆ์ ์„ ๋งž์ถ˜ ํด๋กœ์ฆˆ์—…์ž…๋‹ˆ๋‹ค. ์กฐ๋ช…์€ ๋”ฐ๋œปํ•˜๊ณ  ์ž์—ฐ์Šค๋Ÿฌ์šฐ๋ฉฐ, ์•„๋งˆ๋„ ์ง€๋Š” ํ•ด์—์„œ ๋‚˜์˜ค๋Š” ๊ฒƒ ๊ฐ™์•„ ์žฅ๋ฉด์— ๋ถ€๋“œ๋Ÿฌ์šด ๋น›์„ ๋น„์ถฅ๋‹ˆ๋‹ค.",
320
- lines=5,
321
- )
322
-
323
-
324
- txt2vid_enhance_toggle = Toggle(
325
- label="Enhance Prompt",
326
- value=False,
327
- interactive=True,
328
- )
329
-
330
- txt2vid_negative_prompt = gr.Textbox(
331
- label="Step 2: Enter Negative Prompt",
332
- placeholder="๋น„๋””์˜ค์—์„œ ์›ํ•˜์ง€ ์•Š๋Š” ์š”์†Œ๋ฅผ ์„ค๋ช…ํ•˜์„ธ์š”...",
333
- value="low quality, worst quality, deformed, distorted, damaged, motion blur, motion artifacts, fused fingers, incorrect anatomy, strange hands, ugly",
334
- lines=2,
335
- )
336
-
337
- txt2vid_preset = gr.Dropdown(
338
- choices=[p["label"] for p in preset_options],
339
- value="512x512, 160 frames",
340
- label="Step 3.1: Choose Resolution Preset",
341
- )
342
 
343
- txt2vid_frame_rate = gr.Slider(
344
- label="Step 3.2: Frame Rate",
345
- minimum=6,
346
- maximum=60,
347
- step=1,
348
- value=20,
349
- )
350
 
351
- txt2vid_advanced = create_advanced_options()
352
- txt2vid_generate = gr.Button(
353
- "Step 5: Generate Video",
354
- variant="primary",
355
- size="lg",
356
- )
 
357
 
358
- txt2vid_output = gr.Video(label="Generated Output")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
 
360
  txt2vid_preset.change(
361
  fn=preset_changed,
@@ -378,5 +396,4 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as iface:
378
  queue=True,
379
  )
380
 
381
- iface.queue(max_size=64, default_concurrency_limit=1, api_open=False).launch(share=True, show_api=False)
382
- # ===== Application Startup at 2024-12-20 01:30:34 =====
 
307
  footer {
308
  visibility: hidden;
309
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
 
311
+ /* ๋น„๋””์˜ค ์ถœ๋ ฅ ์ปจํ…Œ์ด๋„ˆ ํฌ๊ธฐ ์กฐ์ • */
312
+ .video-output-container {
313
+ max-width: 50%;
314
+ margin-left: auto;
315
+ margin-right: auto;
316
+ }
 
317
 
318
+ /* ๋น„๋””์˜ค ํ”Œ๋ ˆ์ด์–ด ํฌ๊ธฐ ์กฐ์ • */
319
+ .video-player {
320
+ width: 100%;
321
+ max-height: 50vh;
322
+ object-fit: contain;
323
+ }
324
+ """
325
 
326
+ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as iface:
327
+ with gr.Row():
328
+ # ์ž…๋ ฅ ์„น์…˜ (์™ผ์ชฝ)
329
+ with gr.Column(scale=1):
330
+ txt2vid_prompt = gr.Textbox(
331
+ label="Step 1: Enter Your Prompt (ํ•œ๊ธ€ ๋˜๋Š” ์˜์–ด)",
332
+ placeholder="์ƒ์„ฑํ•˜๊ณ  ์‹ถ์€ ๋น„๋””์˜ค๋ฅผ ์„ค๋ช…ํ•˜์„ธ์š” (์ตœ์†Œ 50์ž)...",
333
+ value="๊ธด ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ์™€ ๋ฐ์€ ํ”ผ๋ถ€๋ฅผ ๊ฐ€์ง„ ์—ฌ์„ฑ์ด ๊ธด ๊ธˆ๋ฐœ ๋จธ๋ฆฌ๋ฅผ ๊ฐ€์ง„ ๋‹ค๋ฅธ ์—ฌ์„ฑ์„ ํ–ฅํ•ด ๋ฏธ์†Œ ์ง“์Šต๋‹ˆ๋‹ค. ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ ์—ฌ์„ฑ์€ ๊ฒ€์€ ์žฌํ‚ท์„ ์ž…๊ณ  ์žˆ์œผ๋ฉฐ ์˜ค๋ฅธ์ชฝ ๋บจ์— ์ž‘๊ณ  ๊ฑฐ์˜ ๋ˆˆ์— ๋„์ง€ ์•Š๋Š” ์ ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์นด๋ฉ”๋ผ ์•ต๊ธ€์€ ๊ฐˆ์ƒ‰ ๋จธ๋ฆฌ ์—ฌ์„ฑ์˜ ์–ผ๊ตด์— ์ดˆ์ ์„ ๋งž์ถ˜ ํด๋กœ์ฆˆ์—…์ž…๋‹ˆ๋‹ค. ์กฐ๋ช…์€ ๋”ฐ๋œปํ•˜๊ณ  ์ž์—ฐ์Šค๋Ÿฌ์šฐ๋ฉฐ, ์•„๋งˆ๋„ ์ง€๋Š” ํ•ด์—์„œ ๋‚˜์˜ค๋Š” ๊ฒƒ ๊ฐ™์•„ ์žฅ๋ฉด์— ๋ถ€๋“œ๋Ÿฌ์šด ๋น›์„ ๋น„์ถฅ๋‹ˆ๋‹ค.",
334
+ lines=5,
335
+ )
336
+
337
+ txt2vid_enhance_toggle = Toggle(
338
+ label="Enhance Prompt",
339
+ value=False,
340
+ interactive=True,
341
+ )
342
+
343
+ txt2vid_negative_prompt = gr.Textbox(
344
+ label="Step 2: Enter Negative Prompt",
345
+ placeholder="๋น„๋””์˜ค์—์„œ ์›ํ•˜์ง€ ์•Š๋Š” ์š”์†Œ๋ฅผ ์„ค๋ช…ํ•˜์„ธ์š”...",
346
+ value="low quality, worst quality, deformed, distorted, damaged, motion blur, motion artifacts, fused fingers, incorrect anatomy, strange hands, ugly",
347
+ lines=2,
348
+ )
349
+
350
+ txt2vid_preset = gr.Dropdown(
351
+ choices=[p["label"] for p in preset_options],
352
+ value="512x512, 160 frames",
353
+ label="Step 3.1: Choose Resolution Preset",
354
+ )
355
+
356
+ txt2vid_frame_rate = gr.Slider(
357
+ label="Step 3.2: Frame Rate",
358
+ minimum=6,
359
+ maximum=60,
360
+ step=1,
361
+ value=20,
362
+ )
363
+
364
+ txt2vid_advanced = create_advanced_options()
365
+ txt2vid_generate = gr.Button(
366
+ "Step 5: Generate Video",
367
+ variant="primary",
368
+ size="lg",
369
+ )
370
+
371
+ # ์ถœ๋ ฅ ์„น์…˜ (์˜ค๋ฅธ์ชฝ)
372
+ with gr.Column(scale=1):
373
+ txt2vid_output = gr.Video(
374
+ label="Generated Output",
375
+ elem_classes=["video-output-container", "video-player"]
376
+ )
377
 
378
  txt2vid_preset.change(
379
  fn=preset_changed,
 
396
  queue=True,
397
  )
398
 
399
+ iface.queue(max_size=64, default_concurrency_limit=1, api_open=False).launch(share=True, show_api=False)