Nodes/DenRakEiw_Nodes/πŸŽ›οΈ Latent Image Adjust *DRE
ComfyUI Node

πŸŽ›οΈ Latent Image Adjust *DRE

Brightness, hue, contrast and sharpness β€” on the latents, not the pixels

By DenRakEiwΒ·Created about a year agoΒ·Updated a day agoΒ· 34
πŸŽ›οΈ Latent Image Adjust *DRE
  • latent
  • LATENT
β—„hue0β–Ί
β—„saturation1.00β–Ί
β—„brightness0.00β–Ί
β—„contrast1.00β–Ί
β—„sharpness1.00β–Ί
β—„deviceβ–Ύβ–Ί
β—„batch_size0β–Ί

You know the workflow: generate, VAE-decode, open the image in an editor, tweak brightness, re-encode, regenerate. LatentImageAdjust_DRE collapses that into one node that applies the standard adjustment suite - brightness, contrast, hue, saturation, sharpness - directly to the latent tensor. No decode/encode cycle, no pixels changing hands, no extra VRAM spike. It's the "adjust in latent space" cousin of the color match nodes in the same pack, and it shares their selling point: faster and lighter than the image-space equivalent, at the cost of being a heuristic.

What it does

One latent input, five adjustment knobs, one LATENT output. The ranges tell the story:

  • hue - -180Β° to +180Β° (default 0)
  • saturation - 0.0 to 3.0 (default 1.0, so 1 = unchanged)
  • brightness - -1.0 to +1.0 (default 0)
  • contrast - 0.0 to 3.0 (default 1.0)
  • sharpness - 0.0 to 3.0 (default 1.0)

Then device (auto/cpu/gpu) and batch_size (0 = auto). The output is a LATENT you feed back into a KSampler or a VAE decode.

How it's implemented

Under the hood it's kornia-backed where it counts: brightness and contrast are simple tensor math scaled for the latent domain (the code halves brightness intensity because latents don't respond like pixels), and hue/saturation route through kornia's color transforms when it's installed, with a plain-PyTorch fallback otherwise. The sharpness pass is a latent-domain unsharp-mask-style operation. None of this is magic - it's the same operations you'd do in pixel space, mapped onto latent coordinates, which is why the README frames it as memory-efficient with anti-aliasing handled internally.

Where it's actually useful

The sweet spot is iterative generation, not final polish. You generate, nudge saturation up 0.15 and brightness down 0.05 in latent space, and re-run the sampler - the adjustment participates in the generation instead of being pasted on top afterwards. That's a genuinely different workflow from post-processing an image. It's also great for batch jobs where you want one consistent color treatment across a run without per-image editing. The README's claim of "direct latent manipulation, memory efficient" holds: you skip two full VAE passes, which matters when you're already near your VRAM ceiling.

The honest catch

Latent adjustments are approximations and they compound. Big swings (hue at Β±120Β°, brightness at 0.8) can push the latent out of the manifold the VAE expects, producing artifacts that pixel-space editing never would. Keep adjustments moderate and re-run; if you need surgical final tweaks on a finished image, decode and use an image-space node instead. Also worth knowing: the adjustments are applied sequentially in a fixed order (brightness β†’ contrast β†’ hue/saturation β†’ sharpness), so extreme values interact in ways that can surprise you.

Install

Part of DenRakEiw_Nodes - ComfyUI Manager β†’ search "DenRakEiw Nodes", or git clone https://github.com/DenRakEiw/DenRakEiw_Nodes + pip install -r requirements.txt + restart. Needs kornia>=0.6.0 (listed in the requirements) for the good hue/saturation path. One-author pack, no community support to speak of - the issues page is the help desk.

Categorydenrakeiw/latent

Inputs (8)

NameTypeDefaultDescription
latentLATENTβ€”
hueFLOAT0-180–180β€”
saturationFLOAT1.000–3β€”
brightnessFLOAT0.00-1–1β€”
contrastFLOAT1.000–3β€”
sharpnessFLOAT1.000–3β€”
deviceCOMBO3 options: auto, cpu, gpu
batch_sizeINT00–1024β€”

Outputs (1)

NameTypeDescription
LATENTLATENTβ€”