Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -112,19 +112,14 @@ def create_temp_input_json(prompt: str, cond_image_path: str, cond_audio_path: s
|
|
112 |
|
113 |
def infer(prompt, cond_image_path, cond_audio_path):
|
114 |
|
115 |
-
# Example usage (from user input)
|
116 |
-
prompt = "A woman sings passionately in a dimly lit studio."
|
117 |
-
cond_image_path = "examples/single/single1.png" # Assume uploaded via Gradio
|
118 |
-
cond_audio_path = "examples/single/1.wav" # Assume uploaded via Gradio
|
119 |
-
|
120 |
input_json_path = create_temp_input_json(prompt, cond_image_path, cond_audio_path)
|
121 |
|
122 |
cmd = [
|
123 |
"python3", "generate_multitalk.py",
|
124 |
"--ckpt_dir", "weights/Wan2.1-I2V-14B-480P",
|
125 |
"--wav2vec_dir", "weights/chinese-wav2vec2-base",
|
126 |
-
"--input_json",
|
127 |
-
"--sample_steps", "
|
128 |
#"--motion_frame", "2",
|
129 |
"--num_persistent_param_in_dit", str(USED_VRAM_PARAMS),
|
130 |
"--mode", "streaming",
|
@@ -180,6 +175,13 @@ with gr.Blocks(title="MultiTalk Inference") as demo:
|
|
180 |
|
181 |
submit_btn = gr.Button("Generate")
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
with gr.Column():
|
184 |
output_video = gr.Video(label="Generated Video")
|
185 |
|
|
|
112 |
|
113 |
def infer(prompt, cond_image_path, cond_audio_path):
|
114 |
|
|
|
|
|
|
|
|
|
|
|
115 |
input_json_path = create_temp_input_json(prompt, cond_image_path, cond_audio_path)
|
116 |
|
117 |
cmd = [
|
118 |
"python3", "generate_multitalk.py",
|
119 |
"--ckpt_dir", "weights/Wan2.1-I2V-14B-480P",
|
120 |
"--wav2vec_dir", "weights/chinese-wav2vec2-base",
|
121 |
+
"--input_json", input_json_path,
|
122 |
+
"--sample_steps", "12",
|
123 |
#"--motion_frame", "2",
|
124 |
"--num_persistent_param_in_dit", str(USED_VRAM_PARAMS),
|
125 |
"--mode", "streaming",
|
|
|
175 |
|
176 |
submit_btn = gr.Button("Generate")
|
177 |
|
178 |
+
gr.Examples(
|
179 |
+
examples = [
|
180 |
+
["A woman sings passionately in a dimly lit studio.", "examples/single/single1.png", "examples/single/1.wav"]
|
181 |
+
],
|
182 |
+
inputs = [prompt_input, image_input, audio_input]
|
183 |
+
)
|
184 |
+
|
185 |
with gr.Column():
|
186 |
output_video = gr.Video(label="Generated Video")
|
187 |
|