ComfyUI Node Runs on cloud

MiDaS Normal Map

The old normal estimator where a and bg_threshold finally matter

By Fannovel16·Created 3 years ago·Updated 4 months ago· 4,152
MiDaS Normal Map
  • image
  • IMAGE
a6.28
bg_threshold0.10
resolution512

This is the sibling of the MiDaS depth preprocessor, and it's where the two mysterious knobs - a and bg_threshold - actually earn their keep. It derives a surface-normal map from MiDaS depth, so instead of "how far is this," you get "which way does this surface face," which is what a normal ControlNet reads. It's the oldest normal estimator in the pack, and it shows, but it gives you manual control the newer ones don't.

How it works

MiDaS estimates depth, then this node computes normals from the depth gradients - how steeply the depth changes from pixel to pixel tells you the surface slope, and that slope is the normal. Because it's math over a depth map rather than a purpose-trained normal model, the output is rougher than BAE or DSINE. But that same construction is why the a parameter matters here: it scales how the normal is computed from the depth gradient, so it's a real quality lever on this node, not the vestigial knob it is on the depth version.

If you read the MiDaS Depth Map article and wondered why a and bg_threshold were there doing nothing - this is the node they were built for.

The inputs and output

  • image - your source.
  • a (default ~6.28, i.e. 2π) - the angle/scale parameter for turning depth gradients into normals. On this node it genuinely affects the result: adjust it if the normals look too flat or too exaggerated. This is the main tuning knob.
  • bg_threshold (default 0.1) - a background threshold that masks out low-confidence background regions from the normal computation. Raise it to clean up a noisy background, lower it to keep more of the scene.
  • resolution (default 512) - processing size; match it to your render.

The single output is an IMAGE - the normal map - which wires into a ControlNet Apply node with a normal ControlNet (control_normal). Inert until that model is loaded.

Installing it

ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or:

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

Restart ComfyUI. The MiDaS weight (dpt_hybrid-midas) downloads from HuggingFace on first run - the same weight the MiDaS depth node uses, so if you've run that already it's cached.

Where people get burned

First, calibrate expectations: this is the roughest of the three normal estimators here. For clean, modern normals, BAE is the reliable standard and DSINE is the sharp pick. MiDaS normal earns its place when you want the manual a/bg_threshold control, or when you're deliberately going for its particular character, or for a legacy workflow that already uses it. Don't reach for it expecting best-in-class output - reach for it when you want the knobs.

Second, actually use those knobs. The whole reason to pick this node over BAE (which has no parameters) is that a and bg_threshold give you manual control - so if the default normals look wrong, tune them rather than concluding the node is broken. On the depth sibling those same params do almost nothing; here they're the point.

Third, the usual normal-map rules: it feeds a normal ControlNet, not a depth one, and the map is inert until that model is loaded through a ControlNet Apply node. Normals are for surface-facing and relighting; if you actually wanted geometry-for-composition, that's a depth map, not this.

CategoryControlNet Preprocessors/Normal and Depth Estimators

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
aoptFLOAT6.280–15.70796326794897
bg_thresholdoptFLOAT0.100–1
resolutionoptINT51264–16384

Outputs (1)

NameTypeDescription
IMAGEIMAGE