multimodalart HF Staff commited on
Commit
ebda337
·
verified ·
1 Parent(s): 20e4eed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -56,14 +56,14 @@ optimize_pipeline_(pipe, image=[Image.new("RGB", (1024, 1024)), Image.new("RGB",
56
 
57
  MAX_SEED = np.iinfo(np.int32).max
58
 
59
- def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str) -> str:
60
  """Generates a single video segment using the external service."""
61
- video_client = Client("multimodalart/wan-2-2-first-last-frame", hf_token=os.getenv("TEMP_TOKEN"))
 
62
  result = video_client.predict(
63
  start_image_pil=handle_file(input_image_path),
64
  end_image_pil=handle_file(output_image_path),
65
  prompt=prompt, api_name="/generate_video",
66
-
67
  )
68
  return result[0]["video"]
69
 
 
56
 
57
  MAX_SEED = np.iinfo(np.int32).max
58
 
59
+ def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str, request: gr.Request) -> str:
60
  """Generates a single video segment using the external service."""
61
+ x_ip_token = request.headers['x-ip-token']
62
+ video_client = Client("multimodalart/wan-2-2-first-last-frame", headers={"x-ip-token": x_ip_token})
63
  result = video_client.predict(
64
  start_image_pil=handle_file(input_image_path),
65
  end_image_pil=handle_file(output_image_path),
66
  prompt=prompt, api_name="/generate_video",
 
67
  )
68
  return result[0]["video"]
69