Nodes/camera-comfyUI/ReprojectImage
ComfyUI Node

ReprojectImage

The node that converts between pinhole, fisheye, and equirectangular — and moves your camera

By Alexankharin·Created about a year ago·Updated about a month ago· 36
ReprojectImage
  • image
  • mask
  • transform_matrix
  • reprojected image
  • reprojected mask
input_horiszontal_fov90
output_horiszontal_fov90
input_projection
output_projection
output_width0
output_height0
inversefalse
feathering40

This is the node that started the pack, honestly. ReprojectImage takes any image and remaps it between the three camera projection models the pack supports - PINHOLE, FISHEYE, and EQUIRECTANGULAR - while optionally applying a 4×4 camera transform to rotate or move the view. If you've ever stared at a 360° equirectangular panorama and wondered what it would look like through a normal camera lens, or wished a fisheye view covered a wider field, this is the tool. It's the geometric heart that every other node in camera-comfyUI leans on - OutpaintAnyProjection, the point cloud pipeline, and the stereo workflow all call it internally.

The mental model: you're re-sampling the image as if seen through a different lens, from a possibly different angle. A pinhole image is a flat rectangle with a single field of view; a fisheye is a circular projection with extreme distortion at the edges; an equirectangular maps longitude/latitude onto a 2:1 rectangle (your classic 360° panorama). ReprojectImage moves pixels between those coordinate systems and tells you, via a mask, which output pixels had real source data and which are holes.

The inputs that matter

  • image - the source, [B,H,W,C].
  • input_projection / output_projection - pick from PINHOLE / FISHEYE / EQUIRECTANGULAR. The single most important choice you'll make.
  • input_horiszontal_fov / output_horiszontal_fov - note the pack's spelling; it's how wide each view is, in degrees. Going pinhole → equirectangular with a 360° output fov is the classic "unfold to panorama" move.
  • output_width / output_height - 0 means "keep the input size"; otherwise set the target resolution.
  • feathering - how many pixels to feather the mask edges (default 40), so seams blend instead of hard-cutting when you composite.
  • transform_matrix - an optional MAT_4X4 camera transform. Feed it a rotation and you've panned the view before reprojecting.
  • inverse - invert that matrix (camera-to-world instead of world-to-camera), useful when a pipeline hands you poses in the other convention.
  • mask - optional; pass your own mask and it gets reprojected with the image.

What comes out

Two outputs: reprojected image (BHWC) and reprojected mask (HW), where 1.0 means "this pixel has valid source data." That mask is your honesty signal - when you're outpainting or stitching, it tells you exactly where the geometry has holes that need filling. For FISHEYE output the node also applies a circular mask so the rounded lens shape is respected.

How it works

Internally it builds a sampling grid: for every output pixel, it computes where that ray came from in the input image (through the projection math, with your transform applied) and samples with grid_sample. A border of transparent pixels around the input means anything sampling outside the source comes back as a hole rather than a smear.

Installing it

It's in camera-comfyUI. Manager → Custom Nodes Manager → search camera-comfyUI → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Alexankharin/camera-comfyUI.git
cd camera-comfyUI && python install.py

No optional dependencies needed for this node.

Common issues

  • Everything comes out stretched - you almost certainly have the input fov wrong. A pinhole image has a specific horizontal fov; guess wrong and the reprojection warps.
  • Black holes everywhere - the input projection doesn't cover the output field of view. Going pinhole 90° → equirectangular 360° will leave 75% empty unless you outpaint first. That's not a bug; that's the gap OutpaintAnyProjection exists to fill.
  • Typo in the field name - input_horiszontal_fov (with the stray "z") is intentional; that's what the schema calls it.
CategoryCamera/Reprojection

Inputs (11)

NameTypeDefaultDescription
imageIMAGE
input_horiszontal_fovFLOAT900–360
output_horiszontal_fovFLOAT900–360
input_projectionCOMBOinput projection type
output_projectionCOMBOoutput projection type
output_widthINT00–16384
output_heightINT00–16384
inverseBOOLEANfalse
featheringINT400–16384
maskoptMASK
transform_matrixoptMAT_4X4

Outputs (2)

NameTypeDescription
reprojected imageIMAGE
reprojected maskMASK