Nodes/ComfyUI-PBRFusion4/PBRFusion4 Simple Depth & Normal Generator
ComfyUI Node

PBRFusion4 Simple Depth & Normal Generator

Depth and normals in one pass, tuned for PBR texture work

By Night1099·Created 7 months ago·Updated 4 months ago· 19
PBRFusion4 Simple Depth & Normal Generator
  • image
  • depth
  • depth_filtered
  • normal
  • normal_scharr
  • intensity
intensity_blend0.30
opengl_normalfalse
optimizetrue
bilateral_d10
bilateral_sigma_color50
bilateral_sigma_space50
scharr_scale_xy1.0

Most depth and normal tools floating around ComfyUI were built for one job: feeding a ControlNet. This node was built for a different one - feeding a game engine. If you're making PBR materials, that distinction is the whole story.

PBRFusion4 Simple Depth & Normal Generator (class AIXPOLY_PBRFusion4SimpleDepthAndNormalGenerator) is the flagship of the ComfyUI-PBRFusion4 pack. You drop in an image - a photo, a render, a baked albedo texture - and it hands back a depth map and a normal map sized for material work. It's built on PBRFusion4, a ~4.1 GB diffusion model in the Lotus family (the same lineage that shows up in the big depth-model comparisons), fine-tuned with PBR workflows in mind. The "Simple" in the name means no seamless/tileable processing; that's the one thing this node deliberately skips.

How it works

The pipeline is a Lotus-style UNet (LotusDInstNorm) running a single DDIM denoise step at timestep 999. That's the part that makes it different from Marigold-style generative depth: no iterating through dozens of steps, and no seed - the same image gives you the same result every time, which you genuinely want when you're building a material you'll be baking. The model produces the depth, then the node does the classic geometry math around it:

  • Depth is normalized to grayscale and smoothed with a bilateral filter - edges stay crisp, flat noise gets flattened. That's exactly the property a height map needs.
  • The normal map is computed from that smoothed depth using Sobel gradient operators, the standard depth-to-normal transform.
  • A second output, normal_scharr, uses higher-precision Scharr operators for sharper gradient detail.

There's also an intensity output - the luminance (HSV value channel) of your input - because the node lets you blend some of that original detail back in.

The inputs you'll actually touch

Five of the eight matter on a first run:

  • image - your input.
  • intensity_blend (default 0.3) - how much of the original image's brightness bleeds into the depth used for normals. Higher preserves fine detail; too high and the normal map starts tracking lighting instead of geometry. This is the knob you'll tune most.
  • opengl_normal (default false) - false gives DirectX convention (Y down), true gives OpenGL (Y up). Pick whichever your engine or renderer expects; wrong convention means inverted-looking bumps.
  • optimize (default true) - caps processing at a 1024px max side, then scales the result back to your original resolution. Leave it on unless you have a big GPU and huge inputs.
  • bilateral_d / bilateral_sigma_color / bilateral_sigma_space - depth smoothing. Defaults are sane; raise them for noisy inputs, lower them if geometry detail starts disappearing.

scharr_scale_xy (default 1.0) boosts the gradient strength on the Scharr output - push it up if your normals feel flat.

The outputs are depth, depth_filtered, normal, normal_scharr, and intensity. Wire normal into a material's normal map and depth (or depth_filtered) into displacement; use normal_scharr when you want sharper relief. The depth_filtered and normal pair are the ones most workflows actually consume.

Install

The pack installs like any other custom node. Easiest: open ComfyUI Manager, search "ComfyUI-PBRFusion4", install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Night1099/COMFYUI-PBRFusion4

Restart ComfyUI. The PBRFusion4.safetensors file (~4.1 GB) is auto-downloaded on first use to ComfyUI/models/pbrfusion4/ - no manual download. The pack needs diffusers, huggingface-hub, numpy, opencv-python-headless, safetensors, torch, and transformers.

Gotchas

  • First run looks stalled. That 4.1 GB download happens the moment you hit execute, and progress prints to the console, not the UI. Let it finish.
  • It processes one image per batch. The node uses image[0] and ignores the rest - feed it a single image, not a batch.
  • It's still a diffusion model. One step is fast, but it's a UNet forward pass in fp16. Midrange GPUs handle it fine; pure CPU will be slow. Apple Silicon uses MPS.
  • The known import failure. If the node shows as missing with ImportError: cannot import name 'FLAX_WEIGHTS_NAME' from 'transformers.utils', your transformers is too new - v5 removed that name. Pin it to a 4.x release and restart:
pip install "transformers<5"

That error breaks the whole pack, not just this node, so fix it before you blame anything else.

CategoryPBRFUSION4/Generation

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
intensity_blendFLOAT0.300–1
opengl_normalBOOLEANfalse
optimizeBOOLEANtrue
bilateral_dINT101–50
bilateral_sigma_colorFLOAT501–200
bilateral_sigma_spaceFLOAT501–200
scharr_scale_xyFLOAT1.00.1–10

Outputs (5)

NameTypeDescription
depthIMAGE
depth_filteredIMAGE
normalIMAGE
normal_scharrIMAGE
intensityIMAGE