Nodes/ComfyUI-DiT360Plus/Perspective → Equirect
ComfyUI Node

Perspective → Equirect

Put your edited photo back into the panorama without a visible patch seam

By thomashollier·Created 7 months ago·Updated 3 months ago· 3
Perspective → Equirect
  • perspective_image
  • equirect_image
  • projection_data
  • composited
  • mask
blend_pixels10

This node is the closing half of the pack's perspective-editing trick. EquirectToPersp pulled a distortion-free view out of your panorama so you could edit it with normal tools; PerspToEquirect takes that edited view, reprojects it back onto the sphere, and blends it in so the round trip leaves no visible scar. On its own it does nothing interesting. Paired with its counterpart, it's how you edit a region of a 360 image without the equirect distortion fighting you the whole way.

What it does

Where extraction was "place a camera in the sphere and render," composition is the inverse: for each pixel of the edited patch, figure out which equirect coordinates it came from (using the exact yaw/pitch/fov it was extracted with), resample it back, and feather-blend the result into the original panorama. The blend_pixels control sets how wide that feathered transition is - 0 is a hard cut, 10 (default) is a soft seam, and values up to 100 spread the transition further.

The inputs

  • perspective_image - the edited view (straight from EquirectToPersp's perspective, or after a Kontext edit).
  • equirect_image - the original panorama. Note it wants the original, not a modified version - that's why EquirectToPersp passes the panorama through as equirect_passthrough.
  • projection_data - the EQUIRECT_PROJECTION bundle from the extraction. This is not optional decoration; without it the node has no idea where the patch belongs. Use the data from the same extraction that produced the perspective view.
  • blend_pixels - feather width in pixels, 0–100.

The outputs are the composited IMAGE and a MASK showing exactly where the patch landed - handy for a sanity check or if you want to run a second pass on the same region.

The full workflow

This is the README's LatLong_persp_inpainting pattern, and it's the pack at its best:

Load Image (panorama) -> EquirectToPersp -> PreviewBridge (Impact Pack) -> Kontext Panorama Editor -> PerspToEquirect -> 360 Viewer
                              └──────────────── projection_data + passthrough ────────────────────┘

Aim the camera with yaw/pitch, extract, paint a mask on the clean view (PreviewBridge's MaskEditor), repaint with Kontext, and composite back. The result reads like you edited a normal photograph, because you did.

Where people get burned

  • The patch lands in the wrong place or looks warped. You swapped in projection_data from a different extraction, or changed yaw/pitch between extract and compose. The trio of inputs (edited view, original equirect, matching projection data) must all come from one extraction.
  • A visible seam around the patch. blend_pixels too low. But don't just max it out - a very wide feather can ghost the surrounding scene. Start at 10, tune to taste.
  • Feeding the edited panorama back in as equirect_image. If you pass a previously-modified panorama instead of the original passthrough, the compositor builds on top of an already-moved target and the patch doubles up. Original in, edited patch in, matching data in.

One honest caveat: this pair is pure geometry with no learned seam-fixing. For a perfect blend you still want mask_feather-style softening on the edit side, and the pack's 360 Edge Blender at the end if your edit sits near the horizontal seam.

CategoryDiT360Plus/projection

Inputs (4)

NameTypeDefaultDescription
perspective_imageIMAGEEdited perspective image (from Equirect→Perspective or after editing).
equirect_imageIMAGEOriginal equirectangular panorama (passthrough from Equirect→Perspective).
projection_dataEQUIRECT_PROJECTIONProjection parameters from the Equirect→Perspective node.
blend_pixelsINT100–100Edge feather width in pixels for smooth blending. 0 = hard edge.

Outputs (2)

NameTypeDescription
compositedIMAGE
maskMASK