Nodes/ComfyUI's ControlNet Auxiliary Preprocessors/LeReS Depth Map (enable boost for leres++)
ComfyUI Node Runs on cloud

LeReS Depth Map (enable boost for leres++)

Scene depth with foreground/background cleanup knobs

By Fannovel16·Created 3 years ago·Updated 4 months ago· 4,143
LeReS Depth Map (enable boost for leres++)
  • image
  • IMAGE
rm_nearest0.00
rm_background0.00
boostdisable
resolution512

LeReS is one of the older depth estimators in the pack, and its standout feature isn't raw quality - it's the two cleanup knobs nobody else gives you. It estimates a grayscale depth map (bright = close, dark = far) to feed a depth ControlNet, and it lets you trim the nearest and farthest depth ranges right at the preprocessor. When a depth map is getting polluted by foreground clutter or a noisy background, that trimming is genuinely handy.

How it works

LeReS (weights: res101.pth plus a latest_net_G.pth refinement network) is a monocular depth model - one flat image in, an estimated depth map out. It has a reputation for handling scene-scale depth and longer ranges reasonably well. For ControlNet purposes, remember the lesson from the depth-estimation world: the model doesn't need metric accuracy, it needs clean relative relationships and clear edges the ControlNet can lock onto. LeReS gives you that, plus the ability to clip the extremes.

The boost option flips it into the "LeReS++" mode, which does multi-scale merging to recover more high-resolution detail. It's slower, but if you want a more detailed depth map from a high-res source, that's the switch.

The inputs and output

  • image - your source.
  • rm_nearest (default 0) - remove the nearest depth range. Turn it up to strip foreground objects that are crowding the map.
  • rm_background (default 0) - remove the farthest range. Turn it up to clean out a noisy or irrelevant background.
  • boost (default disable) - enable for the higher-detail, slower LeReS++ multi-scale mode.
  • resolution (default 512) - processing size; match it to your render.

Those two rm_ sliders are the reason to pick LeReS specifically. Most depth nodes give you the whole range and make you mask afterward; here you can carve off the parts you don't want up front.

The single output is an IMAGE - the depth map - which wires into a ControlNet Apply node with a depth ControlNet (control_v11f1p_sd15_depth and friends). The map does nothing without that model 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. First run downloads the LeReS weights (res101.pth and latest_net_G.pth) from HuggingFace.

Where people get burned

Honest positioning: in 2026, Depth Anything V2 (another node in this pack) is the default depth preprocessor for most work - it generalizes better to unusual scenes and handles reflective surfaces more gracefully. LeReS isn't the one you reach for on quality alone. You reach for it when the rm_nearest / rm_background cleanup is exactly the lever you need, or when its scene-depth character suits the shot. Pick the tool for the problem.

Second, don't overdo the trim sliders. Crank rm_nearest too far and you'll delete your subject; crank rm_background too far and you flatten the scene. Nudge them, preview, adjust - they're scalpels, not sledgehammers.

And the universal one: weight discipline still applies at the ControlNet Apply stage - roughly 0.4–0.7 for loose guidance, 0.8–1.1 for strict adherence, and ending control around half the steps so the model gets the later steps to add its own detail. The preprocessor only makes the hint; the ControlNet model does the conditioning.

CategoryControlNet Preprocessors/Normal and Depth Estimators

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
rm_nearestoptFLOAT0.000–100
rm_backgroundoptFLOAT0.000–100
boostoptCOMBOdisable2 options: disable, enable
resolutionoptINT51264–16384

Outputs (1)

NameTypeDescription
IMAGEIMAGE