From ab01aceaa2f49620421dc1a16b585b25c60d7469 Mon Sep 17 00:00:00 2001 From: Yousef Rafat <81116377+yousef-rafat@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:46:05 +0300 Subject: [PATCH] removed additional code in video_types --- comfy_api/latest/_input_impl/video_types.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/comfy_api/latest/_input_impl/video_types.py b/comfy_api/latest/_input_impl/video_types.py index 9c33f7067..f646504c8 100644 --- a/comfy_api/latest/_input_impl/video_types.py +++ b/comfy_api/latest/_input_impl/video_types.py @@ -107,8 +107,7 @@ class VideoFromFile(VideoInput): (s for s in container.streams if s.type == "video"), None ) if video_stream and video_stream.frames and video_stream.average_rate: - length = float(video_stream.frames / video_stream.average_rate) - return length + return float(video_stream.frames / video_stream.average_rate) # Last resort: decode frames to count them if video_stream and video_stream.average_rate: @@ -118,8 +117,7 @@ class VideoFromFile(VideoInput): for _ in packet.decode(): frame_count += 1 if frame_count > 0: - length = float(frame_count / video_stream.average_rate) - return length + return float(frame_count / video_stream.average_rate) raise ValueError(f"Could not determine duration for file '{self.__file}'")