Nodes/Akatz Custom Nodes/Make Depthmap Seamless | Akatz
ComfyUI Node

Make Depthmap Seamless | Akatz

Tired of seams in tiled depth maps? This node removes the tilt

By akatz-ai·Created 2 years ago·Updated 9 months ago· 33
Make Depthmap Seamless | Akatz
  • depthmap_batch
  • IMAGE

If you've ever tiled a depth map - for a seamless texture, a circular/360 parallax, or a displacement map you want to repeat - you know the telltale sign: a visible brightness step at the tile border. One edge is consistently lighter than the opposite edge. That's not noise, it's a global gradient. Depth estimators (MiDaS, Depth Anything, the whole ControlNet aux family) output maps with an overall "tilt" in brightness, and the moment you wrap them around a tile, that tilt becomes a seam. AK_MakeDepthmapSeamless is the fix: it fits a flat plane to the depth map and subtracts it, so the remaining structure wraps around cleanly.

Why you'd reach for it

Depth maps earn their keep in three places - as ControlNet conditioning, as parallax geometry for "living photo" effects, and as displacement fields you can push into Blender or a 3D printer (the depth-estimation essay in the KB spells all of this out). The second and third uses are where tiling shows up: seamless textures for 3D, tiling wallpaper, spherical/cylindrical parallax. Raw maps aren't tileable out of the box. This node is the "detile" step.

How it works

It's least-squares plane fitting under the hood. The node takes your batch of depth maps, computes the average map across all frames, then fits a plane a*x + b*y + c to that average using np.linalg.lstsq. That plane captures exactly the global brightness gradient you don't want. Every frame in the batch gets the plane subtracted, then each frame is min-max normalized back into [0,1] and returned as a 3-channel image. Because the plane is fit to the batch average, the correction is shared across frames - consistent detiling, not a per-frame guess.

Inputs and outputs

Just two things to know:

  • depthmap_batch (IMAGE) - your batch of depth maps. A single image works too; the node expands it internally.
  • IMAGE output - the corrected, seamless-depth batch, ready to feed a circular VAE decode, a tile sampler, or a displacement stack.

Installing the pack

Part of Akatz Custom Nodes (akatz-ai/ComfyUI-AKatz-Nodes). ComfyUI Manager: search "Akatz" and install. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-AKatz-Nodes

Then restart ComfyUI; you'll find it under 💜Akatz Nodes. For this node specifically the only real dependencies are numpy and torch, both already in ComfyUI - the pack's requirements.txt (numpy, torch, opencv-python, pydub) is shared across all its nodes, and the extra two are for the image/audio ones, not this. No model downloads. Docs live in the author's Notion page and a custom GPT, not the README.

Gotchas

  • Each frame is normalized on its own, so relative brightness between frames isn't preserved - if you need stable cross-frame depth values (say, for a flicker-free animation), be aware this node can reset the baseline per frame.
  • It removes the plane but leaves local structure alone, so maps with extreme foreground/background contrast still won't be perfectly tileable. Pair it with the pack's AK_MakeDepthmapSeamlessAdvanced if you need more knobs, and AK_AdjustDepthmapBrightness if the output sits too dark or bright afterward.
  • Input is expected to be a proper IMAGE tensor; feeding it a MASK or a latent will error out.
Category💜Akatz Nodes/Utils

Inputs (1)

NameTypeDefaultDescription
depthmap_batchIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE