Nodes/ComfyUI Channel Ops/Channel Ops (live-preview)
ComfyUI Node

Channel Ops (live-preview)

Do surgery on a single color channel — invert just the red, clamp the saturation, or overwrite hue from another image

By L33chKing·Created 10 months ago·Updated 2 months ago· 5
Channel Ops (live-preview)
  • image
  • image_b
  • mask
  • image
  • preview_ref
operationInvert
SourceRGB
DestinationRed
amount0
preview_idA

Most ComfyUI image nodes treat an image as one blob. Channel Ops treats it as a set of levers: pick a channel, pick an operation, pull. Want to invert only the red channel of a render? Desaturate just the Saturation channel instead of the whole image? Clamp the Value channel so nothing clips to pure white? This is the node.

It's part of the ComfyUI Channel Ops pack, and it's the pack's namesake for a reason - it's the most flexible of the four, because the Source menu reaches into three different color spaces and the operations cover everything from Invert to Overwrite from Image.

How it works

Everything is pure tensor math - no ML, no model files, runs fine on CPU. Pick a Source and the node converts the image into the color space that contains it: RGB channels are used directly, Hue/Saturation/Value trigger an RGB↔HSV conversion, and Oklab gets its own (perceptually uniform) conversion. Then the operation is applied to just the channels you selected, and the result converts back to RGB.

The list of operations is the familiar image-processing toolbox: Invert, Set, Add, Subtract, Multiply, Divide, Clamp Min/Max, Truncate, Contrast - plus two flavors of Overwrite. Overwrite writes the source value into the destination channel. Overwrite from Image does the same thing but takes the value from a second image (image_b), which is where this node stops being a toy. Overwrite hue from one image onto another and you can transfer a lighting/color bleed onto a subject without touching its luminance.

Two details that matter from the source:

  • Destination only matters for Overwrite / Overwrite from Image. For every other operation it's ignored - the README says so explicitly. Beginners burn time flipping Destination and seeing nothing change; that's expected.
  • amount is a 0–255 scale, and 0 is not neutral for every operation. For Add and Subtract, 0 genuinely means "do nothing." But Set at 0 turns the channel black, Multiply at 0 multiplies by zero (black), and Contrast/Truncate use an inverted mapping where 0 means maximum change. The live preview makes this painless to discover, but it's worth knowing before you scratch your head.

The inputs that matter

  • operation - what you do to the channel (the 12-option menu above).
  • Source - which channel(s) the operation hits: individual RGB, channel pairs, Hue/Saturation/Value, or whole spaces (RGB / HSV / Oklab).
  • Destination - only for the two Overwrite ops: where the value lands.
  • mask (optional) - restrict the whole effect to a region. The mask is auto-resized to your image and broadcast over the batch, so you can drop in any ComfyUI MASK without hand-tuning sizes.
  • image_b (optional) - the second image for Overwrite from Image.

It outputs two things: image (the result, wire it into your Save Image or back into the graph) and preview_ref - a downscaled copy of the input the frontend uses for its live preview. You can mostly ignore preview_ref unless you want a cheap low-res version of the source for something downstream.

Installing

It ships with the ComfyUI Channel Ops pack. Two routes:

  • ComfyUI Manager → Install Custom Nodes → search "ComfyUI Channel Ops" → install → restart.
  • Or manually: cd ComfyUI/custom_nodes && git clone https://github.com/L33chKing/ComfyUI_Channel_Ops, then restart.

No extra Python dependencies (it's torch/NumPy/PIL, all already in ComfyUI) and no model downloads - this pack won't fight the rest of your install.

Gotchas

  • Set amount before you judge an operation. Because the default is 0 and 0 isn't neutral for Set/Multiply/Contrast/Truncate, your first run may look catastrophically wrong when the node is actually working exactly as told.
  • Multiply and Divide use amount as a raw factor - 2 is 2x, 255 is 255x. Don't treat it as a percentage.
  • The live preview means you can scrub operations without re-queueing the graph - that's the whole reason the "(live-preview)" is in the node name. If the preview canvas doesn't appear, run the graph once (the preview is built the first time the node executes), then adjust widgets freely.
  • There's no opacity control here. If you want a soft version of a channel op, blend the output with the original using the pack's Layer Blending node - the two were designed to pair.
Categoryimage/processing

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
operationCOMBOInvert12 options: Invert, Overwrite, Overwrite from Image, Set, Add, Subtract, +6
SourceCOMBORGB12 options: Red, Green, Blue, Red+Green, Red+Blue, Green+Blue, +6
DestinationCOMBORed12 options: Red, Green, Blue, Red+Green, Red+Blue, Green+Blue, +6
image_boptIMAGE
amountoptINT00–255
maskoptMASK
preview_idoptSTRINGA

Outputs (2)

NameTypeDescription
imageIMAGE
preview_refIMAGE