Nodes/ComfyUI_SVG-Suite/SVG Optimize Presets
ComfyUI Node

SVG Optimize Presets

Four optimization buttons — zero configuration required

By MushroomFleet·Created about a year ago·Updated 5 months ago· 9
SVG Optimize Presets
    • STRING
    ◄svg_string—►
    â—„presetdefaultâ–º

    SVG Optimize Presets is the answer to the question everyone asks the first time they look at SVG Optimize (Scour)'s fifteen toggles: "do I have to understand all of these?" No. This node reduces the whole Scour configuration to four presets, and for most people the answer is "default, and occasionally maximum."

    The four presets

    • default - minimal, safe changes. It runs Scour with stock options: whitespace cleanup and the like. The "won't break anything" choice.
    • better - adds viewboxing (enable_viewboxing). The README calls this out as compatibility for older browsers, which is a bit of a legacy concern in 2026, but viewboxing genuinely helps scaling behavior in some renderers.
    • maximum - the aggressive one: viewboxing, ID stripping, comment stripping, shortened IDs, removed metadata, stripped XML prolog, simplified colors. This is where most of your real savings come from.
    • compressed - maximum, plus the last drop of whitespace/formatting removal. It's "maximum" for people who want to be sure.

    One input, svg_string plus the preset dropdown, one STRING output. That's the entire node.

    How it works

    Under the hood it's the same Scour machinery as SVG Optimize (Scour) - each preset is just a bundle of Scour options. That means it inherits Scour's behavior and its one big gotcha: Scour can occasionally change your SVG in ways you didn't intend (ID stripping can break references if you're not careful, and aggressive color simplification can alter exact hex values). The presets are conservative in intent, but maximum and compressed do real surgery on your markup.

    Install

    Pack standard:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/svg-suite
    pip install -r requirements.txt
    

    Restart ComfyUI, or via Manager under "svg-suite". Requires Scour from the requirements - if it's missing, the node prints an error and returns your SVG unchanged, so a missing dependency looks exactly like a broken node.

    Where people get burned

    The silent-return problem again: no Scour, no error dialog, just your original SVG back. First troubleshooting step is always "did Scour install?"

    Second, don't treat compressed as strictly better than maximum. For a logo you'll keep editing, ID stripping and aggressive simplification can make downstream editing a headache - you lose the handles you were going to select against. The README's own workflow runs compression and optimization as the last step before save for exactly that reason: optimize after you're done editing, not before. For interactive use, default is the one you actually reach for; maximum/compressed are for the final export. And if a preset does something you don't like and you can't tell which toggle caused it, that's what SVG Optimize (Scour) with full controls is for.

    Category💎TOSVG/Advanced

    Inputs (2)

    NameTypeDefaultDescription
    svg_stringSTRING—
    presetCOMBOdefault4 options: default, better, maximum, compressed

    Outputs (1)

    NameTypeDescription
    STRINGSTRING—