Nodes/ComfyUI Inspire Pack/NormalMap Preprocessor Provider (SEGS)
ComfyUI Node Runs on cloud

NormalMap Preprocessor Provider (SEGS)

Three Normal Estimators for Region ControlNet

By ltdrdata·Created 3 years ago·Updated about 14 hours ago· 831
NormalMap Preprocessor Provider (SEGS)
    • SEGS_PREPROCESSOR
    ◄model_typeDSINE►
    ◄fov (DSINE)60►
    ◄iterations (DSINE)5►
    ◄backbone (Metric3D)vit-small►
    ◄fx (Metric3D)1000►
    ◄fy (Metric3D)1000►

    Normal maps are the least-loved ControlNet input and quietly one of the more interesting ones. Where a depth map says "this is far away", a normal map says "this surface faces up and to the left" - which is what you want when relighting, when holding a hard surface's faceting, or when a detail pass on a region needs to keep the geometry of what it's redrawing rather than the tone of it.

    This node is the SEGS-side provider for that. It produces a SEGS_PREPROCESSOR you plug into Impact Pack's SEGS ControlNet pass, so every detected region gets its own estimated normal map before resampling.

    What it actually does

    Nothing at build time. It packages your settings into a wrapper, and when the SEGS ControlNet apply node hits a region, that wrapper calls the matching node in Fannovel16's ControlNet Auxiliary Preprocessors - after rounding the crop to a multiple of 64 - and returns the normal map. So the heavy lifting is entirely in that extension, and you must install it. Without comfyui_controlnet_aux present, the node wires up fine and throws at run time.

    There are three estimators behind the model_type field, and they are genuinely different tools rather than three sizes of the same thing:

    • DSINE (the default) - a strong, modern surface-normal estimator. Best general-purpose choice for organic subjects and the one to start with.
    • BAE - the older, blunter baseline. Faster, less detailed, sometimes more stable on flat illustration-style art where DSINE loves to invent micro-surface detail.
    • Metric3D - metric-depth-driven, and the only one with focal-length parameters, because it's doing 3D-aware geometry rather than apparent-surface estimation. Heavy; pick it when you want metrically plausible surfaces, not merely attractive ones.

    The fields, and which ones apply

    model_type - DSINE, BAE, Metric3D. Switching it changes which of the optional fields mean anything.

    DSINE fields:

    • fov (DSINE) - field of view in degrees, default 60, range 10 to 365. The estimator's assumption about the camera. 60 is a sane default; a wide-angle reference benefits from a wider number here.
    • iterations (DSINE) - default 5, range 1 to 20. Refinement passes. More is slower and marginally cleaner. 5 is fine.

    Metric3D fields:

    • backbone (Metric3D) - vit-small, vit-large, vit-giant2. Small for iteration, giant2 when you actually care.
    • fx (Metric3D) / fy (Metric3D) - focal lengths in pixels, default 1000 each, range 1 to 2048. Set these to something matching your source camera if the geometry matters; leaving them means you've told the model the shot was taken with a ~1000px focal length, which is a guess.

    Leave the fields that don't apply alone. They're visible on the node regardless of model_type, which confuses people into thinking fov does something on Metric3D. It doesn't.

    Wiring

    SEGS detector ──► Apply ControlNet (SEGS) ◄── NormalMap Preprocessor Provider (SEGS)
    

    And a normal-map ControlNet model loaded on the other input of that apply node. That last part is the piece people forget: the provider makes the map, the ControlNet consumes it, and a depth or canny ControlNet will happily accept a normal map and produce mush.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
    git clone https://github.com/Fannovel16/comfyui_controlnet_aux
    pip install -r ComfyUI-Inspire-Pack/requirements.txt
    

    Or ComfyUI Manager: "ComfyUI Inspire Pack" plus "ComfyUI's ControlNet Auxiliary Preprocessors". Restart after both. DSINE, BAE and Metric3D weights download into the preprocessor's model folder on first use, so the first region pass is slow and network-dependent - if you're on a metered connection, warm the caches with a single small image before queueing a long batch.

    Troubleshooting

    Run-time exception telling you to install ControlNet Auxiliary Preprocessors. Either it isn't installed, or it installed into a different Python environment than the one ComfyUI runs on. Check the startup log for where ComfyUI thinks its custom_nodes folder is.

    Nothing happens visually. Normal map ControlNet at default strength is subtle on a small region. Try a full-frame test of the same preprocessor before blaming the SEGS plumbing.

    Metric3D runs out of VRAM. Swap the backbone to vit-small, or accept that giant2 on a batch of crops isn't happening on 8GB. Note too that Impact Pack itself is memory-hungry during detail passes, so the region loop, not the estimator, is often the real cost.

    CategoryInspirePack/SEGS/ControlNet

    Inputs (6)

    NameTypeDefaultDescription
    model_typeCOMBODSINE3 options: DSINE, BAE, Metric3D
    fov (DSINE)optFLOAT6010–365—
    iterations (DSINE)optINT51–20—
    backbone (Metric3D)optCOMBOvit-small3 options: vit-small, vit-large, vit-giant2
    fx (Metric3D)optINT10001–2048—
    fy (Metric3D)optINT10001–2048—

    Outputs (1)

    NameTypeDescription
    SEGS_PREPROCESSORSEGS_PREPROCESSOR—