NihalGazi commited on
Commit
29aa532
1 Parent(s): 9afc9d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -19
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
- result = client.predict(
8
- input_image=handle_file(input_image),
9
- prompt=prompt,
10
- negative_prompt=negative_prompt,
11
- diffusion_step=diffusion_step,
12
- height=height,
13
- width=width,
14
- scfg_scale=scfg_scale,
15
- use_dctinit=use_dctinit,
16
- dct_coefficients=dct_coefficients,
17
- noise_level=noise_level,
18
- motion_bucket_id=motion_bucket_id,
19
- seed=seed,
20
- api_name="/gen_video"
21
- )
22
-
23
- return result
 
 
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)