Nodes/comfyui_bmab/BMAB Reframe
ComfyUI Node

BMAB Reframe

Change the aspect ratio without cropping anything out

By portu-sim·Created 2 years ago·Updated 8 months ago· 124
BMAB Reframe
  • image
  • image
ratio
dilation32
step8
iteration4
prompt

The ordinary way to turn a square image into a 9:16 one is to crop - pick a side, lose whatever was there. Reframe does the opposite: it extends the canvas outward until it hits your target ratio, and generatively fills the new area so nothing from the original gets thrown away. It's outpainting, packaged as a one-node "pick a ratio and go" tool instead of the usual manual dance of padding a canvas, painting a mask, and running an inpaint pass yourself. The README shows this feature under a slightly different name ("BMAB Outpaint By Ratio"), which is the clearer description of what it actually does.

How it works

Canvas extension is conceptually identical to inpainting - the original image is the "keep this exactly as-is" region, and the newly added border is the mask. Where a manual outpaint workflow asks you to decide mask overlap, blur, and how many passes to run, Reframe bakes those decisions into three parameters: dilation controls how the mask edge is expanded before filling (more dilation, more blending room at the seam), step governs the increment the fill advances by, and iteration runs the extension in multiple passes rather than one large jump - the same reasoning the community converged on for outpainting generally, where "generous mask overlap and multiple passes with decreasing denoising" is the standard fix for the classic pasted-on seam. ratio sets the target aspect (1:1 through 16:9), and prompt describes what should appear in the new area - which matters more here than in most fill nodes, since a wide margin of blank canvas gives a generative model a lot of room to invent something that doesn't match the original's context if you leave the prompt too vague.

The inputs and outputs that matter

  • image (required) - your source, unchanged in the final composite.
  • ratio (enum: 1:1, 4:5, 2:3, 9:16, 5:4, 3:2, 16:9, required) - the target aspect ratio to reframe into.
  • dilation (default 32, 4–128) - mask edge expansion at the seam.
  • step (default 8, 4–128) - increment per extension pass.
  • iteration (default 4, 1–8) - how many passes the extension runs.
  • prompt (multiline, required) - describe the environment the extension should continue, not just "more of the same" - the more specific, the less likely you get an obvious seam of invented content.
  • Output: image - the reframed result.

How to install it

ComfyUI Manager: search comfyui_bmab. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/portu-sim/comfyui_bmab.git
cd comfyui_bmab
pip install -r requirements.txt

Companion packs per the README: Fannovel16/comfyui_controlnet_aux and cubiq/ComfyUI_IPAdapter_plus, both already in ComfyICU's shared image.

Common issues & troubleshooting

The extended area looks obviously "pasted on." This is the single most common outpainting complaint across the whole ecosystem, and the fixes are the same ones that apply everywhere: raise dilation for more blending room, and don't be afraid of more iteration passes rather than trying to force it in one.

The new content doesn't match the original's lighting or setting. Your prompt is doing less work than it needs to. Describe the scene the original is in, not just what's missing - "same overcast lighting, continuing the gravel path" beats a bare style tag.

A tall ratio like 9:16 from a wide source looks stretched or thin in the extended area. Extreme ratio changes ask the model to invent a lot of new canvas relative to what you started with; expect more iterations to be needed the further your target ratio is from your source's.

CategoryBMAB/fill

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
ratioCOMBO7 options: 1:1, 4:5, 2:3, 9:16, 5:4, 3:2, +1
dilationINT324–128
stepINT84–128
iterationINT41–8
promptSTRING

Outputs (1)

NameTypeDescription
imageIMAGE