Nodes/bsz-cui-extras/BSZ Hue Chroma XL
ComfyUI Node

BSZ Hue Chroma XL

Recolor an SDXL latent without ever leaving latent space

By Beinsezii·Created 3 years ago·Updated 2 years ago· 27
BSZ Hue Chroma XL
  • latent
  • LATENT
hue0.00
chroma0.00
lightness0.00

BSZ Hue Chroma XL is the node from this pack that actually gets found - it's the only one showing up in search impressions - and for good reason. It's the cheapest way to shift the color of an SDXL image you've already generated: you dial in hue, chroma, and lightness on the latent itself, and only then decode it. No pixel round-trip, no VAE encode/decode loss, no second sampling pass.

Why you'd reach for it

You've got a good render but the skin tones are too orange, the whole scene reads too magenta, or you want a quick teal-and-orange grade. The stock ComfyUI answer is "decode, run some color node, re-encode" - which costs you a lossy VAE round-trip plus a full re-sample if you want the edit to stick. This node edits the latent in place, before the VAE Decode, so the color shift survives to the final pixels with zero extra sampling.

The honest catch, straight from the author: it's tuned for the SDXL VAE, and it only "kind of works" on non-XL latents. If you're on SD 1.5 or Flux, treat the sliders as a rough guess, not a precise tool.

How it works

The SDXL latent is four channels that don't map cleanly to anything a human recognizes, but channels 1 and 2 sit close enough to the a* and b* axes of CIE L*a*b* that you can treat them that way. The node normalizes all four channels, computes chroma as the length of the a*/b* vector and hue as its angle, applies your offsets, then converts back. The constants are approximations - the code literally comments "approx values due to lack of forward plot" - which is why it's fine for SDXL and mushy elsewhere.

The inputs you actually touch:

  • hue - offset in degrees, -180 to 180. This is the "make it less green" knob.
  • chroma - multiply the saturation, -100 to 100. Negative desaturates toward gray.
  • lightness - multiply lightness, -100 to 100.
  • latent - your sampled latent, straight from the KSampler.

Output is a single LATENT that feeds the VAE Decode. If all three values are 0 it returns the input untouched, so you can leave it in a workflow as a passthrough.

Install

The pack is Beinsezii's bsz-cui-extras:

cd ComfyUI/custom_nodes
git clone https://github.com/Beinsezii/bsz-cui-extras

then restart ComfyUI, or just search "bsz-cui-extras" in ComfyUI Manager. There's no requirements.txt - this node is pure Python, so nothing to compile. The only dependency is the bsz-nodes folder being on the custom_nodes path.

Where people get burned

Placement. This has to sit between the sampler and the VAE Decode; if you drop it after decode it won't accept an IMAGE. And remember it's an SDXL-VAE operation - your checkpoint and this node need to agree about whose latent space they're in. Run it on a non-XL latent and your "small hue shift" can turn into something you didn't order. When in doubt, start with hue only, small values, and check the decoded output before layering on chroma and lightness.

Categorybeinsezii/latent

Inputs (4)

NameTypeDefaultDescription
latentLATENT
hueFLOAT0.00-180–180
chromaFLOAT0.00-100–100
lightnessFLOAT0.00-100–100

Outputs (1)

NameTypeDescription
LATENTLATENT