Fix: download_url_to_video_output return type (#103)

This commit is contained in:
Christian Byrne 2025-05-01 17:40:05 -07:00 committed by GitHub
parent 7967154b13
commit 67e9395017
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 7 deletions

View File

@ -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:

View File

@ -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 = {

View File

@ -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):