From 1ea2867a86caf800d9a2b7eb320449a32f41143d Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 4 May 2025 13:18:18 -0700 Subject: [PATCH] handle `to_format=None` --- comfy_api/input_impl/video_types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy_api/input_impl/video_types.py b/comfy_api/input_impl/video_types.py index 7bc8990c8..d0b0b36d2 100644 --- a/comfy_api/input_impl/video_types.py +++ b/comfy_api/input_impl/video_types.py @@ -31,7 +31,7 @@ def container_to_output_format(container_format: str | None) -> str | None: def get_open_write_kwargs( - dest: str | io.BytesIO, container_format: str, to_format: str + dest: str | io.BytesIO, container_format: str, to_format: str | None ) -> dict: """Get kwargs for writing a `VideoFromFile` to a file/stream with `av.open`""" open_kwargs = { @@ -45,7 +45,7 @@ def get_open_write_kwargs( # Set output format explicitly, since it cannot be inferred from file extension if to_format == VideoContainer.AUTO: to_format = container_format.lower() - else: + elif isinstance(to_format, str): to_format = to_format.lower() open_kwargs["format"] = container_to_output_format(to_format)