Nodes/Mickmumpitz-Nodes/Harmonize Boundary
ComfyUI Node

Harmonize Boundary

Kill the visible seam where your photo meets the generated pano

By mickmumpitz·Created 8 months ago·Updated 17 days ago· 48
Harmonize Boundary
  • image
  • plate
  • inpaint_mask
  • image
  • correction_field
strength1.00
solve_scale8
iterations800
wrap_horizontaltrue

Outpainting a panorama has a tell. The generated surroundings are usually great on their own and your original photo is great on its own, but where they touch there's a step - the generated side is a shade off, slightly too bright, or just enough of a different color temperature that you can draw the boundary by eye. That's exactly the artifact this node is built for.

What it does

Harmonize Boundary bends the generated side so it meets your photo's plate with no visible discontinuity, while leaving the photo itself completely alone. It's the cleanup step that makes an outpainted 360 actually look captured rather than stitched.

How it works

The trick is that it doesn't just crossfade - it solves a correction field. It computes, on the boundary where the plate is real, the difference between the plate and the generated image, then relaxes that difference outward over the hole region with a harmonic (Laplacian) solve: laplacian(c) = 0 inside the hole, c = plate - image on the known boundary, iterated a few hundred times. Because the field is harmonic it's smooth, so the generated content's own texture and gradients are untouched - only the low-frequency brightness/color level gets bent to meet the plate exactly. That's the difference between this and a blur mask, which would smudge detail along the whole seam.

Inputs and outputs

  • image - the outpainted panorama (generated surroundings).
  • plate - the ERP canvas from the Warp node's control_video output: your photo placed on the sphere.
  • inpaint_mask - from the Warp node too. White = hole to generate, black = your photo.
  • strength - 1.0 makes the generated side meet the plate exactly at the boundary. Lower keeps more of the generated look, at the cost of a visible step. Start at 1.0 and back off only if the correction starts looking "painted over".

The two optional knobs are basically "leave them alone": solve_scale (default 8) downsamples the solve because the correction field is smooth - 8 is plenty and fast, lower is just slower for no visible gain - and iterations (default 800) is how far the field spreads from the boundary. wrap_horizontal should stay on; equirect panoramas wrap left/right, and the correction needs to be continuous across that seam.

Outputs are the harmonized image and a correction_field visualization, which shows you the field as a color map - handy for debugging when the step won't die.

Wiring it in

The chain is: Warp → outpaint pass → Harmonize Boundary. Your sampled result goes in image, the Warp's control_video into plate, the Warp's inpaint_mask into inpaint_mask, and out comes the cleaned pano. If the node ever logs "no known region" and passes the image through untouched, your mask polarity is wrong - the inpaint_mask should be white where the generation happened, black where the photo is.

Install is the pack-wide one: ComfyUI Manager, search "Mickmumpitz", or

cd ComfyUI/custom_nodes && git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git

then restart. No models, no extra deps - numpy, Pillow and opencv-python are all it needs. You'll find it under Mickmumpitz/Panorama as "Harmonize Boundary".

CategoryMickmumpitz/Panorama

Inputs (7)

NameTypeDefaultDescription
imageIMAGEThe outpainted panorama (generated surroundings).
plateIMAGEThe ERP canvas from the Warp node (control_video) - your photo placed on the sphere.
inpaint_maskMASKinpaint_mask from the Warp node. White = hole to generate, black = your photo.
strengthFLOAT1.000–11.0 = generated side meets the plate exactly at the boundary. Lower keeps more of the generated look at the cost of a visible step.
solve_scaleoptINT81–32Downsample factor for the solve. The correction field is smooth, so 8 is plenty and fast. Lower = slower, no visible gain.
iterationsoptINT80050–20000Relaxation steps. More = the field spreads further from the boundary. 800 at scale 8 covers a 2048x1024 pano.
wrap_horizontaloptBOOLEANtrueEquirect panoramas wrap left/right - keep this on so the correction is continuous across the seam.

Outputs (2)

NameTypeDescription
imageIMAGE
correction_fieldIMAGE