ComfyUI Node

SMC Affine Profile

21 knobs for the affine correction path, all in one box.

By xmarre·Created 7 months ago·Updated 7 months ago· 0
SMC Affine Profile
    • profile
    • profile_json
    ◄stable_sigma8.0►
    ◄detail_sigma8.0►
    ◄boundary_feather_px18.0►
    ◄interior_power1.35►
    ◄geometry_strength1.00►
    ◄translate_strength1.00►
    ◄max_shrink0.050►
    ◄max_expand0.000►
    ◄anisotropy0.20►
    ◄mean_strength1.00►
    ◄contrast_strength0.85►
    ◄chroma_strength0.95►
    ◄anchor_pull0.18►
    ◄compaction_to_chroma0.22►
    ◄detail_retain1.00►
    ◄mask_global_strength1.00►
    ◄boundary_tether0.35►
    ◄assume_srgbtrue►
    ◄blend_back_to_targettrue►

    SMC Affine Profile (class SMCAffineProfile) is the settings object for the pack's affine/diagnostic correction path. It doesn't process an image - it builds an SMC_PROFILE dict with 21 parameters that the affine compand nodes and the Impact Pack hook read. Think of it as the older, more explicit cousin of SMC Config: same idea (a config object), but for the path that estimates actual scale/translation drift instead of the anchor-guided radial flow.

    It's genuinely a lot of knobs, and you will not touch most of them. Here's the honest breakdown.

    The ones that actually matter

    • geometry_strength (0–2, default 1.0) - how much of the estimated drift to apply as geometry correction. Your master dial.
    • max_shrink (0–0.25, default 0.05) and max_expand (0–0.25, default 0) - safety caps. Defaults mean "shrink up to 5%, never expand" - the correction is allowed to pull content inward but never blow it up. If you want the affine path to also undo an over-tight crop, you'd have to raise max_expand.
    • anchor_pull (0–1, default 0.18) - how much of the anchor's actual colors get blended into the corrected low-frequency result. The "trust the reference" dial.
    • contrast_strength (default 0.85) and chroma_strength (default 0.95) - how hard tone and color are pulled toward the anchor's statistics.
    • boundary_tether (0–1, default 0.35) - keeps the mask's boundary ring glued to the original's low-frequency content, so the corrected region doesn't visibly separate from the frame. If you see seams, this is a knob to raise.
    • assume_srgb (default true) - the node converts sRGB→linear→Oklab for the color work. Keep it true unless your pipeline is already linear.
    • blend_back_to_target (default true) - if on, the corrected pixels are pasted back only inside the mask so the outside stays untouched.

    The rest

    stable_sigma (8) and detail_sigma (8) control the Gaussian blur used for drift estimation and the detail re-add; boundary_feather_px (18) and interior_power (1.35) shape the interior weighting; translate_strength (1), anisotropy (0.2), mean_strength (1), compaction_to_chroma (0.22), detail_retain (1), and mask_global_strength (1) are the fine-grained versions of the ideas above. Leave them alone until something specific misbehaves.

    Outputs

    • profile (SMC_PROFILE) - wire into SMC Affine Compand's profile port, or the profile input of the self-anchor hook providers.
    • profile_json - the same dict as pretty-printed JSON, for reading or saving.

    If you don't connect a profile anywhere, the affine nodes fall back to these defaults internally - so the profile is only mandatory when you want something other than defaults.

    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 trap with 21 knobs is convincing yourself each one needs attention - the defaults are well-chosen for the FLUX.2 drift case, so change two or three at a time and use profile_json to record what you settled on.

    CategoryStableManifoldCompand/Affine

    Inputs (19)

    NameTypeDefaultDescription
    stable_sigmaFLOAT8.00–64—
    detail_sigmaFLOAT8.00–64—
    boundary_feather_pxFLOAT18.00–256—
    interior_powerFLOAT1.350.1–8—
    geometry_strengthFLOAT1.000–2—
    translate_strengthFLOAT1.000–2—
    max_shrinkFLOAT0.0500–0.25—
    max_expandFLOAT0.0000–0.25—
    anisotropyFLOAT0.200–1—
    mean_strengthFLOAT1.000–2—
    contrast_strengthFLOAT0.850–2—
    chroma_strengthFLOAT0.950–2—
    anchor_pullFLOAT0.180–1—
    compaction_to_chromaFLOAT0.220–1—
    detail_retainFLOAT1.000–2—
    mask_global_strengthFLOAT1.000–1—
    boundary_tetherFLOAT0.350–1—
    assume_srgbBOOLEANtrue—
    blend_back_to_targetBOOLEANtrue—

    Outputs (2)

    NameTypeDescription
    profileSMC_PROFILE—
    profile_jsonSTRING—