Nodes/ComfyUI-Inference-Core-Nodes/[Inference.Core] LeReS Depth Map (enable boost for leres++)
ComfyUI Node

[Inference.Core] LeReS Depth Map (enable boost for leres++)

An older depth ControlNet preprocessor with a boost mode

By LykosAI·Created 2 years ago·Updated about a year ago· 33
[Inference.Core] LeReS Depth Map (enable boost for leres++)
  • image
  • IMAGE
rm_nearest0.0
rm_background0.0
boostdisable
resolution512

LeReS ("Learning to Recover 3D Scene Shape from a Single Image") does the same job as MiDaS or Depth Anything - turn a photo into a grayscale depth map you can feed a depth ControlNet - but it's a different model, from a different lineage, with its own particular depth character. If you're new to depth ControlNet preprocessing, it's worth knowing upfront: this isn't the model most current workflows reach for first. The community's depth-estimation history runs MiDaS → ZoeDepth → Depth Anything v1/v2/v3 → Marigold → MoGe as the mainline everyone actually benchmarks and defaults to, and LeReS sits outside that lineage entirely - a working, once-relevant option that got passed over rather than one that's actively recommended today.

That doesn't make it useless. It makes it a solid fallback or a deliberate choice when you specifically want its distinct depth output, not your automatic first pick.

What the inputs actually control

The node's own display name gives away its one standout feature: "enable boost for leres++". The boost input (enable/disable, default disable) switches on LeReS's higher-quality "leres++" mode - sharper, more detailed depth estimation, at the cost of being noticeably slower. Turn it on when quality matters more than speed for a given render, leave it off for quick iteration.

rm_nearest and rm_background (both 0–100, default 0, step 0.1) let you clip the closest and farthest ends of the depth range before the map comes back - a built-in way to isolate a subject from foreground clutter or a distracting background without a separate masking step. Use them carefully: pushed too high, they'll clip real subject depth right along with the noise you're trying to remove, and you'll end up with a flattened or holed-out depth map instead of a cleaner one. Start small and increase gradually.

resolution (64–2048, default 512, step 64) is the standard preprocessor input-resize control shared across every node in this pack.

The output is a single IMAGE - a grayscale depth map, ready to wire straight into a Depth-type ControlNet Apply node alongside your checkpoint and prompt.

Installing it

Comes bundled with the LykosAI Inference Core Nodes pack. Via ComfyUI Manager, search "ComfyUI-Inference-Core-Nodes". Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes

then install.py, or - and this matters for LeReS specifically - pip install -e .[cuda] (swap in [cuda12], [rocm], or [directml] to match your hardware) rather than the bare pip install -e .. The extras pull in the accelerated onnxruntime wheels several of this pack's preprocessors, LeReS included, actually run on; skip them and you'll fall back to a slower CPU path for this node even with a capable GPU.

Troubleshooting

If your depth map looks flattened or has odd holes in it, back off rm_nearest/rm_background first - that's the most common self-inflicted cause. If preprocessing is unexpectedly slow, check whether boost got left on when you didn't need leres++'s extra quality for that particular pass. And if you're not sure LeReS is even the right depth model for your workflow: it isn't the wrong choice, but Depth Anything v2 is the community's current default for most general-purpose ControlNet depth work - reach for LeReS when you've got a specific reason to want its character, not as your starting point.

CategoryControlNet Preprocessors/Normal and Depth Estimators

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
rm_nearestoptFLOAT0.00–100
rm_backgroundoptFLOAT0.00–100
boostoptCOMBOdisable2 options: enable, disable
resolutionoptINT51264–2048

Outputs (1)

NameTypeDescription
IMAGEIMAGE