Nodes/comfyui_bmab/BMAB Resize By Ratio
ComfyUI Node

BMAB Resize By Ratio

The same framing engine, without needing a person

By portu-sim·Created 2 years ago·Updated 8 months ago· 124
BMAB Resize By Ratio
  • bind
  • image
  • BMAB bind
  • image
steps20
cfg_scale8.0
sampler_name
scheduler
denoise0.50
method
alignment
ratio0.85
dilation30

This node's info_schema is nearly identical to BMAB Resize By Person - same steps/cfg_scale/sampler_name/scheduler/denoise sampling controls, same method choice between stretching, inpaint, and inpaint+lama, same alignment and ratio/dilation pair. The difference the naming implies is the detection step: Resize By Person finds a subject via Grounding DINO and frames around them specifically; Resize By Ratio applies the same fill/alignment machinery to the image as a whole, without needing to locate a person first. Worth being upfront that neither node is documented in detail in the README, so that distinction is the reasonable inference from the naming and shared schema rather than something spelled out explicitly - if your source image has no clear single subject (a landscape, a texture, a group shot where "the person" is ambiguous), this is the one to reach for.

How it works

ratio (default 0.85) and alignment (9 options: bottom, top, center, corners, edges) work the same way conceptually as on Resize By Person - ratio sets how much of the target canvas your content should occupy, alignment decides which edge the framing anchors to. dilation pads the working region before the fill math runs. The fill itself runs through method: stretching for a fast, distortion-tolerant resize, inpaint for a real diffusion pass using steps/cfg_scale/sampler_name/scheduler/denoise, or inpaint+lama for a LaMa structural pre-pass followed by diffusion refinement - the same three-way choice as its sibling node, and the same reasoning applies: try inpaint+lama first if plain inpaint leaves a visible seam.

Both sampler_name and scheduler include a "Use same sampler" / "Use same scheduler" entry at the top of their option lists, letting this node inherit whatever's already configured on your main KSampler instead of duplicating settings across two nodes that need to stay in sync.

The inputs and outputs that matter

  • bind (required) - the BMAB pipeline object this node samples through.
  • ratio (default 0.85, 0.1–0.95), alignment, method, dilation (default 30, 4–128) - the framing and fill controls.
  • steps, cfg_scale, sampler_name, scheduler, denoise - active when method involves inpainting.
  • Optional image - a direct source if not already carried on the bind.
  • Outputs: BMAB bind and image.

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

Plus the README's two companion packs, Fannovel16/comfyui_controlnet_aux and cubiq/ComfyUI_IPAdapter_plus - already bundled in ComfyICU's shared image.

Common issues & troubleshooting

Unsure whether to use this or Resize By Person. If your image has one clear human subject you want the crop to respect, use Resize By Person and let its detection step do the work. If your source is a scene, a texture, or anything without a single obvious subject, this node's simpler ratio-and-alignment approach avoids relying on a detector that has nothing reliable to find.

A visible seam at the edge of the fill. Same fix as the sibling node: try inpaint+lama over plain inpaint first, and raise dilation a bit for more blending room before assuming you need a different denoise value.

stretching distorts a subject noticeably. That trade-off is inherent to the method - it's the cheapest option precisely because it doesn't generate new content, it warps the existing pixels to fit. If distortion is visible and unacceptable, switch to inpaint or inpaint+lama instead.

CategoryBMAB/resize

Inputs (11)

NameTypeDefaultDescription
bindBMAB bind
stepsINT200–10000
cfg_scaleFLOAT8.00–100
sampler_nameCOMBO45 options: Use same sampler, euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, +39
schedulerCOMBO10 options: Use same scheduler, simple, sgm_uniform, karras, exponential, ddim_uniform, +4
denoiseFLOAT0.500–1
methodCOMBO3 options: stretching, inpaint, inpaint+lama
alignmentCOMBO9 options: bottom, top, top-right, right, bottom-right, bottom-left, +3
ratioFLOAT0.850.1–0.95
dilationINT304–128
imageoptIMAGE

Outputs (2)

NameTypeDescription
BMAB bindBMAB bind
imageIMAGE