Nodes/RES4LYF/LatentBatch_channels
ComfyUI Node Runs on cloud

LatentBatch_channels

Color-grading a 4-channel latent directly

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
LatentBatch_channels
  • latent
  • luminositys
  • cyan_reds
  • lime_purples
  • pattern_structures
  • LATENT
mode
luminosity0.00
cyan_red0.00
lime_purple0.00
pattern_structure0.00

Standard SD1.5/SDXL-style VAEs compress an image into a 4-channel latent, and those four channels aren't random - they roughly correspond to luminosity, a cyan-red axis, a lime-purple axis, and a pattern/structure channel. It's an informal mapping the community worked out by experimenting directly with latent values, not something officially documented by any model card, but it's stable enough that this node names its four parameters exactly that way. LatentBatch_channels lets you nudge those four channels directly, before decoding - it's latent-space color grading, the rough equivalent of a Curves adjustment, applied to the tensor instead of the finished image.

This sits inside RES4LYF's broader philosophy, stated right in its own README: a lot of the pack's value comes from modulating parameters across the sampling process rather than setting one static value, and this node is built for exactly that kind of use - nudge luminosity partway through a run, shift color balance only in the later steps, that sort of thing.

What you set

  • latent (LATENT) - required, the 4-channel latent you're adjusting. (For 16-channel latents like Flux or Z-Image, use the pack's LatentBatch_channels_16 sibling instead - this node is built for the classic 4-channel space.)
  • mode - offset, multiply, or power. Offset adds a fixed amount, multiply scales the channel, power applies a gamma-style curve. Pick based on whether you want a flat shift, a proportional scale, or a contrast-style curve on that channel.
  • luminosity, cyan_red, lime_purple, pattern_structure (FLOAT, default 0, wide range) - the four channel adjustments, applied according to whichever mode you picked.
  • Optional luminositys, cyan_reds, lime_purples, pattern_structures (SIGMAS) - feed a schedule of values across steps instead of one static number, if you want the adjustment to change as sampling progresses.
  • Output: LATENT - the adjusted latent, wired onward to your VAE decode or next sampling stage.

Installing it

Bundled with the full RES4LYF pack:

  • ComfyUI Manager - search "RES4LYF," install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, then cd RES4LYF && pip install -r requirements.txt, restart.

No extra downloads for this node itself.

Common issues

Adjustments feel unpredictable. Latent-channel manipulation isn't a precise, linear operation like adjusting pixels - a small nudge in mode: power can behave very differently from the same numeric value in offset. Start with small values and one channel at a time rather than dialing in several at once.

Used on a 16-channel model and it errors or does nothing sensible. This node assumes 4 channels. Flux, Z-Image, and other newer architectures use 16-channel latents at the same spatial resolution - reach for LatentBatch_channels_16 there instead.

Not sure why the effect looks different after decoding than expected. These channels are an approximate, empirically-derived mapping, not a guaranteed one-to-one correspondence with visible attributes - treat the parameter names as a starting intuition, not a literal guarantee, and judge by the decoded result rather than the parameter value alone.

CategoryRES4LYF/latents

Inputs (10)

NameTypeDefaultDescription
latentLATENT
modeCOMBO3 options: offset, multiply, power
luminosityFLOAT0.00-10000–10000
cyan_redFLOAT0.00-10000–10000
lime_purpleFLOAT0.00-10000–10000
pattern_structureFLOAT0.00-10000–10000
luminositysoptSIGMAS
cyan_redsoptSIGMAS
lime_purplesoptSIGMAS
pattern_structuresoptSIGMAS

Outputs (1)

NameTypeDescription
LATENTLATENT