Nodes/ꘇ Genereti/ꘇ chop.logic
ComfyUI Node

ꘇ chop.logic

Turn any signal into a hard yes or no

By languel·Created about a month ago·Updated 3 days ago· 1
ꘇ chop.logic
  • input
  • channels
  • value
◄threshold0.50►

ꘇ chop.logic is a comparator. You hand it a signal and a number, and it hands back 1 when the signal is at or above that number and 0 when it isn't. That's the whole node. Its usefulness is entirely about what sits on either side of it: a wobbling oscillator upstream, a switch or a gate downstream.

What it is

ComfyUI's plumbing layer, as the KB's node-plumbing doc puts it, exists to fight repetition and illegibility - a Primitive node so five sampler seeds share one source, an A/B switch so you don't rewire by hand. Genereti's CHOP family is the same impulse with a time axis: instead of a constant you wire into a socket, the CHOP carries named sampled channels that keep moving while the browser is open. ꘇ chop.logic is the point where that motion gets quantized into a decision.

If you've used TouchDesigner, this is a Logic CHOP with the operator set trimmed to one comparison. If you haven't: think of it as the node that answers "is my level above the line right now?" so a downstream node doesn't have to. Nobody is writing about this pack on Reddit yet - searching the corpus for "genereti" returns literally zero threads - so you're reading the source and the author's docs, and the docs are unusually good for an alpha.

How it works

Under the hood it subclasses the same processor as ꘇ chop.math, and its branch is one line: compare each sample against threshold, and emit 1.0 or 0.0. Channel names pass through untouched, and the block's sample rate and start time are preserved. It is per-sample and stateless - no hysteresis, no rising-edge detection, no memory between blocks.

That last part is the trap worth knowing before you build on it. Feed it a noisy signal that hovers right at the threshold and it will chatter 0,1,0,1 every sample. Your options are to smooth the input first (ꘇ chop.lag, or the smooth control on ꘇ chop.lfo) or to move the threshold well clear of the noise. There's also no AND/OR: the comparison runs independently per channel, so two conditions feeding one node are two separate gates, not one combined test.

The inputs and outputs that matter

  • input - the GENERETI_CHOP you're testing. Wire in an oscillator, an LFO, a MIDI CC channel, or a band from a spectrum node.
  • threshold - default 0.5, range ±100000, step 0.01. Since MIDI values are normalized 0..1 and oscillator outputs are usually bipolar (−1..1), a threshold of 0.5 means "positive half only" for a sine. If you want the crossing test people usually mean, set it to 0.
  • channels out - the same named channels you fed in, now 0/1. The pack's own demo pattern uses ꘇ chop.select to narrow this to one channel (rms, say) before handing it onwards.
  • value out - a plain FLOAT: the last sample of the first channel. This is the socket you actually wire into a converted numeric input, because ordinary Comfy widgets take a FLOAT, not a channel block.

One composition trick that falls out of the mechanism: ꘇ chop.logic → ꘇ chop.slope gives you a spike of exactly +sample_rate on each rising edge (slope is a per-sample difference times the rate). It's a usable trigger if you need one, but you'll immediately be re-thresholding it, so it's rarely worth the extra node.

Install

All twenty-odd operator families here ship in one pack, so install it once. In ComfyUI Manager search genereti (pack title "ꘇ Genereti"), install, restart ComfyUI, then hard-refresh the browser tab - the nodes register a browser extension too, and a plain reload often isn't enough. Manual install:

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

Use the Python that belongs to your ComfyUI (.venv, or python_embeded/python.exe on Windows Portable). The requirement list is one line - comfyui-frontend-package>=1.53.6 - so there's no torch reinstall, no model download, and no separate model server. Examples live under Workflows → Genereti; ꘇ-OpenTouch-Operators-and-Lessons is the one that walks through CHOPs, and ꘇ-Sound-Analysis wires an audio level into a numeric control.

Common issues

Queueing does nothing useful. These nodes are live in the browser. Queue evaluates an explicit block of samples from the node's time/sample_rate values and never runs device I/O. Everything downstream of a CHOP is a snapshot, not a stream.

It's fast until it isn't. Channel computation keeps running even when the preview is collapsed or frozen - that's a preview setting, not a computation switch. But live delivery is capped by browser animation frames, roughly 60 blocks a second. Don't expect 240 updates a second to arrive.

Cycles throw. If you loop logic output back into its own upstream chain, the live graph raises "CHOP cycles are not supported" and prints it in the node's status line.

It's an alpha. The README says it plainly: super alpha, early classroom testing, back up your workflows before updating, expect changing interfaces. Node internal IDs and browser paths are stable, but the widgets you see may not be.

CategoryGenereti / CHOP

Inputs (2)

NameTypeDefaultDescription
inputGENERETI_CHOP—
thresholdFLOAT0.50-100000–100000—

Outputs (2)

NameTypeDescription
channelsGENERETI_CHOP—
valueFLOAT—