Nodes/tri3d-comfyui-nodes/Adjust Neck v5.1.0
ComfyUI Node

Adjust Neck v5.1.0

It's called HistogramEqualization in code, but everyone uses it to fix a neck

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Adjust Neck v5.1.0
  • image
  • IMAGE
strength1.00

There's a small mystery at the heart of this node: the class is tri3d-HistogramEqualization, but ComfyUI's search bar knows it as Adjust Neck. The display name tells you what it's actually for. The mechanism is textbook histogram equalization - the image gets passed through PIL's ImageOps.equalize, which redistributes the tonal values so the histogram spreads out and contrast increases - and then the equalized version is blended with the original by a strength factor. On paper it's a contrast fixer.

The neck thing is where the pack's workflow makes it click. In the try-on / head-swap pipeline, the most common visible artifact is a tonal jump: a head generated in one lighting context pasted onto a body in another, leaving a neck that's visibly lighter or darker than the face. Histogram equalization on the affected region - the neck - stretches its tonal range to match the surrounding values, and the strength blend lets you apply just enough to erase the seam without flattening the whole image. Same node, two names, one honest job: make the tonal boundary disappear.

Inputs

  • image - the image (or region) to equalize.
  • strength - 0.0 to 1.0, default 1.0. The blend factor between the original and the fully-equalized version. At 1.0 you get the pure equalization; at 0.3 you get a subtle nudge. Start low when you're touching a neck seam - the goal is matching, not a contrast boost.

Output

One IMAGE, the blended result.

How to actually use it

In a typical fix, you don't equalize the whole frame - you crop the neck/chin region (the pack's tri3d-Image_extend and crop helpers are handy here), run this node on the crop at a modest strength, and stitch it back with something like tri3d-image-mask-box-2-image. Equalizing the entire photo just to fix a seam will make the background pop in an ugly way. Keep it local, keep it gentle.

Install

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
# restart ComfyUI

Or via ComfyUI Manager, search "tri3d." Folder name must stay tri3d-comfyui-nodes. Pure Pillow/numpy inside - no model, no GPU, no extra deps.

Gotchas

  • ImageOps.equalize works on a per-channel basis, so a mid-toned neck can come out with a slight color cast if one channel was more compressed than the others. Usually invisible at low strength; watch for it at 1.0.
  • Equalization is global to whatever image you feed it. Feed it a full-frame shot and the "neck fix" becomes "contrast everywhere," which is almost never what you want.
  • There's no masking built in - you bring your own crop or mask workflow around it.

Honest take: it's a one-line PIL call wrapped in a node, and "Adjust Neck" is doing a lot of marketing for a histogram equalizer. But for the specific job - killing a tonal seam between head and body - it's the right tool, and the strength blend is what keeps it surgical instead of a sledgehammer.

CategoryImage Processing

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
strengthFLOAT1.000–1

Outputs (1)

NameTypeDescription
IMAGEIMAGE