LogoWonderful Launcher
  • Home
  • Pricing
  • Docs
  • Download

ComfyUI Depth ControlNet: Control Spatial Layout and Perspective

Needs verification

How to use Depth ControlNet in ComfyUI to preserve spatial relationships, perspective, and scene layout when generating AI images.

What is Depth ControlNet?

Depth ControlNet analyzes the distance between objects and the camera in your reference image, creating a depth map — a grayscale image where white areas are close and black areas are far. The AI uses this depth map to maintain the same spatial layout when generating a new image.

This is especially powerful for:

  • Interior design — restyle a room while keeping the exact furniture layout
  • Architecture — transform a building's style while preserving its structure
  • Scene composition — maintain foreground/background relationships across style changes
  • Product photography — keep depth-of-field relationships consistent

Prerequisites

Plugin Installation

ComfyUI doesn't include a depth preprocessor by default. You need the ComfyUI ControlNet Auxiliary Preprocessors plugin.

Install it via ComfyUI Manager (search for "ControlNet Auxiliary Preprocessors") or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Fannovel16/comfyui_controlnet_aux
cd comfyui_controlnet_aux

Do not run pip install -r requirements.txt blindly.

  1. Confirm which Python environment is active (where python or which python)
  2. Inspect requirements.txt — check if it pins torch, numpy, or opencv versions
  3. Install only the missing package when possible: pip install <package-name>
  4. Run pip check after installation to verify no conflicts were introduced

Restart ComfyUI after installation.

Models

ModelFileDownload
SD1.5 checkpointdreamshaper_8.safetensorsCivitai
Depth ControlNetcontrol_v11f1p_sd15_depth.pthHuggingFace

File Placement

ComfyUI/
├── models/
│   ├── checkpoints/
│   │   └── dreamshaper_8.safetensors
│   └── controlnet/
│       └── control_v11f1p_sd15_depth.pth

Building the Workflow

  1. Load Image — load your reference photo
  2. Zoe-DepthMapPreprocessor — generates a depth map from the image (from the Auxiliary Preprocessors plugin)
  3. Preview Image — preview the depth map to verify quality
  4. Load Checkpoint — loads the SD1.5 model
  5. Load ControlNet Model — loads control_v11f1p_sd15_depth.pth
  6. Apply ControlNet (Advanced) — injects depth information into conditioning
  7. CLIP Text Encode (x2) — positive and negative prompts
  8. KSampler → VAE Decode → Save Image

Key Parameters

Depth Preprocessor

ParameterRecommendedEffect
resolution512 (general), 768+ (high detail)Higher = more accurate depth map but slower processing

The Zoe-DepthMapPreprocessor produces the best results for architecture and interior scenes. For outdoor landscapes, MiDaS or LeReS preprocessors can also work well. All are available in the Auxiliary Preprocessors plugin.

Apply ControlNet (Advanced)

ParameterRecommendedEffect
strength0.8–1.0How strictly spatial layout is preserved. Higher = more faithful to reference
start_percent0.0Start influence from the beginning
end_percent0.9–1.0Keep influence through most of sampling for consistent spatial structure

Prompt Tips for Depth Control

Include spatial and quality keywords for best results:

Spatial terms: depth of field, perspective, spatial layout, foreground, background

Quality terms: professional, high quality, detailed, realistic

Style terms: describe your target style clearly — modern minimalist interior, cyberpunk cityscape, watercolor landscape

Use Case: Interior Restyling

One of the most popular Depth ControlNet applications is restyling a room:

  1. Take a photo of any room
  2. Extract its depth map with the Zoe preprocessor
  3. Write a prompt describing the new style: modern scandinavian living room, white walls, wooden furniture, natural light, professional interior photography
  4. Generate — the new image keeps the exact room layout while applying the target style

Common Issues and Fixes

Generated image has weak spatial sense

  • Verify the depth map preview — it should clearly show near (white) and far (black) areas
  • Increase strength to 0.9–1.0
  • Increase sampling steps to 25–30

Depth map looks flat or inaccurate

  • Use a higher resolution setting on the preprocessor (768 or 1024)
  • Ensure the input image has clear depth — flat product shots won't produce good depth maps
  • Try a different preprocessor (MiDaS instead of Zoe, or vice versa)

Details are getting lost

  • Lower the cfg value to 5–6 (too high cfg crushes subtle detail)
  • Add more specific detail keywords to your prompt

Wrong style but correct layout

  • The depth map is working — refine your text prompts
  • Check that negative prompts aren't conflicting with your desired style

Related Guides

  • ControlNet Overview — All ControlNet types explained
  • Canny ControlNet — Edge-based structure control
  • OpenPose ControlNet — Human pose control

Source References

  • ComfyUI ControlNet usage example
  • ControlNetApply node documentation
  • ComfyUI models concept

Start with Wonderful Launcher if this issue touches your real ComfyUI environment. Use the docs to understand the fix, and use the app to inspect the machine you already have.

Download Wonderful Launcher

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

Table of Contents

What is Depth ControlNet?
Prerequisites
Plugin Installation
Models
File Placement
Building the Workflow
Key Parameters
Depth Preprocessor
Apply ControlNet (Advanced)
Prompt Tips for Depth Control
Use Case: Interior Restyling
Common Issues and Fixes
Generated image has weak spatial sense
Depth map looks flat or inaccurate
Details are getting lost
Wrong style but correct layout
Related Guides
Source References