Use common download function in kling nodes module (#67)

This commit is contained in:
Christian Byrne 2025-04-30 10:39:46 -07:00 committed by Jedrzej Kosinski
parent 67daa11ea9
commit 7ff8274272

View File

@ -27,7 +27,7 @@ from comfy_api_nodes.apis.client import (
) )
from comfy_api_nodes.apinode_utils import ( from comfy_api_nodes.apinode_utils import (
tensor_to_base64_string, tensor_to_base64_string,
download_url_to_bytesio, download_url_to_video_output,
) )
from comfy.comfy_types.node_typing import IO, InputTypeOptions, ComfyNodeABC from comfy.comfy_types.node_typing import IO, InputTypeOptions, ComfyNodeABC
from comfy_api.input_impl import VideoFromFile from comfy_api.input_impl import VideoFromFile
@ -128,16 +128,6 @@ def _get_camera_control_inputs() -> dict[str, tuple[IO, InputTypeOptions]]:
} }
def download_url_to_video_output(video_url: str) -> tuple[VideoFromFile]:
"""Downloads a video from a URL and returns a VIDEO output."""
video_io = download_url_to_bytesio(video_url)
if video_io is None:
error_msg = f"Failed to download video from {video_url}"
logging.error(error_msg)
raise KlingApiError(error_msg)
return (VideoFromFile(video_io),)
class KlingNodeABC(ComfyNodeABC): class KlingNodeABC(ComfyNodeABC):
"""Base class for Kling nodes.""" """Base class for Kling nodes."""