ComfyUI Node

InterpolateEdges

Kill the seam in your equirectangular depth map with one node

By willchil·Created 2 years ago·Updated about a year ago· 15
InterpolateEdges
  • image
  • IMAGE
distance

An equirectangular image wraps: its left edge and right edge are the same point in the world, meeting at the 360° seam. A depth model has no idea about this. Run Depth Anything or Marigold over a panorama and the two edges will often disagree - and when you displace a mesh with that map, the mismatch turns into a visible step or tear right where the image wraps around. InterpolateEdges exists to make that seam continuous.

What it does

It takes your image and a distance value, then linearly blends the pixel values at the vertical edges so the left and right sides ease toward each other's average instead of clashing. Under the hood it reads the left edge column and the right edge column, averages them, and applies a linear falloff over distance pixels on each side - the blend zone gets pushed toward the mean, so the wrap joins cleanly. The node clamps distance at half the image width so it can't eat the whole frame.

The inputs that matter

  • image - anything with a vertical seam problem.
  • distance - how many pixels on each side get blended. It's the only knob and the whole trick: too small and the discontinuity lingers, too large and you start flattening real detail.

The output is a single IMAGE, ready to wire into the depth input of EnvironmentVisualizer or any other consumer.

Works best on depth, honestly

The author says it plainly: it works on any image, but it's more noticeable in color, and it's primarily intended for depth maps. That's not modesty. On a color texture the edge-blend shifts hue and smears pixels, which you'll see immediately; on a depth map you're smoothing a scalar value across a boundary, which is exactly what you want. Use it on the depth map, not the skybox.

Where it sits in a workflow

A typical 360 pipeline: generate the 2:1 panorama → depth model (Marigold or Depth Anything) → InterpolateEdges → EnvironmentVisualizer. On a 1024-pixel-wide map, something in the 32–128 range is a sane starting point for distance; nudge it until the seam stops showing up in the viewer.

One honest caveat: this node smooths the seam, it doesn't fix a bad depth map. If the geometry genuinely disagrees around the wrap - a wall on the left edge that doesn't line up with its continuation on the right - blending pixels won't rescue it; the interpolation only stops the transition from jumping. If the step is still visible after you push distance, revisit the depth generation itself.

Install

It ships in the ComfyUI-Environment-Visualizer pack, so installing that once gets you this node, MapEquirectangular, and the EnvironmentVisualizer viewer:

cd ComfyUI/custom_nodes
git clone https://github.com/willchil/ComfyUI-Environment-Visualizer

Restart ComfyUI, or grab the pack from ComfyUI Manager by searching "ComfyUI-Environment-Visualizer". No model files, no extra pip packages - this is pure tensor math on the image you already have.

Categoryimage/equirectangular

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
distanceINT

Outputs (1)

NameTypeDescription
IMAGEIMAGE