Audio Gain + Pan
Level your audio and place it left or right — inside the graph
- audio
- audio
- output_path
- duration_sec
- summary
Volume and pan are the two things you adjust on basically every piece of audio, and up until recently there was no good reason to do either inside ComfyUI - then video workflows started carrying soundtracks and dialogue, and suddenly you want a voice quieter than the music without leaving the graph. MKRAudioGainPan is that: one node, a gain knob and a pan knob, plus a couple of stereo conveniences. It's the kind of boring utility that quietly does exactly what it says.
It lives in the Utility branch of the MKRShift_Nodes audio set, so it's the stage before FX rather than the FX itself. Typical use: pull dialogue down with gain_db, push a voice a touch off-center with pan, then feed the result into MKRAudioMix to combine it with a bed track.
How it works
Gain is straightforward dB scaling (0 dB = unchanged, −6 dB halves the level, +6 dB doubles it). Pan uses a constant-power law - the standard studio trick where the left and right channels get cos(angle) and sin(angle) gains so the perceived loudness stays constant as you move across the field - rather than a naive linear fade that makes the middle sound louder. pan runs −1 (hard left) to +1 (hard right), 0 dead center.
Two stereo conveniences make it more than a pair of knobs:
force_stereo- turns a mono input into a real two-channel signal (necessary before panning a mono voice, and for getting a mono track into a stereo mix).normalize_peak- rescales the result to just under full scale. If you've boosted by a lot and don't want to clip, flip this on.
Inputs that matter
audio-MKR_AUDIOpayload, waveform tensor, or file path.gain_db- −60 to +24 dB. The volume knob.pan- −1 to +1. The position knob.force_stereo/normalize_peak- the two toggles above.- Standard save block:
output_format,filename_prefix,subfolder,overwrite, optionalfilename_label.
Outputs: audio (MKR_AUDIO), output_path, duration_sec, summary.
Install
ComfyUI Manager (search "MKRShift Nodes"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
Restart. Pure numpy math - no ffmpeg required for the processing itself; it only matters for compressed output formats. No models.
Common issues
The trap is panning a mono source and hearing nothing move: with force_stereo off, a mono waveform just gets a shared gain and pan does effectively nothing. Turn force_stereo on first. Second, watch the cumulative math - if you've boosted +6 dB and your upstream was already hot, normalize_peak is off by default and you will clip; the summary output shows you the peak if you inspect it. And negative pan means left, positive means right - the old DAW convention where "pan left" was negative catches people constantly.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | * | — | |
| gain_db | FLOAT | 0.0-60–24 | — |
| pan | FLOAT | 0.00-1–1 | — |
| force_stereo | BOOLEAN | false | — |
| normalize_peak | BOOLEAN | false | — |
| output_format | COMBO | auto | 5 options: auto, wav, mp3, flac, ogg |
| filename_prefix | STRING | MKR_audio_gain_pan | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
| filename_labelopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio | MKR_AUDIO | — |
| output_path | STRING | — |
| duration_sec | FLOAT | — |
| summary | STRING | — |