Nodes/yanhuo-easy-use/音频批次预览/保存
ComfyUI Node

音频批次预览/保存

Listen to ten clips without stacking ten save nodes

By yanhuoxunxianren·Created 27 days ago·Updated 21 days ago· 2
音频批次预览/保存
  • audios
  • audios
◄输出模式预览►
◄保存格式flac►
◄音质192k►
◄文件名前缀audio/yanhuo►

The standard ComfyUI workflow for "I made several audio clips" is a chain of save nodes, one per file, or a folder of numbered WAVs you have to open in a media player to remember which take was which. This node is the receiver end for the pack's audio batches: you hand it a list of clips, it plays them back on the node itself, and it writes them all out when you ask - one entry per clip in its own results row.

What people actually use it for

Batch audio output is a real hole in the ecosystem. Long before a pack shipped a node for it, people were asking for one - the workaround was wildcard tricks through a data-handling node to push several mp3s at once. That works; it just feels like smuggling. If your graph produces N clips - a stack of TTS takes, per-shot ambience from 加载批量音频, a set of segments you pulled out with 筛选音频 - this is the node that ends the pipeline.

The mechanism

Five settings, and the interesting behaviour is in the last three.

输出模式 is 预览 / 保存 / 预览并保存. Preview writes to ComfyUI's temp directory (scratch, not meant to keep) so the node can render players for it; save writes to output where files persist. That split is the standard convention - same as PreviewImage versus SaveImage - and it's why "预览并保存" produces two files per clip, one in each directory.

保存格式 is flac, mp3 or opus, and encoding goes through PyAV, the same library ComfyUI's own SaveAudio uses. That matters because each format has opinions:

  • flac is lossless and ignores 音质 entirely.
  • mp3 can't do 64k/96k/192k here - pick one of those and it silently falls back to 128k. V0 maps to the LAME quality scale.
  • opus only accepts certain sample rates (it resamples up to the nearest legal rate, capped at 48kHz), so a 44.1kHz clip goes out at 48kHz.

文件名前缀 defaults to audio/yanhuo and goes through ComfyUI's save-path logic, which means the slash is a subfolder, and a counter is appended automatically. You get output/audio/yanhuo_00001.flac, 00002, and so on.

The output is audios, the same batch handed back untouched, so you can keep chaining after the save. This is an output node - it always executes when its branch is in the graph, which is also why ComfyUI's cache doesn't need to be talked into running it.

Where you see the results is worth knowing before you run: after execution the node grows a results panel with one row per clip - index, saved/preview flag, filename, player - and that panel is stored in the workflow. Reload the page or reopen the file and last run's clips are still listed and still playable, no re-queue needed. There's a 清空 button to wipe it.

Install

Part of yanhuo-easy-use (category yanhuo, all Chinese labels, MIT). Manager: search the pack title and install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/yanhuoxunxianren/yanhuo-easy-use
# restart ComfyUI

Nothing to pip install - the pack declares no dependencies, and av, torch and Pillow come with ComfyUI itself. No model downloads either; this pack is pure plumbing.

Common issues

"未安装 av(pyav)" - you're on an odd install that lacks PyAV. Audio bugs in this ecosystem usually start here; the pack's console message names the library rather than failing cryptically.

"I asked for 320k mp3 and the file sounds… fine?" Check the actual setting. Only V0/128k/320k survive for mp3; anything else becomes 128k. The node does not warn you, so if you're chasing quality, set one of the supported values.

"Nothing was written." If every segment in the batch was empty or zero-length, the loop skips them and you get a console note instead of an error. An empty batch also means no rows in the panel. That's usually an upstream loader that failed silently - check the loader's own console output.

"Two copies of each file, one in output and one in temp" - you're in 预览并保存. Temp is scratch and will be cleared; the panel de-duplicates by filename and shows the saved copy first.

"The saved files keep overwriting each other." They shouldn't - the counter increments per save - but if 文件名前缀 contains a %batch_num%-style token or you've changed the prefix to a bare folder, look at what actually landed on disk before assuming a collision.

The broader reason this node exists at all is that audio never got designed into ComfyUI; it arrived as an add-on layer, one node pack at a time. docs/knowledge/audio-generation.md maps that territory, and docs/knowledge/image-io-metadata.md explains the output/temp/input split this node leans on.

Categoryyanhuo

Inputs (5)

NameTypeDefaultDescription
audiosAUDIO音频批次(列表),可包含多段不同的音频。
输出模式COMBO预览3 options: 预览, 保存, 预览并保存
保存格式COMBOflac3 options: flac, mp3, opus
音质COMBO192k6 options: V0, 64k, 96k, 128k, 192k, 320k
文件名前缀STRINGaudio/yanhuo—

Outputs (1)

NameTypeDescription
audiosAUDIO—