mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-31 16:50:17 +08:00
fix: add error handling for invalid speed preset values
Wrap VideoSpeedPreset conversion in try/except to gracefully handle invalid speed_str values instead of raising unhandled ValueError. Logs warning and falls back to None (default) on failure.
This commit is contained in:
parent
86317e32b8
commit
dcbe072e8a
@ -193,7 +193,12 @@ class SaveVideo(io.ComfyNode):
|
|||||||
resolved_format = Types.VideoContainer.AUTO
|
resolved_format = Types.VideoContainer.AUTO
|
||||||
resolved_codec = Types.VideoCodec.AUTO
|
resolved_codec = Types.VideoCodec.AUTO
|
||||||
|
|
||||||
speed = Types.VideoSpeedPreset(speed_str) if speed_str else None
|
speed = None
|
||||||
|
if speed_str:
|
||||||
|
try:
|
||||||
|
speed = Types.VideoSpeedPreset(speed_str)
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
logging.warning(f"Invalid speed preset '{speed_str}', using default")
|
||||||
|
|
||||||
width, height = video.get_dimensions()
|
width, height = video.get_dimensions()
|
||||||
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(
|
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user