Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,23 +4,25 @@ from gradio_client import Client, handle_file
|
|
4 |
def generate_video(input_image, prompt, negative_prompt, diffusion_step, height, width, scfg_scale, use_dctinit, dct_coefficients, noise_level, motion_bucket_id, seed):
|
5 |
client = Client("maxin-cn/Cinemo")
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
24 |
|
25 |
# Define the Gradio interface
|
26 |
with gr.Blocks() as demo:
|
@@ -46,5 +48,5 @@ with gr.Blocks() as demo:
|
|
46 |
|
47 |
generate_btn.click(generate_video, inputs=[input_image, prompt, negative_prompt, diffusion_step, height, width, scfg_scale, use_dctinit, dct_coefficients, noise_level, motion_bucket_id, seed], outputs=output_video)
|
48 |
|
49 |
-
# Launch the app
|
50 |
-
demo.launch()
|
|
|
4 |
def generate_video(input_image, prompt, negative_prompt, diffusion_step, height, width, scfg_scale, use_dctinit, dct_coefficients, noise_level, motion_bucket_id, seed):
|
5 |
client = Client("maxin-cn/Cinemo")
|
6 |
|
7 |
+
try:
|
8 |
+
result = client.predict(
|
9 |
+
input_image=handle_file(input_image),
|
10 |
+
prompt=prompt,
|
11 |
+
negative_prompt=negative_prompt,
|
12 |
+
diffusion_step=diffusion_step,
|
13 |
+
height=height,
|
14 |
+
width=width,
|
15 |
+
scfg_scale=scfg_scale,
|
16 |
+
use_dctinit=use_dctinit,
|
17 |
+
dct_coefficients=dct_coefficients,
|
18 |
+
noise_level=noise_level,
|
19 |
+
motion_bucket_id=motion_bucket_id,
|
20 |
+
seed=seed,
|
21 |
+
api_name="/gen_video"
|
22 |
+
)
|
23 |
+
return result
|
24 |
+
except Exception as e:
|
25 |
+
return f"Error: {str(e)}"
|
26 |
|
27 |
# Define the Gradio interface
|
28 |
with gr.Blocks() as demo:
|
|
|
48 |
|
49 |
generate_btn.click(generate_video, inputs=[input_image, prompt, negative_prompt, diffusion_step, height, width, scfg_scale, use_dctinit, dct_coefficients, noise_level, motion_bucket_id, seed], outputs=output_video)
|
50 |
|
51 |
+
# Launch the app with verbose error reporting
|
52 |
+
demo.launch(show_error=True)
|