Nodes/ComfyUI/Save SVG
ComfyUI Node Runs on cloud

Save SVG

Vector output for a raster world

By Comfy-Org·Created 4 years ago·Updated about 17 hours ago· 130,493
Save SVG
  • svg
  • svg
filename_prefixsvg/ComfyUI

Almost everything in ComfyUI is pixels, but not everything has to stay that way. Save SVG writes a vector .svg file to disk instead of a raster PNG - the node you reach for when your graph is producing actual vector graphics (SVG type outputs) rather than images, and you want the result saved as a real, scalable, editable vector file. It's a specialist node in a mostly-raster ecosystem, and it's refreshingly straightforward about what it does.

What it is

Two inputs, one output. svg is the vector content - an input of the core SVG type, so you wire it to whatever node in your graph produces SVG data (vector generators, shape builders - anything that emits the SVG type rather than an IMAGE tensor). filename_prefix defaults to svg/ComfyUI, which is a small hint that the intended destination is a svg/ subfolder of your output directory. The svg output passes the content through, so you can save the file and keep feeding the same vector downstream.

The mechanism: it writes the SVG bytes to disk as <prefix>_00001_.svg with the same auto-incrementing counter and %date% / %node.widget% prefix formatting as every other save node. One detail worth knowing: it also injects the workflow metadata into the file - the source does a regex pass to insert a metadata comment right after the opening <svg> tag, so your saved SVG carries the graph that produced it, in the same spirit as Save Image embedding the workflow in PNGs. That's a genuinely nice touch for a format people assume is too plain for metadata.

When you'd use it

Vector output is a niche in the diffusion world - most pipelines are inherently raster, and the SVG type is a specific lane rather than a general one. You reach for this node when:

  • Your graph produces true vector content and you need it as an editable .svg for a design tool, a plotter, a web asset, or a project that demands scalable graphics (logos, icons, anything that must survive being blown up to billboard size).
  • You're building a workflow that ends in vector files and you want the same saving conveniences - folders, date tokens, auto-increment - that the raster save nodes give you.

If your workflow never touches the SVG type, you don't need this node, and that's fine. It's not competing with Save Image; it's the end-of-line for a different kind of data entirely.

Getting it and where it goes wrong

It ships with ComfyUI core, part of the newer node system in comfy_extras/nodes_images.py - no install, no model files. Gotchas:

  1. Type mismatch is the main stumble. This node does not take an IMAGE. Try to feed it a raster image tensor and it'll refuse - you need actual SVG data from an SVG-typed output. If you're trying to save raster images as something other than PNG, you want Save Image (Advanced) with its format options, not this.
  2. It's a save node, not a converter. Nothing here rasterizes or vectorizes; it writes what it's given. Don't expect a PNG to come out the other side.
  3. The default prefix puts files in output/svg/. That's a deliberate organizational choice - keep it or change it, but know the files aren't landing loose in output/ root.

A quiet, purpose-built node for a narrow lane - and for anyone working with vector output in ComfyUI, it's the missing "just save it" piece.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
svgSVG
filename_prefixSTRINGsvg/ComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.

Outputs (1)

NameTypeDescription
svgSVG