Nodes/Akatz Custom Nodes/Adjust Depthmap Brightness | Akatz
ComfyUI Node

Adjust Depthmap Brightness | Akatz

Stop your depth map from flickering as it loops

By akatz-ai·Created 2 years ago·Updated 9 months ago· 32
Adjust Depthmap Brightness | Akatz
  • depthmap_batch
  • IMAGE

Adjust Depthmap Brightness fixes a very specific, very annoying artifact: depth maps that drift in brightness across their frames. It normalizes every frame's brightness to match the first frame, so a batch that gently flickers or fades comes out stable.

Why does this matter? Depth maps are grayscale where pixel value is geometry - white is near, black is far, as the KB's depth-estimation write-up puts it. They feed ControlNet conditioning, 3D parallax warps, and seamless "living photo" animations. If the map's brightness drifts between frames, that's the model or effect misreading the geometry, which shows up as pulsing, breathing geometry in your final animation. And if you're building a loop - the whole point of Akatz's depthmap toolset - the brightness mismatch between the last frame and the first frame is exactly what makes the loop visibly "click."

So this node is a cleanup pass: feed it a depth map batch and it returns the same geometry with per-frame brightness locked to frame zero. It's the kind of utility that feels pointless until your loop has a visible seam, and then it's the whole fix.

How it works

Mechanically it's simple and honest. It converts the batch to numpy, computes each frame's mean gray value, and shifts every frame by the difference between its mean and the first frame's mean, clipping to [0, 1]. That's a global brightness offset per frame - it does not re-grade local regions, so it's safe for real depth maps where you don't want local contrast changed. If you give it a single image (no batch), it handles that too and just passes it through.

Inputs and output

One input, one output:

  • depthmap_batch - an IMAGE batch of depth maps, [B, H, W, C]. Grayscale or RGB both work; RGB is internally averaged to gray before the correction and the result comes back as RGB.
  • Output is the corrected IMAGE batch, same shape.

There are no parameters to tune, which is the whole point - drop it in, done.

Installing it

This is one node in akatz-ai/ComfyUI-AKatz-Nodes, so you install the whole pack once. Via ComfyUI Manager, search "AKatz"; or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-AKatz-Nodes
cd ComfyUI-AKatz-Nodes
pip install -r requirements.txt

Then restart ComfyUI. It pulls numpy, torch, opencv-python and pydub - no model files, nothing to configure. Full docs live in the pack's Notion page (the README points there).

Where it sits in a workflow

You'll typically place it right after your depth-map generation and before anything that consumes the map - ControlNet preprocessor, a parallax warp, or Akatz's own Make Depthmap Seamless / circular VAE tools. The ordering matters: fix brightness before you start warping, because the warp will happily amplify the flicker you were trying to kill.

Category💜Akatz Nodes/Utils

Inputs (1)

NameTypeDefaultDescription
depthmap_batchIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE