Nodes/ComfyUI-StableManifoldCompander/Stable Manifold Compand
ComfyUI Node

Stable Manifold Compand

The old name for SMC Affine Compand. Same correction, two labels.

By xmarre·Created 6 months ago·Updated 6 months ago· 0
Stable Manifold Compand
  • anchor_image
  • target_image
  • mask
  • original_image
  • profile
  • corrected
  • warped_target
  • diagnostics
  • stats_json

Stable Manifold Compand (class StableManifoldCompand) is the backward-compatibility alias for SMC Affine Compand. In the pack's nodes.py, both class names point at the same node class - so if your saved workflow references StableManifoldCompand, you're already running the affine correction path, just under the earlier "Stable Manifold" name.

The story is the pack's own reorganization: the affine/profile nodes shipped first with the "Stable Manifold" prefix, and when the author reorganized the pack under the SMC prefix and added the newer anchor-guided path, the old class names stayed registered as aliases so existing workflows wouldn't silently break. The comment in the source is blunt about it: "Backward-compat aliases from the earlier pack." Same node, new label - nothing else changed.

What it actually does

Everything described in the SMC Affine Compand article applies verbatim:

  • anchor_image + target_image required; optional mask, original_image, and profile.
  • Outputs: corrected, warped_target, diagnostics, stats_json.

In short: it blurs both images, fits an affine (scale + translation) that maps the target's structure onto the anchor's, warps the target inward along it (clamped so it never expands beyond max_expand), restores low-frequency color in Oklab toward the anchor, re-adds detail, and pastes back inside the mask. The diagnostics panel - anchor | target | corrected | heatmap - is the reason people reach for this path over the anchor-guided one: it shows you exactly where pixels moved.

Which one should you use?

If you're building fresh, use the SMC-prefixed name; that's the current convention and where new examples and docs point. If a shared workflow references StableManifoldCompand, leave it be - it runs the same code. The only real downside of the alias is confusion: seeing both names in the node list, you might think one is newer or better. It isn't. And don't mistake it for SMC Anchor-Guided Compand (SMCCompand), which is the newer primary workflow node with a different mechanism - that one derives a radial flow from the mask and needs an SMC_CONFIG; this one fits an affine and takes an explicit anchor.

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 one gotcha carries over from the affine path: max_expand defaults to 0, so the correction will never grow content - if things look shrunken, lower geometry_strength rather than fighting the clamp.

CategoryStableManifoldCompand/Affine

Inputs (5)

NameTypeDefaultDescription
anchor_imageIMAGE
target_imageIMAGE
maskoptMASK
original_imageoptIMAGE
profileoptSMC_PROFILE

Outputs (4)

NameTypeDescription
correctedIMAGE
warped_targetIMAGE
diagnosticsIMAGE
stats_jsonSTRING