Nodes/ComfyUI-StableManifoldCompander/SMC Affine Anchor Resize
ComfyUI Node

SMC Affine Anchor Resize

Build the affine path's low-res anchor, down to the pixel.

By xmarre·Created 6 months ago·Updated 6 months ago· 0
SMC Affine Anchor Resize
  • image
  • anchor_image
  • width
  • height
  • megapixels
target_megapixels1.00
multiple_of16
upscale_modebilinear

SMC Affine Anchor Resize (class SMCAffineAnchorResize) is the anchor factory for the affine/diagnostic path. It resizes an image to a target megapixel count - rounding dimensions to a multiple and choosing the interpolation - then hands you the resized anchor plus its width, height, and actual megapixels. In other words: this is SMC Make Anchor, but for the affine workflow, with a wider megapixel range and fewer frills.

The affine path needs a low-res anchor because that's what the drift estimate compares against - the "stable" version of the image that hasn't been pushed past the model's comfortable resolution. Feed the anchor from this node into SMC Affine Estimate Drift or SMC Affine Compand's anchor_image port and the correction has something concrete to pull toward. The affine nodes actually auto-resize whatever anchor you give them to match the target, so this node isn't strictly required - it exists for when you want to choose the anchor resolution deliberately and see the resulting numbers, rather than trusting whatever the correction node does internally.

Inputs

  • image - the source (usually the pre-detail version of the crop, or the full frame at a stable resolution).
  • target_megapixels (0.01–32, default 1.0) - the target size. The wide range is the main difference from the anchor-guided path's target_mp (which caps at 4); here you can go all the way down to 0.01MP for a genuinely coarse diagnostic anchor.
  • multiple_of (1–256, default 16) - dimensions round to a multiple of this. Keep 16 unless you're building a custom-res pipeline.
  • upscale_mode - bilinear (default) or bicubic. Since the whole point is producing a low-res anchor, this actually only matters if your target_megapixels is above the source's current resolution - which is backwards for an anchor, so you'll almost never change it.

Outputs

  • anchor_image - the resized image.
  • width, height (INT) - the rounded dimensions.
  • megapixels (FLOAT) - the real megapixel count after rounding, so you can verify the rounding didn't push you off-target.

Install & gotchas

Same pack, trivial install:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-StableManifoldCompander

or ComfyUI Manager (search "Stable Manifold Compander"). No extra dependencies. The naming trap: this node and SMC Make Anchor look like the same job with different names, and they are cousins, but they're wired for different paths - Make Anchor feeds the anchor-guided SMC Compand, this one feeds the affine nodes. Don't swap them blindly, and don't confuse this with the backward-compat alias Stable Manifold Anchor Resize, which is literally the same node under an old name.

CategoryStableManifoldCompand/Affine

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
target_megapixelsFLOAT1.000.01–32
multiple_ofINT161–256
upscale_modeCOMBObilinear2 options: bilinear, bicubic

Outputs (4)

NameTypeDescription
anchor_imageIMAGE
widthINT
heightINT
megapixelsFLOAT