Nodes/qwen-image-controlnets-comfyui/Qwen Image Depth Preprocessor
ComfyUI Node

Qwen Image Depth Preprocessor

Qwen depth maps, served the slow 2023 way

By krigeta·Created about a year ago·Updated about a year ago· 2
Qwen Image Depth Preprocessor
  • image
  • IMAGE

Depth preprocessors give a ControlNet the spatial layout of a scene: close things white, far things black, everything in between graded. That's the classic way to redraw a scene in a new style while keeping who's in front of whom intact. This node does that for Qwen Image controlnets - and it does it with the oldest tool still floating around the ecosystem.

Under the hood it calls HuggingFace's transformers depth-estimation pipeline with Intel/dpt-large. That's MiDaS DPT-Large, the same baseline that shipped with SD 2.0's depth2img back in 2022. It's not bad - the community's long-standing verdict on MiDaS is that its sharp edges make it surprisingly good for ControlNet conditioning ("Zoe Depth vs MiDaS. Spoiler alert: Use MiDaS," went the classic comparison). But it is 2023 tech, and there's nothing here to argue otherwise: you get one input, one output, and zero knobs.

The whole interface

  • image - IMAGE in (ComfyUI tensor).
  • Output - one IMAGE: the depth map, normalized so the brightest pixel is white, encoded as RGB.

That's the entire node. No model choice, no device toggle, no scale. Feed it an image, get a depth map, wire the map into your Qwen controlnet.

Where it actually gets slow

Three things about the implementation that matter when you queue a job:

  1. It builds the pipeline on every single call. Each run re-initializes DPT-Large, downloads it if it isn't cached, and loads it into memory. That's a genuinely silly way to write a preprocessor, and it's the first thing you'll feel.
  2. No device is passed, so it runs on CPU by default. DPT-Large on CPU is not a snappy experience.
  3. First run downloads the model from HuggingFace - roughly half a gigabyte. Queue once with a coffee, not twice with a deadline.

It also imports transformers at runtime rather than in requirements.txt. The pack's list covers diffsynth, einops, and opencv-python, and diffsynth drags transformers in transitively - but if your install was partial, you'll hit the node's own error message telling you to pip install transformers.

Should you use it?

Honestly, this is the "it works, it's fine" option. If your goal is Qwen depth control specifically, the modern route is the InstantX union (canny, depth, pose - Apache 2.0, landed sixteen days after Qwen's launch) or ComfyUI's native DiffSynth ControlNet support via model_patches, and for sharper depth maps in general, Depth Anything in comfyui_controlnet_aux is the step-change upgrade the community moved to in 2024. Reach for this node when you want the DiffSynth blockwise workflow exactly as written, or when "2023-grade depth that runs anywhere" is precisely the bar you're trying to hit.

Installing

Same as the rest of the pack: search "qwen-image-controlnets-comfyui" in ComfyUI Manager, or

cd ComfyUI/custom_nodes
git clone https://github.com/krigeta/qwen-image-controlnets-comfyui
cd qwen-image-controlnets-comfyui
pip install -r requirements.txt

then restart ComfyUI. There are no model files to place by hand - this one fetches its own (big) model on first run.

CategoryQwen Image/ControlNet

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE