Nodes/ComfyUI-XJNodes/SEGS Auto Adjust Hook
ComfyUI Node

SEGS Auto Adjust Hook

Auto-level the detail pass so it matches the scene

By alexjx·Created 10 months ago·Updated 4 months ago· 0
SEGS Auto Adjust Hook
    • hook
    strength100
    modeRGB
    brightness0
    contrast0
    saturation0
    red0
    green0
    blue0
    feather0

    The most common reason a detail pass looks "off" isn't a color cast you can predict - it's that the freshly denoised crop simply has different histogram characteristics than the rest of the image: flatter blacks, duller saturation, a slightly lifted look. The fix that generalizes is auto-levels: normalize the crop's histogram so its black point, white point, and saturation match the frame around it. That's what XJSegsAutoAdjustHookProvider does, and it's the most interesting of the pack's hook providers because it's adaptive rather than a fixed offset.

    The node builds a DETAILER_HOOK for Impact Pack's detailers that runs after VAE decode. First it applies histogram normalization based on your chosen mode, then layers on brightness/contrast/saturation adjustments and per-channel gamma corrections, then blends the whole thing back with your strength and (if a mask is present) feathers the correction within the segment. The mode dropdown is where the character comes from:

    • RGB - normalize each RGB channel independently (the default; full auto-levels).
    • luminance - normalize only lightness, in LAB space, leaving hue alone.
    • saturation - normalize only saturation, in HSV space.
    • lum + sat - both of the above, which is a good all-rounder.
    • mono - grayscale and normalize; niche, but great for forcing a monochrome detail region.

    On top of the normalization, brightness, contrast, and saturation are manual offsets, and red/green/blue apply per-channel gamma - the author frames it as a LayerStyle-style "Auto Adjust," and that's a fair mental model.

    The interface:

    • strength - 0–100, default 100. How much of the adjustment is blended in.
    • mode - the five options above.
    • brightness, contrast, saturation, red, green, blue - each -100 to 100, default 0.
    • feather - 0–100, default 0.
    • Output: hook, into detailer_hook on FaceDetailer / Detailer (SEGS).

    Where it shines: as the default "make the crop match the scene" hook. When you can't predict what's wrong - different lighting per image, varied subjects - the adaptive normalization handles it, and you dial strength down to 60–80 if the auto-levels are too aggressive. It's the hook to try first when color matching feels too heavy and fixed offsets don't generalize.

    Install is the standard pack routine:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexjx/ComfyUI-XJNodes
    

    Restart ComfyUI, find it under XJNodes/segs/hooks, or use ComfyUI Manager and search "ComfyUI-XJNodes". No models, no extra pip packages (requirements.txt is empty); you need Impact Pack for the hook input.

    Personal-pack reality check: no tutorial ecosystem, so expect to experiment. One tip from reading the source: when strength is below 100 the node blends the adjusted result with the original, so it's the master control for how brave this hook gets.

    CategoryXJNodes/segs/hooks

    Inputs (9)

    NameTypeDefaultDescription
    strengthINT1000–100
    modeCOMBORGB5 options: RGB, luminance, saturation, lum + sat, mono
    brightnessINT0-100–100
    contrastINT0-100–100
    saturationINT0-100–100
    redINT0-100–100
    greenINT0-100–100
    blueINT0-100–100
    featherINT00–100

    Outputs (1)

    NameTypeDescription
    hookDETAILER_HOOK