Nodes/AegisFlow Utility Nodes/Swap Color Mode-Vextra
ComfyUI Node

Swap Color Mode-Vextra

See your image in Lab, HSV, CMYK, or 1-bit

By aegis72·Created 3 years ago·Updated 2 years ago· 39
Swap Color Mode-Vextra
  • images
  • IMAGE
color_mode

Every once in a while you need to see an image in a different color space. Is the value channel clean? What does a 1-bit posterization look like at full resolution? Swap Color Mode-Vextra is the node that converts an image - or a whole batch - between PIL's color modes, and it's the color-science toy in the Vextra bundle.

Like its siblings, it was originally part of diontimmer's Vextra pack and now ships inside AegisFlow Utility Nodes in working, self-contained form. Full credit to the original developer is in the pack's own source.

The mechanism is a one-liner per image. There's a lookup table mapping each menu choice to a PIL mode - luminance → grayscale, single_channel → 1-bit bilevel, plus RGB, RGBA, lab, hsv, cmyk, and ycbcr - and each image in the batch gets Image.convert(mode). Choosing default skips the conversion entirely, which makes the node a harmless passthrough you can keep in the graph and flip on later.

Inputs: images (required) and color_mode, a nine-choice dropdown - default, luminance, single_channel, RGB, RGBA, lab, hsv, cmyk, ycbcr.

What it's actually good for: luminance gives you a grayscale for mask work or alpha extraction; hsv lets you eyeball the saturation/value split before a grade; lab shows the perceptual lightness channel, which is what a lot of upscaling and relighting reasoning runs on; single_channel is a fun 1-bit posterization for stylized output. It's a great inspection and diagnosis node.

Now the honest warning, because this one has teeth: unlike the other Vextra image nodes, this node does not force the output back to RGB. Convert to luminance or single_channel and the tensor comes back without a proper RGB channel layout - a (batch, height, width) shape instead of (batch, height, width, channels). Plenty of downstream ComfyUI nodes will throw a shape error or silently misbehave on that. Keep this node for inspection, or run an image-to-RGB / channel-reshape node right after it before feeding the result into anything that composites. It's a feature when you're probing color, a trap when you forget.

Install is the standard two-liner:

cd ComfyUI/custom_nodes
git clone https://github.com/aegis72/aegisflow_utility_nodes

Restart ComfyUI, or install via ComfyUI Manager by searching "AegisFlow Utility Nodes." No models to download and no extra dependencies - this node only uses PIL, which ComfyUI already has. And the usual note: if Manager flags a conflict with ComfyUI-Vextra-Nodes, that's the shared-class-name false alarm; ignore it unless you actually have the original pack installed, in which case drop one of them.

CategoryAegisFlow/fx

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
color_modeoptCOMBO9 options: default, luminance, single_channel, RGB, RGBA, lab, +3

Outputs (1)

NameTypeDescription
IMAGEIMAGE