From bb7c582b5806212892d5c3b547527b9bb32a2318 Mon Sep 17 00:00:00 2001 From: bymyself Date: Tue, 20 Jan 2026 12:55:17 -0800 Subject: [PATCH] fix: add fail-fast validation for unsupported codecs Replace silent fallback to libx264 with explicit validation that raises ValueError for unknown codec types. Prevents silent codec substitution. --- comfy_api/latest/_input_impl/video_types.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/comfy_api/latest/_input_impl/video_types.py b/comfy_api/latest/_input_impl/video_types.py index ffd105c18..72f149978 100644 --- a/comfy_api/latest/_input_impl/video_types.py +++ b/comfy_api/latest/_input_impl/video_types.py @@ -389,7 +389,9 @@ class VideoFromComponents(VideoInput): VideoCodec.H264: "libx264", VideoCodec.VP9: "libvpx-vp9", } - ffmpeg_codec = codec_map.get(resolved_codec, "libx264") + if resolved_codec not in codec_map: + raise ValueError(f"Unsupported codec: {resolved_codec}") + ffmpeg_codec = codec_map[resolved_codec] extra_kwargs = {} if resolved_format != VideoContainer.AUTO: