Nodes/ComfyUI-ZImagePowerNodes/⚡| Image Filter Stack [LAB]
ComfyUI Node

⚡| Image Filter Stack [LAB]

The Five-Layer Color Grade Your Z-Image Render Is Missing

By martin-rizzo·Created 11 months ago·Updated 11 days ago· 371
⚡| Image Filter Stack [LAB]
  • image
  • divider
  • spacer1
  • spacer2
  • spacer3
  • spacer4
  • spacer5
  • IMAGE
◄enable_auto_contrast—►
◄enable_filters—►
◄filter1▾►
◄filter1_tweak0.0►
◄filter2▾►
◄filter2_tweak0.0►
◄filter3▾►
◄filter3_tweak0.0►
◄filter4▾►
◄filter4_tweak0.0►
◄filter5▾►
◄filter5_tweak0.0►
◄settings—►

What this thing actually is

"⚡| Image Filter Stack [LAB]" is a color-correction node that sits between your VAE Decode and your Save Image. It runs up to five filter layers plus an optional histogram stretch, in CIELAB, and hands back a plain IMAGE tensor.

Worth internalizing before you touch a slider: this is not AI. No sampler, no seed, no model. The same deterministic pixel math Photoshop has had for thirty years - a saturation multiplier, a hue rotation, an S-curve - and that's why you want it in the graph instead of re-rolling the seed. It prevents the worst habit in this hobby: color-correcting with img2img, burning a diffusion pass and a fresh face lottery on something a lookup table does for free.

Why LAB and not RGB? Lightness lives in its own channel there, apart from the two chroma channels. Saturation in RGB drags hue and brightness with it and you get the overcooked orange-skin mess. In LAB you push chroma without moving exposure. The author's own line: this version "tends to produce better color tones."

Nothing here is model-specific. Feed it an SDXL or Flux image and it works fine.

How it works

The pipeline is short. Auto-contrast (if enabled) runs first, then filters 1 through 5 in order, then a conversion back to RGB and a clamp to [0,1].

Auto contrast is a quantile histogram stretch: find the 0.1% and 99.9% brightness percentiles, rescale that range to full black-to-white. It's the cure for the flat, grey, "nothing in the blacks and nothing in the whites" look. Percentiles are computed per image in the batch, so four images get four individual stretches.

Each filter takes a dropdown choice plus a _tweak float from -0.5 to +0.5. In the source, _tweak is doubled to a -1..+1 factor and used to interpolate between a filter's minimum, its neutral default, and its maximum. Which means at 0.0 a filter does nothing at all. Selecting color and leaving the tweak at 0 is a no-op, and that trips people up constantly.

The six filters:

  • color - chroma amplitude, i.e. saturation. 0.2 to 2.1, neutral 1.0.
  • color_shift - hue rotation in degrees, ±15.
  • color_twist - hue rotation whose strength varies with pixel lightness, up to ±90. The split-tone one, not a flat hue spin.
  • chroma_blur - Gaussian blur on the chroma channels only. Lightness detail stays sharp while color blotches smear out. Nothing like it in the stock nodes.
  • contrast_z - an S-curve on lightness pivoted at 0.25, calibrated for Z-Image.
  • brightness_curve - a lightness curve set by its initial slope at zero, lifting or crushing shadows without moving white.

The inputs that actually matter

image is your decoded image. enable_auto_contrast and enable_filters are independent switches - the second bypasses every filter below it without you resetting them, a decent A/B toggle. Then filter1 through filter5, each paired with a filterN_tweak. Order matters: saturate-then-tone isn't tone-then-saturate.

The optional settings input is an escape hatch most people never touch. It takes multi-line key = min, default, max entries (# comments out a line) and overrides a filter's built-in range, so color = 0.2, 1.0, 3.5 pushes saturation past what the ±0.5 slider allows. Keys are the filter ids above.

One output: IMAGE. Wire it to Preview Image, the pack's own ⚡Save Image (which stamps CivitAI-compatible metadata), or into an upscaler.

Installing it

Through ComfyUI Manager: search "Z-Image Power Nodes", install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/martin-rizzo/ComfyUI-ZImagePowerNodes.git

No models to download for this node - no VAE, no checkpoint, nothing into models/. The nice part about a pure pixel node. The pack's pyproject.toml does declare requires-comfyui = ">=0.14.0" (the nodes target the v3 comfy_api.latest schema, README asks for PyTorch 2.5 and Python 3.10 minimum). There's no requirements.txt; the code imports kornia and torchvision, both of which a normal ComfyUI environment already has.

Where it goes wrong

The whole pack fails to load on older ComfyUI. Below v0.14 you get an import error on comfy_api.latest and the ⚡Z-Image category never appears. Update ComfyUI instead of debugging the node.

ModuleNotFoundError: No module named 'kornia' happens on stripped-down or hand-built virtualenvs. pip install kornia in the same env fixes it.

"I picked a filter and nothing changed." Check the tweak. Zero is neutral by design.

Auto contrast fights you on already-good images. A quantile stretch will happily crush highlights and darken a moody low-key render. If the image was fine, switch it off; off, the node just clamps to [0,1].

Old workflows want a different node. Earlier versions shipped "Image Filter Stack [OLD HSV]" with three layers and a different filter list. Swap in the LAB version and re-pick; same job, done better.

One curiosity: search "decode" and this filter node appears, because the author copy-pasted the search aliases from the VAE decoder next door. Harmless - and probably how you got here.

Category⚡Z-Image/utils

Inputs (20)

NameTypeDefaultDescription
imageIMAGE—
enable_auto_contrastBOOLEANWhen enabled, automatically adjusts the dynamic range of the image to fix washed-out tones and optimize contrast boundaries.
dividerZIPN_SEPARATOR—
enable_filtersBOOLEANWhen enabled, applies the color correction filters configured below. If disabled, all filter selections and adjustments are bypassed.
spacer1ZIPN_SEPARATOR—
filter1COMBOThe first color correction filter to apply to the resulting image.
filter1_tweakFLOAT0.0-0.5–0.5The fine-tuning control for the filter. Range is -0.5 to 0.5, with 0.0 as the ideal baseline balance.
spacer2ZIPN_SEPARATOR—
filter2COMBOThe second color correction filter to apply to the resulting image.
filter2_tweakFLOAT0.0-0.5–0.5The fine-tuning control for the filter. Range is -0.5 to 0.5, with 0.0 as the ideal baseline balance.
spacer3ZIPN_SEPARATOR—
filter3COMBOThe third color correction filter to apply to the resulting image.
filter3_tweakFLOAT0.0-0.5–0.5The fine-tuning control for the filter. Range is -0.5 to 0.5, with 0.0 as the ideal baseline balance.
spacer4ZIPN_SEPARATOR—
filter4COMBOThe fourth color correction filter to apply to the resulting image.
filter4_tweakFLOAT0.0-0.5–0.5The fine-tuning control for the filter. Range is -0.5 to 0.5, with 0.0 as the ideal baseline balance.
spacer5ZIPN_SEPARATOR—
filter5COMBOThe fifth color correction filter to apply to the resulting image.
filter5_tweakFLOAT0.0-0.5–0.5The fine-tuning control for the filter. Range is -0.5 to 0.5, with 0.0 as the ideal baseline balance.
settingsoptSTRINGA string listing variables and their values for each filter you wish to customize.

Outputs (1)

NameTypeDescription
IMAGEIMAGEThe final filtered image.