mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-07 02:07:03 +08:00
Fix: download_url_to_video_output return type (#103)
This commit is contained in:
parent
7967154b13
commit
67e9395017
@ -23,9 +23,7 @@ import uuid
|
||||
from io import BytesIO
|
||||
|
||||
|
||||
def download_url_to_video_output(
|
||||
video_url: str, timeout: int = None
|
||||
) -> tuple[VideoFromFile]:
|
||||
def download_url_to_video_output(video_url: str, timeout: int = None) -> VideoFromFile:
|
||||
"""Downloads a video from a URL and returns a `VIDEO` output.
|
||||
|
||||
Args:
|
||||
@ -39,7 +37,7 @@ def download_url_to_video_output(
|
||||
error_msg = f"Failed to download video from {video_url}"
|
||||
logging.error(error_msg)
|
||||
raise ValueError(error_msg)
|
||||
return (VideoFromFile(video_io),)
|
||||
return VideoFromFile(video_io)
|
||||
|
||||
|
||||
def downscale_image_tensor(image, total_pixels=1536 * 1024) -> torch.Tensor:
|
||||
|
||||
@ -314,7 +314,7 @@ class KlingTextToVideoNode(KlingNodeBase):
|
||||
video_url = str(final_response.data.task_result.videos[0].url)
|
||||
logging.debug("Kling task %s succeeded. Video URL: %s", task_id, video_url)
|
||||
|
||||
return download_url_to_video_output(video_url)
|
||||
return (download_url_to_video_output(video_url),)
|
||||
|
||||
|
||||
class KlingImage2VideoNode(KlingNodeBase):
|
||||
@ -452,7 +452,7 @@ class KlingImage2VideoNode(KlingNodeBase):
|
||||
video_url = str(final_response.data.task_result.videos[0].url)
|
||||
logging.info("Attempting to download video from URL: %s", video_url)
|
||||
|
||||
return download_url_to_video_output(video_url)
|
||||
return (download_url_to_video_output(video_url),)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
|
||||
@ -158,7 +158,7 @@ class PikaNodeBase(ComfyNodeABC):
|
||||
video_url = str(final_response.url)
|
||||
logging.debug("Pika task %s succeeded. Video URL: %s", task_id, video_url)
|
||||
|
||||
return download_url_to_video_output(video_url)
|
||||
return (download_url_to_video_output(video_url),)
|
||||
|
||||
|
||||
class PikaImageToVideoV2_2(PikaNodeBase):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user