seawolf2357 commited on
Commit
c0628c0
·
verified ·
1 Parent(s): 45509b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -127,6 +127,13 @@ def infer(image, prompt, steps=50, cfg_scale=7.5, eta=1.0, fs=3, seed=123, video
127
 
128
  css = """#input_img {max-width: 1024px !important} #output_vid {max-width: 1024px; max-height: 576px}"""
129
 
 
 
 
 
 
 
 
130
  with gr.Blocks(analytics_enabled=False, css=css) as dynamicrafter_iface:
131
  gr.Markdown("kAI 무비 스튜디오")
132
  with gr.Tab(label='Image Generation'):
@@ -177,11 +184,11 @@ with gr.Blocks(analytics_enabled=False, css=css) as dynamicrafter_iface:
177
  video_generate_btn = gr.Button("Generate Video")
178
  with gr.Row():
179
  video_output = gr.Video(label="Generated Video", autoplay=True, show_share_button=True)
 
180
  video_generate_btn.click(
181
  inputs=[video_prompt, video_seed, video_steps, video_cfg_scale, video_eta, video_fs, video_length],
182
  outputs=[video_output],
183
  fn=infer_t2v
184
  )
185
 
186
-
187
  dynamicrafter_iface.launch(show_api=True)
 
127
 
128
  css = """#input_img {max-width: 1024px !important} #output_vid {max-width: 1024px; max-height: 576px}"""
129
 
130
+ def infer_t2v(prompt, seed=123, steps=50, cfg_scale=7.5, eta=1.0, fs=3, video_length=2):
131
+ # 먼저 텍스트로부터 이미지를 생성합니다
132
+ initial_image = generate_image_from_text(prompt, seed)
133
+
134
+ # 그 다음 생성된 이미지를 사용하여 비디오를 생성합니다
135
+ return infer(initial_image, prompt, steps, cfg_scale, eta, fs, seed, video_length)
136
+
137
  with gr.Blocks(analytics_enabled=False, css=css) as dynamicrafter_iface:
138
  gr.Markdown("kAI 무비 스튜디오")
139
  with gr.Tab(label='Image Generation'):
 
184
  video_generate_btn = gr.Button("Generate Video")
185
  with gr.Row():
186
  video_output = gr.Video(label="Generated Video", autoplay=True, show_share_button=True)
187
+
188
  video_generate_btn.click(
189
  inputs=[video_prompt, video_seed, video_steps, video_cfg_scale, video_eta, video_fs, video_length],
190
  outputs=[video_output],
191
  fn=infer_t2v
192
  )
193
 
 
194
  dynamicrafter_iface.launch(show_api=True)