Nodes/fxai-toolkit/凤希AI - 音频选择器
ComfyUI Node

凤希AI - 音频选择器

Click, Don't Type a Path

By fxai666·Created 6 months ago·Updated about 15 hours ago· 44
凤希AI - 音频选择器
    • 音频
    ◄音频文件►

    If you have ever pasted C:\Users\you\Desktop\vocals_v3_FINAL.mp3 into a ComfyUI text widget and watched the queue fail, this node is the fix. 凤希AI - 音频选择器 (FxAiAudioSelector) is one widget and one wire: it points at an audio file and hands you a normal ComfyUI AUDIO. That's the whole job. It exists because the rest of the pack's audio chain - 人声分离, the audio segmenters, the MiniMax dubbing steps - all need a single place where a track enters the graph.

    A word on the pack, since it colours everything: fxai-toolkit is 凤希AI's low-VRAM long-video toolkit, a hundred-plus nodes with Chinese-first docs, a QQ group, and a Bilibili channel. Audio is the supporting cast. This selector is the unglamorous node you'll still touch every session.

    How it actually works

    The visible input is 音频文件, a plain string. You normally never type in it. A bundled JS extension adds a 📁 选择音频 button to the node; clicking it opens a modal with category tabs (配音, BGM, 音乐生成, 音效, 环境音…), a list of your files pulled from the pack's own GET /fxai/audio/list route, drag-and-drop upload via /fxai/audio/upload, and in-line preview players. Picking one writes a relative path like 配音/003_myvoice.wav back into the widget.

    Then the Python half resolves it. Paths starting with / are treated as relative to your ComfyUI root; everything else is tried against ComfyUI/input first, then against the pack's library at ComfyUI/fxai/audio/<category>/. That second location is where uploads land - the pack keeps its own media folders under the ComfyUI root, not in input/. Worth knowing before you go hunting for a file you "definitely uploaded".

    From there the load is boring and correct: soundfile reads the file, casts to float32, forces stereo (mono gets duplicated, anything beyond two channels is trimmed), and returns {"waveform": tensor, "sample_rate": sr} - the standard ComfyUI audio dict. Note it does not resample here; whatever sample rate your file has is what downstream sees. The separation node handles the 44.1 kHz conversion itself.

    There's one detail that surprises people: IS_CHANGED returns NaN, so this node re-executes on every queue even if you changed nothing. Combined with VALIDATE_INPUTS, which resolves the path before you queue, a bad path shows up as a red border immediately rather than as a mid-run failure. That's good behaviour, just be aware the file gets touched each run.

    The inputs and outputs that matter

    There is exactly one input, 音频文件, and one output, 音频 (AUDIO). Because it's a stock AUDIO dict, it plugs into anything that accepts audio - RVC, TTS loaders, lip-sync nodes, the pack's own 人声分离 - not just fxai nodes. In practice you wire it into FxAiMelRoformerSampler when you want vocals and backing track split, or straight into a video-save node when you just need a soundtrack attached.

    Install

    ComfyUI Manager first - the pack carries Comfy Registry metadata ([tool.comfy], publisher fxai), so searching fxai or 凤希全能节点 should surface it. If not, from a terminal:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxai666/fxai-toolkit
    

    Restart ComfyUI. On startup the pack's __init__.py pip-installs soundfile and psutil for you, and registers nodes one module at a time.

    You also want ffmpeg on your PATH. Not optional in this pack: every upload conversion, duration probe and mp3 decode shells out to it.

    Where people get burned

    • It converts and then deletes your original. If you hand-type a path to an .mp3, .flac or .m4a rather than picking an already-.wav file, the resolver shells out to ffmpeg to write a float32 .wav next to it and then removes the source file. Work off a copy if the original matters.
    • Only .wav shows in the picker. Uploaded files are converted to NNN_name.wav at upload time, so this is usually invisible - but an mp3 you drop into ComfyUI/fxai/audio/配音/ by hand will not appear in the list. Upload it through the modal instead.
    • Node missing from the menu. Node imports are individually wrapped in try/except, so a broken dependency prints ❌[凤希AI] 节点加载失败: 凤希AI - 音频选择器 → ... to the console and simply registers nothing. If soundfile didn't install, that's your line.
    • Button doesn't exist. You copied the .py files somewhere by hand and left the js/ folder behind. The picker lives entirely in the frontend.

    One last curiosity: every file in this repo is MIT per pyproject.toml, while the source headers say 商用需购买商业授权 - commercial use needs a paid licence. The author tags it MIT everywhere that counts; just don't be surprised by the header text.

    Category凤希AI/音频

    Inputs (1)

    NameTypeDefaultDescription
    音频文件STRING—

    Outputs (1)

    NameTypeDescription
    音频AUDIO—