Nodes/Muffins Flat 2 Panoramic/Perspective -> Panorama (Small Mask, No Resize)
ComfyUI Node

Perspective -> Panorama (Small Mask, No Resize)

A projection-scale dial that shrinks the outpaint mask, no crop needed

By Ragamuffin20·Created 5 months ago·Updated about a month ago· 19
Perspective -> Panorama (Small Mask, No Resize)
  • images
  • panorama_images
  • mask
  • info
roll0.00
pitch0.00
vfov60.00
auto_canvasfalse
canvas_scale1.50
pano_width2048
pano_height1024
projection_scale0.70

Projecting a perspective image onto a panorama canvas has a built-in annoyance: your source covers only the middle of the canvas, and everything around it is hole that has to be outpainted. The bigger the hole, the more the model has to invent and the worse the result gets. This node's answer is a single dial - projection_scale - that makes your source fill more of the canvas so the mask is smaller, and it does it by changing the projection's effective focal length rather than by cropping and resizing. No geometry gets lost, no upscaling artifacts; the source just occupies more of the frame.

It's one of the Muffins-Flat-2-Panoramic pack's perspective helpers, and it's the "no-resize" variant of the earlier generation: where the NoBlack sibling shrinks its mask by tight-cropping the output and resizing back, this one leaves the output canvas alone and shrinks the mask at the source. Both solve the same "hole too big" problem by different means.

How it works

Same bones as the other perspective nodes: a direction grid across the panorama canvas, rotated by roll/pitch, projected back through a pinhole camera model where the focal length comes from your image height and vfov. The twist is the projection_scale multiplier on that focal length:

  • Below 1.0 (default 0.7) - shorter effective focal length, so more panorama directions land inside your source image. The content fills more of the canvas and the hole/mask shrinks.
  • Above 1.0 - longer focal length, content appears smaller, and the mask grows. Mostly useful if you accidentally over-shrunk and want to back off.

Sampling uses a proper bilinear grid sample with zero padding, so out-of-bounds areas come out black - which is exactly what your mask describes for the outpaint pass.

Inputs you'll touch

  • projection_scale (default 0.7) - the star of the show. Lower it to shrink the mask, watch the content grow.
  • vfov, roll, pitch - the projection's lens width and view orientation, same as its siblings.
  • pano_width / pano_height - the 2:1 default (2048×1024) matches a 360-style panorama; unlike the 180 sibling this one doesn't force square, so you get the wider canvas.
  • auto_canvas / canvas_scale - derive output size from the input instead of setting it manually.

Outputs: panorama_images, mask (white = area to outpaint), and an info string that helpfully spells out "lower = bigger center, smaller mask" so you don't have to remember the direction.

The trade to know about

Making the source fill more of the canvas means the center content is zoomed in relative to the final panorama - you're trading a smaller outpaint region for a tighter view of the original. For a source where the important stuff is central, that's usually the right deal: the model has less to invent and the original stays crisp. If your source is wide and you want to keep the whole scene, you may prefer less shrink. The info string and a quick preview make it a one-run experiment either way.

Install

Same single pack, same trivial dependencies - requirements.txt is just numpy, no models to fetch. 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. It batch-processes frames, so a whole clip gets the same projection and mask, and because it never resizes the source, the original pixels keep their fidelity through the pipeline.

Categoryvideo/utils

Inputs (9)

NameTypeDefaultDescription
imagesIMAGE
rollFLOAT0.00-180–180
pitchFLOAT0.00-89.9–89.9
vfovFLOAT60.001–179
auto_canvasBOOLEANfalse
canvas_scaleFLOAT1.501–4
pano_widthINT2048256–16384
pano_heightINT1024256–16384
projection_scaleFLOAT0.700.2–2

Outputs (3)

NameTypeDescription
panorama_imagesIMAGE
maskMASK
infoSTRING