Nodes/Music Production Toolkit/Optional audio stage · Audio + reports
ComfyUI Node

Optional audio stage · Audio + reports

Turn Mastering Off and the Mastering Nodes Never Execute

By jplenio·Created about a month ago·Updated 16 days ago· 72
Optional audio stage · Audio + reports
  • original_audio
  • processed_audio
  • audio
  • report_1
  • report_2
  • report_3
  • report_4
  • report_5
  • report_6
  • report_7
  • report_8
◄enabled—►
◄stage▾►
◄report_1►
◄report_2►
◄report_3►
◄report_4►
◄report_5►
◄report_6►
◄report_7►
◄report_8►

In most workflows, "switch a stage off" means bypass a node and hope the rest of the chain tolerates a missing wire. MusicOptionalStage does something stricter and more useful: when the stage is disabled, the upstream branch is never executed, and downstream report consumers still receive valid data instead of a stale string or a crash.

Two instances of it sit in the production workflow, one for Refinement and one for Mastering. That's the whole idea - the big optional lumps of DSP get a yes/no gate in front of them.

Inputs and outputs

Required:

  • enabled - a boolean input, wired from the production choices node's refinement or mastering output
  • stage - a dropdown, Refinement or Mastering. It labels the bypass record; it doesn't change the routing.
  • original_audio - the audio as it arrives, before the stage
  • processed_audio - the audio as it leaves the stage

Optional: report_1 through report_8, the stage's own report strings.

Outputs: audio plus report_1 through report_8. So it's a two-in-one gate - the audio and the paperwork go through the same valve. That second half is the part that's easy to overlook and the reason it exists. The toolkit's production JSON wants a section for every stage, including the ones you skipped. Without the gate, the record side would still demand that the stage run to produce its report, which would defeat the whole point of skipping it.

The mechanism

The audio sockets and all eight report slots are lazy, and the node implements a lazy-status check: with enabled false, only original_audio is requested. Nothing upstream of it gets pulled, so the declipper, the low-pass filters, FlashSR, the crossover, the HF repair - or the whole auto-EQ / eight-band EQ / compressor / limiter stack - simply don't run. Their models don't load. Their downloads don't happen. No GPU time, no VRAM.

Pass-through is honest about itself. Disabled, the audio socket returns the original untouched, and all eight report slots return a small JSON string like {"stage": "refinement", "enabled": false, "status": "bypassed"} rather than an empty string. For Refinement, two of those slots are special - they normally carry preset names, so a bypassed refinement writes the word Bypassed there instead, which keeps the production record human-readable.

Enabled, the node passes processed_audio and all eight reports through unchanged. It behaves like a wire, and the reports are the real stage's.

What the switches actually do

From the toolkit's own mapping: Mastering off means incoming audio survives at its existing sample rate - the Auto-EQ, the manual EQ, the loudness targeting, the limiter and the sample-rate conversion all go away together. Refinement off removes the restoration chain. Disable both and generation goes straight to the release savers. Both defaults on, and on the YuE2 path refinement defaults off because the default route skips restoration entirely and goes direct to mastering.

Install and the one trap

cd ComfyUI/custom_nodes
git clone https://github.com/jplenio/ComfyUI-MiniMax-Music-Production-Toolkit.git
cd ComfyUI-MiniMax-Music-Production-Toolkit
python -m pip install -r requirements.txt   # same Python as ComfyUI

Restart and hard-refresh, then reopen the bundled workflow - the gates and their report wiring are part of the graph, and a saved personal workflow from an older version won't have them.

The trap is the classic one from ComfyUI's plumbing layer: laziness only holds if nothing inside the stage is an output node. Connect a plain PreviewAudio or a saver inside the refinement branch and the branch executes whether or not the gate is open - you've re-anchored the graph around the gate you built. Keep previews and savers downstream of the gate, and the switch means what it says.

CategoryMusic Production Toolkit/config

Inputs (12)

NameTypeDefaultDescription
enabledBOOLEANConnect the central refinement or mastering Boolean. Off skips both audio processing and report dependencies.
stageCOMBOLabels bypass records. Refinement slots 2 and 4 carry preset names; other report slots carry JSON.
original_audioAUDIOAudio before this stage. Requested only when the stage is disabled.
processed_audioAUDIOAudio after this stage. Lazy: requested only while the gate is enabled.
report_1optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_2optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_3optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_4optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_5optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_6optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_7optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.
report_8optSTRINGReport of an optional stage, passed through unchanged while the stage runs. Lazy: a disabled stage never wakes the node that would produce it.

Outputs (9)

NameTypeDescription
audioAUDIO—
report_1STRING—
report_2STRING—
report_3STRING—
report_4STRING—
report_5STRING—
report_6STRING—
report_7STRING—
report_8STRING—