Nodes/ꘇ Genereti/ꘇ mod.gain
ComfyUI Node

ꘇ mod.gain

A fader, a pan knob and a mute — and why you want one anyway

By languel·Created about a month ago·Updated 3 days ago· 1
ꘇ mod.gain
  • input
  • audio
◄level0.80►
◄pan0.00►
◄mutefalse►

ꘇ mod.gain does three things: level, stereo pan, mute. It is the least interesting node in the Genereti audio family and you will end up using it in almost every patch, because it's the one place to balance a synth against a drum kit before the mixer.

What it is

The mod.* nodes are a live Web Audio patching layer for ComfyUI that runs in your browser tab. GENERETI_AUDIO_BUS cables carry routes between native Web Audio nodes; nothing flows through Comfy's Python queue. A gain node sits in the audio path, exactly as it would in any DAW or in TouchDesigner's CHOP/audio land - the naming convention across this pack is borrowed from TouchDesigner, which is a useful mental model if you've used it.

Why not just use mod.output's level? Because output level is global, and you usually want one source ducked relative to another. Also because pan and mute are per-node conveniences: mute is the fastest A/B you'll ever do, and pan is how you stop two synth patches from fighting in the middle.

How it works

Under the hood the browser builds a GainNode and a StereoPannerNode for each instance of this node, reused across edits rather than recreated per frame. Parameter changes are applied with short setTargetAtTime ramps, not hard jumps - so dragging the level slider while audio is running ramps rather than clicks. That's a small thing that makes live tweaking pleasant instead of painful.

Modules are only built for nodes that are actually reachable from an output. Disconnect a gain node and it gets disposed rather than left running somewhere in the graph.

The inputs and outputs that matter

  • input - the GENERETI_AUDIO_BUS you're inserting into.
  • level - 0 to 2, default 0.8. Yes, above 1: this is a gain stage, so it can boost as well as attenuate, and pushing it past 1 into the compressor at mod.output is how you get a rougher sound.
  • pan - −1 (full left) to 1 (full right), default 0.
  • mute - boolean, default off. Zeroes the channel without unpatching anything.

One output: audio, the same bus type. Chain it wherever the signal needs to go next - mod.filter, mod.delay, mod.mixer, mod.output. If what you actually want is four channels with solo buttons and a master fader, go straight to mod.mixer instead; it has a gain-and-pan stage per input and this node would be redundant.

Install

Manager, search Genereti - or, from your ComfyUI directory:

git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt

Then restart ComfyUI and refresh the browser page; the node schemas come from the frontend, so a stale tab is a missing node. requirements.txt is a single line (comfyui-frontend-package>=1.53.6) - torch, NumPy, Pillow and aiohttp are already in ComfyUI, and the audio family needs no model downloads and no model server. Comfy ≥ 0.38.2, Python ≥ 3.11.

Common issues

No sound. Nine times out of ten it's the output, not the gain: nothing plays until you press ▷ on a mod.output. Queueing this node returns a route description, never audio, so a queue-and-wait workflow produces silence by definition.

Mute looks broken because the sound continues. Check upstream - if a mod.delay is downstream of the muted gain, you'll hear its tail, and if the delay is upstream it'll keep feeding. Also remember that a module with no path to an output is disposed, so a muted-but-connected chain is fine while an unconnected one is simply gone.

No ticking when you move sliders. That's deliberate; changes ramp over ~15 ms.

Pan does nothing on headphones. It should - pan is a stereo panner, not a mono pan law trick. If it seems dead, you may be feeding a mono source into an analysis tap (which upmixes to stereo for measurement) rather than into the actual audio path.

Cable cycles are rejected. If you're trying to build feedback by looping a gain back on itself, the graph throws "Audio cable cycles are unsupported; use audio.delay for feedback". Use mod.delay, which caps its own feedback at 0.85 by design.

Last thing, and it applies to every node in this pack: Genereti is a solo MIT project by Liuboto, currently v0.1.4, and its own README calls it "super alpha - early classroom testing. Back up your workflows before updating." Treat the parameter ranges as stable-ish and the UI as not.

CategoryGenereti / Modular audio

Inputs (4)

NameTypeDefaultDescription
inputGENERETI_AUDIO_BUS—
levelFLOAT0.800–2—
panFLOAT0.00-1–1—
muteBOOLEANfalse—

Outputs (1)

NameTypeDescription
audioGENERETI_AUDIO_BUS—