Harden some nodes against potential issues related to combos. (#15277)

This commit is contained in:
comfyanonymous
2026-08-03 20:55:13 -07:00
committed by GitHub
parent 16e3f3034f
commit 9a9fdb10ed
5 changed files with 39 additions and 11 deletions

View File

@@ -260,6 +260,7 @@ class ImageSaveHelper:
class AudioSaveHelper:
"""A helper class with static methods to handle audio saving and metadata."""
_OPUS_RATES = [8000, 12000, 16000, 24000, 48000]
_FORMATS = {"flac", "mp3", "opus"}
@staticmethod
def save_audio(
@@ -270,6 +271,9 @@ class AudioSaveHelper:
format: str = "flac",
quality: str = "128k",
) -> list[SavedResult]:
if format not in AudioSaveHelper._FORMATS:
raise ValueError(f"Unsupported audio format: {format!r}")
full_output_folder, filename, counter, subfolder, _ = folder_paths.get_save_image_path(
filename_prefix, _get_directory_by_folder_type(folder_type)
)