Nodes/Comfyui-LG_GroupExecutor/🎈LG_SaveAudioGetPath
ComfyUI Node

🎈LG_SaveAudioGetPath

Save an audio tensor to disk and get the path — or an empty string

By LAOGOU-666·Created about a year ago·Updated 7 months ago· 227
🎈LG_SaveAudioGetPath
  • audio
  • file_path
filename_prefixaudio/ComfyUI
formatflac
quality128k

An AUDIO tensor floating around in your graph is just data until someone writes it down. LG_SaveAudioGetPath does the writing: it takes an AUDIO input, saves it as FLAC, MP3, or Opus to your output folder, and returns the file path as a string. The fun part is the edge case it's honest about - when the audio is invalid, it returns an empty string instead of crashing. That makes it easy to wire into a conditional pipeline: if the string's empty, there was nothing to save.

It's the audio counterpart to LG_CreateAndSaveVideo in Comfyui-LG_GroupExecutor, LAOGOU-666's small utility pack. No extra dependencies, no models - just a save node with format options.

How it works

You pick a format (flac / mp3 / opus) and an output location via filename_prefix (default audio/ComfyUI), and the node writes the file using ComfyUI's get_save_image_path naming scheme under the output folder. The quality selector only applies to lossy formats: it's an MP3/Opus bitrate like 128k (with a V0 option for VBR), and FLAC ignores it entirely - the tooltip says so, and the code agrees. Audio that can't be handled comes back as an empty-string path, which is the documented contract.

Inputs & outputs

  • filename_prefix (STRING, default audio/ComfyUI) - where it lands.
  • format - flac (default), mp3, or opus.
  • audio (optional AUDIO) - what you're saving. Optional because the node still runs on the other inputs.
  • quality - bitrate: 64k / 96k / 128k / 192k / 320k / V0. Ignored for FLAC.

Output: file_path (STRING) - absolute path of the saved file, or "" when audio was invalid.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-LG_GroupExecutor

or ComfyUI Manager → "Comfyui-LG_GroupExecutor", then restart.

Notes from use

  • Lossless vs size tradeoff is yours to make. FLAC for anything you'll re-edit; 128k MP3 or Opus for shipping.
  • Feed the output path into LG_ConcatVideoFiles's audio_path to attach the audio to a merged video - the two nodes are clearly designed to work together.
  • The empty-string-on-invalid behavior is genuinely useful, but it means you should check the output before assuming a file exists - a silent "" downstream can confuse a node that expects a real path.
Category🎈LAOGOU/Group

Inputs (4)

NameTypeDefaultDescription
filename_prefixSTRINGaudio/ComfyUI
formatCOMBOflac3 options: flac, mp3, opus
audiooptAUDIO
qualityoptCOMBO128kMP3/OPUS 比特率,FLAC 忽略此参数

Outputs (1)

NameTypeDescription
file_pathSTRING