ComfyUI Node

Aspect 1:X

One image, every platform ratio — without the crop roulette

By criskb·Created 7 months ago·Updated 5 months ago· 0
Aspect 1:X
  • image
  • image_out
  • filename_labels
aspect_1xSocial - 9:16 (Stories/Reels/TikTok)
orientationPortrait
modepad
X • Offset0
Y • Offset0
PositionCenter • Center
filename_prefix_baseAX1
background_modeblur

If you've ever generated a hero image and then spent ten minutes trying to get an Instagram post, a YouTube thumbnail, and a Discord banner out of it, Aspect 1:X is the node that makes that a two-click job. It takes one image and reshapes it to any of 28 named aspect-ratio presets - social ratios like 9:16 stories, 4:5 Instagram portrait, 1:1 feed; photo formats like 3:2, 6:7 medium format, 65:24 XPan; and cinema ratios like 2.39:1 anamorphic and 1.43:1 IMAX. All the ratios an art director will actually ask for, pre-named so you don't have to remember that TikTok wants 9:16 and LinkedIn wants 1.91:1.

It's part of MKRShift Nodes, Cris K B's production-focused pack for ComfyUI. Pure layout math - no models, no downloads beyond the pack itself.

How it works

Give it an image, pick a preset, and it reshapes to that aspect ratio in one of two modes. pad fits the image inside the target frame and fills the leftover space - default is a blur of the source, which looks like an intentional cinematic background rather than a black bar (you can switch to black, white, or gray if you want something cleaner). crop scales the image up until it fills the frame and cuts away the overflow.

orientation (Portrait / Horizontal) matters because some presets flip meaning depending on it - 9:16 as a portrait is a story, as horizontal it's a wide strip. The Position dropdown (nine options from Top-Left to Bottom-Right) plus X • Offset / Y • Offset let you choose where the image sits inside the padded frame or where the crop window cuts - so you can keep a face out of the letterbox instead of letting the center crop mangle it.

The unsung output here is filename_labels: a STRING built from your filename_prefix_base (default "AX1"), the orientation, and the aspect slug. Wire it into a save node's filename and you get delivery-ready names like AX1_portrait_9x16.png for free - which is exactly the kind of thing that stops your final export folder from being "final_v3 (2) (copy)".png.

Outputs

  • image_out - the reshaped IMAGE, ready for a save or preview node
  • filename_labels - the formatted filename label for downstream naming

Installation

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart ComfyUI - or use ComfyUI Manager and search for "MKRShift Nodes." No requirements to pip-install for this node; the pack is dependency-light by design.

Common issues

The trap is mode selection plus blur background. pad with blur looks great on stills, but the blurred fill is a baked copy of the image - if you then run the whole thing through another generative pass, the fill pixels get processed like content. If you want a truly clean background for further generation, use crop or a flat color. And remember the offsets are in pixels on the reshaped canvas, so a large offset on a small image can push your subject fully into the blur. For "every platform at once" there's the sibling node Aspect 1:X Batch, which runs the whole preset list in one go - this one is for when you know exactly which ratio you need.

CategoryMKRShift Nodes/Core/Layout

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
aspect_1xCOMBOSocial - 9:16 (Stories/Reels/TikTok)28 options: Social - 9:16 (Stories/Reels/TikTok), Social - 4:5 (Instagram Portrait), Social - 1:1 (Square/Instagram Feed), Social - 1.91:1 (Facebook/LinkedIn Landscape), Social - 3:4 (Instagram Grid/Threads), Social - 19:6 (TikTok Wide-View/Landscape), +22
orientationCOMBOPortrait2 options: Portrait, Horizontal
modeCOMBOpad2 options: pad, crop
X • OffsetoptINT0-4096–4096
Y • OffsetoptINT0-4096–4096
PositionoptCOMBOCenter • Center9 options: Top • Left, Top • Center, Top • Right, Center • Left, Center • Center, Center • Right, +3
filename_prefix_baseoptSTRINGAX1
background_modeoptCOMBOblur4 options: black, blur, gray, white

Outputs (2)

NameTypeDescription
image_outIMAGE
filename_labelsSTRING