mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-08 17:17:04 +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
|
from io import BytesIO
|
||||||
|
|
||||||
|
|
||||||
def download_url_to_video_output(
|
def download_url_to_video_output(video_url: str, timeout: int = None) -> VideoFromFile:
|
||||||
video_url: str, timeout: int = None
|
|
||||||
) -> tuple[VideoFromFile]:
|
|
||||||
"""Downloads a video from a URL and returns a `VIDEO` output.
|
"""Downloads a video from a URL and returns a `VIDEO` output.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -39,7 +37,7 @@ def download_url_to_video_output(
|
|||||||
error_msg = f"Failed to download video from {video_url}"
|
error_msg = f"Failed to download video from {video_url}"
|
||||||
logging.error(error_msg)
|
logging.error(error_msg)
|
||||||
raise ValueError(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:
|
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)
|
video_url = str(final_response.data.task_result.videos[0].url)
|
||||||
logging.debug("Kling task %s succeeded. Video URL: %s", task_id, video_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):
|
class KlingImage2VideoNode(KlingNodeBase):
|
||||||
@ -452,7 +452,7 @@ class KlingImage2VideoNode(KlingNodeBase):
|
|||||||
video_url = str(final_response.data.task_result.videos[0].url)
|
video_url = str(final_response.data.task_result.videos[0].url)
|
||||||
logging.info("Attempting to download video from URL: %s", video_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 = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
|||||||
@ -158,7 +158,7 @@ class PikaNodeBase(ComfyNodeABC):
|
|||||||
video_url = str(final_response.url)
|
video_url = str(final_response.url)
|
||||||
logging.debug("Pika task %s succeeded. Video URL: %s", task_id, video_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):
|
class PikaImageToVideoV2_2(PikaNodeBase):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user