ComfyUI Node

apply panoramic

The node that turns a square fisheye into something a VR headset can actually show

By Ragamuffin20·Created 5 months ago·Updated about a month ago· 19
apply panoramic
  • images
  • vr180_equirect
  • info
output_modevr180_equirect_1_1
use_input_sizetrue
output_height1024
fisheye_fov180.0
lens_modelequidistant
center_x0.500
center_y0.500
lens_radius0.980
yaw0.0
pitch0.0
roll0.0
fill_modeblack
horizontal_flipfalse
vertical_flipfalse

Every other node in this pack is preparation. This one is the payoff: it takes a frame that has been outpainted and warped into a fisheye-ish shape and produces an equirectangular image that an equirect/VR viewer will unwrap into a believable 180 or 360 scene. If the result doesn't come out of here looking right, none of the earlier steps mattered. The display name is deadpan - "apply panoramic" - but this is the node you're actually reaching for at the end of the Muffins-Flat-2-Panoramic pipeline.

It has two personalities, and the whole trick to using it is knowing which one you're talking to:

  • Square 1:1 fisheye → VR180. Feed it a square frame that contains a circular fisheye (think 180° lens), pick vr180_equirect_1_1, and it maps the fisheye circle onto a half-sphere equirectangular image.
  • Wide 2:1 → 360. Feed it a 2:1 input - 1024x512, 1536x768, 2048x1024 - with output_mode set to padded_360_equirect_2_1, and it applies the 360 prewarp path instead.

The mechanism, briefly

Both paths work by building a longitude/latitude grid over the output and sampling the input at the corresponding pixel. The fisheye path rotates that grid by your yaw/pitch/roll and runs each ray through a lens_model - equidistant (default), equisolid, orthographic, or stereographic - which describes how the lens maps angle to image radius; equidistant is the right default for most GoPro-style fisheyes, and you switch models when the circular image doesn't flatten out right. The 360 path is simpler: it resamples the wide source through a latitude curve (which the lens_model also shapes) and uses yaw for left/right rotation - pitch and roll are ignored there. What it does add is a pole-aware prewarp: horizontal detail is narrowed near the top and bottom of the output so that a viewer's equirectangular unwrap comes back flat. That pre-distortion is the thing that makes flat-outpainted content survive the trip into VR without smearing at the poles.

The inputs that matter

  • output_mode - the 180-vs-360 fork above. The single most important choice.
  • fisheye_fov (default 180) - the fisheye path only; leave it at 180 for a standard half-sphere lens.
  • lens_model, center_x, center_y, lens_radius - the fisheye path's calibration trio. center_x/center_y correct an off-center lens, lens_radius matches the actual circle radius inside your square frame (default 0.98).
  • yaw / pitch / roll - orientation correction; yaw also rotates 360 output left/right.
  • fill_mode - black (default) or edge, whether the area outside the fisheye circle becomes black or clamps to the edge.
  • horizontal_flip / vertical_flip - mirror fixes.

Output is vr180_equirect (the finished IMAGE batch) and info (a string with the exact path taken and all settings). The pack also ships a 360_180-video-viewer.html file you can open locally to eyeball the result before committing to a headset.

The gotcha that bites everyone

The 360 path only triggers if both conditions hold: output_mode is padded_360_equirect_2_1 and your input is genuinely wide (aspect ratio ≥ 1.5). Feed a 2:1 image with vr180_equirect_1_1 selected and the node quietly treats it as a fisheye - you'll get a stretched mess and no error message. Check info if the output looks wrong; it tells you which path ran.

Install

One lightweight repo, requirements.txt is just numpy, no model downloads. ComfyUI Manager: search "Muffins-Flat-2-Panoramic-node". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Ragamuffin20/Muffins-Flat-2-Panoramic-node.git
cd Muffins-Flat-2-Panoramic-node
python -m pip install -r requirements.txt

Restart ComfyUI. The author's shared workflows pair this with a video outpainting pass, and it batch-processes frames, so the whole clip converts in one run. Give info a glance on the first frame - it's the fastest way to confirm you hit the path you meant to hit.

Categoryvideo/utils

Inputs (15)

NameTypeDefaultDescription
imagesIMAGE
output_modeCOMBOvr180_equirect_1_12 options: vr180_equirect_1_1, padded_360_equirect_2_1
use_input_sizeBOOLEANtrue
output_heightINT1024256–8192
fisheye_fovFLOAT180.090–220
lens_modelCOMBOequidistant4 options: equidistant, equisolid, orthographic, stereographic
center_xFLOAT0.5000–1
center_yFLOAT0.5000–1
lens_radiusFLOAT0.9800.25–1.5
yawFLOAT0.0-180–180
pitchFLOAT0.0-90–90
rollFLOAT0.0-180–180
fill_modeCOMBOblack2 options: black, edge
horizontal_flipBOOLEANfalse
vertical_flipBOOLEANfalse

Outputs (2)

NameTypeDescription
vr180_equirectIMAGE
infoSTRING