LPX55 commited on
Commit
141fd6e
·
verified ·
1 Parent(s): 45ee339

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -101,7 +101,7 @@ def generate_video(prompt: str, frame1_path: str, frame2_path: str, guidance_sca
101
  cond_frame1 = Image.open(frame1_path)
102
  cond_frame2 = Image.open(frame2_path)
103
 
104
- height, width = 720, 1280
105
  cond_frame1 = resize_image_to_bucket(cond_frame1, bucket_reso=(width, height))
106
  cond_frame2 = resize_image_to_bucket(cond_frame2, bucket_reso=(width, height))
107
 
@@ -199,9 +199,9 @@ def call_pipe(
199
  prompt: Union[str, List[str]] = None,
200
  prompt_2: Union[str, List[str]] = None,
201
  height: int = 720,
202
- width: int = 1280,
203
  num_frames: int = 129,
204
- num_inference_steps: int = 50,
205
  sigmas: Optional[List[float]] = None,
206
  guidance_scale: float = 6.0,
207
  num_videos_per_prompt: Optional[int] = 1,
@@ -346,6 +346,10 @@ def call_pipe(
346
  return HunyuanVideoPipelineOutput(frames=video)
347
 
348
  def main():
 
 
 
 
349
  gr.Markdown(
350
  """
351
  - https://i-bacon.bunkr.ru/11b45aa7-630b-4189-996f-a6b37a697786.png
@@ -367,10 +371,12 @@ def main():
367
  outputs = [
368
  gr.Video(label="Generated Video"),
369
  ]
370
-
 
 
371
  # Create the Gradio interface
372
  iface = gr.Interface(
373
- fn=generate_video,
374
  inputs=inputs,
375
  outputs=outputs,
376
  title="Hunyuan Video Generator",
 
101
  cond_frame1 = Image.open(frame1_path)
102
  cond_frame2 = Image.open(frame2_path)
103
 
104
+ height, width = 720, 720
105
  cond_frame1 = resize_image_to_bucket(cond_frame1, bucket_reso=(width, height))
106
  cond_frame2 = resize_image_to_bucket(cond_frame2, bucket_reso=(width, height))
107
 
 
199
  prompt: Union[str, List[str]] = None,
200
  prompt_2: Union[str, List[str]] = None,
201
  height: int = 720,
202
+ width: int = 720,
203
  num_frames: int = 129,
204
+ num_inference_steps: int = 30,
205
  sigmas: Optional[List[float]] = None,
206
  guidance_scale: float = 6.0,
207
  num_videos_per_prompt: Optional[int] = 1,
 
346
  return HunyuanVideoPipelineOutput(frames=video)
347
 
348
  def main():
349
+ model_id = "hunyuanvideo-community/HunyuanVideo"
350
+ lora_path = hf_hub_download("dashtoon/hunyuan-video-keyframe-control-lora", "i2v.sft") # Replace with the actual LORA path
351
+ pipe = construct_video_pipeline(model_id, lora_path)
352
+
353
  gr.Markdown(
354
  """
355
  - https://i-bacon.bunkr.ru/11b45aa7-630b-4189-996f-a6b37a697786.png
 
371
  outputs = [
372
  gr.Video(label="Generated Video"),
373
  ]
374
+ def generate_video_wrapper(*args):
375
+ return generate_video(pipe, *args)
376
+
377
  # Create the Gradio interface
378
  iface = gr.Interface(
379
+ fn=generate_video_wrapper,
380
  inputs=inputs,
381
  outputs=outputs,
382
  title="Hunyuan Video Generator",