modaux: leres
The legacy depth map that refuses to leave the toolbox
- image
- IMAGE
Depth is the ControlNet condition for scene layout - foreground here, background back there, no pose and no edges required. controlaux_leres (modaux: leres) is one of the older ways to get that map, running the LeReS estimator as a thin wrapper over Hugging Face's controlnet_aux.
Don't trust the README on this one, by the way. It describes LeReS as "image restoration," which is not what a depth map is, and it calls PidiNet "inpainting," which it isn't either. The pack's own descriptions are the least reliable documentation it ships. Trust the output: a grayscale map where brighter pixels are closer and darker pixels are farther away.
How it works
LeReS ("Learning to Reconstruct 3D scene shape from a single RGB image") runs a resnext101 backbone to estimate per-pixel depth, then refines the result through a small pix2pix-style model. That refinement step is why this node pulls two weight files from lllyasviel/Annotators on first run - res101.pth plus latest_net_G.pth - so give it a moment and internet access the first time.
It's an old model (2020–21 era), and in a community that treats anything older than a month as archaeology, that's a real strike against it. Modern options like Depth Anything produce sharper, more coherent maps, and honestly, if you just want a depth map in 2026, that's what I'd reach for. Where LeReS earns its keep is compatibility: if you're loading a depth_leres-style ControlNet checkpoint, you want the exact preprocessor family it was trained against, and this is the only node in this pack that produces one.
Inputs that matter
This is the simplest node in the pack. There are no optional parameters at all - you get three inputs:
- image
- detect_resolution and image_resolution - both default 512 (range 256–1024), detection resolution first, output resolution second.
The single IMAGE output is the depth map. Wire it into the control-image input of a ControlNet apply node with a depth checkpoint, keep the ControlNet weight modest (depth is a strong condition), and you've got spatial control.
One real gotcha: the missing boost
If you've used LeReS elsewhere, you might be looking for the boost toggle - it exists in the underlying library and meaningfully improves the maps. It never appears on this node. The pack's options table registers it under the key depth_leres, but the node asks for leres, so the lookup misses and the parameter silently vanishes. You get plain, unboosted LeReS - usable, just not at its best. There's no in-graph fix short of editing nodes/options.py yourself; if boost matters to you, that's a sign to use the bigger maintained preprocessor pack, where the flag actually shows up.
Install
Manager → search "ControlNet Auxiliar", or:
cd ComfyUI/custom_nodes
git clone https://github.com/madtunebk/ComfyUI-ControlnetAux.git
cd ComfyUI-ControlnetAux
pip install -r requirements.txt # timm, controlnet-aux==0.0.7, mediapipe
Restart, then run once to pull the two weight files before you build a workflow around it.
Bottom line
LeReS is a legacy depth preprocessor that's still worth knowing because it's the only depth option in this pack and it matches old depth ControlNets exactly. If you're not tied to a specific depth_leres checkpoint, generate depth maps with something modern - this node is the compatibility play, not the quality play.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| detect_resolution | INT | 512256–1024 | — |
| image_resolution | INT | 512256–1024 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |