Nodes/ComfyUI-ToSVG/Save SVG String
ComfyUI Node

Save SVG String

Write an SVG string to disk, that's the whole job

By Yanick112·Created 2 years ago·Updated about a year ago· 314
Save SVG String
      ◄SVG_String—►
      â—„filename_prefixComfyUI_SVGâ–º
      â—„append_timestamptrueâ–º
      â—„custom_output_pathâ–º

      TS_SaveSVGString is the current name for the pack's save node - the one that used to be called SaveSVG before the June 17 rename. It's the terminal step of the whole pipeline, and its job fits in a sentence: take the SVG text a converter produced and write it to a real .svg file on disk. No image encoding, no re-rasterizing, just the markup you earned from the tracer, saved verbatim.

      That verbatim part matters more than it sounds. A lot of "vector" workflows in this space quietly rasterize at the save step and hand you a picture of an SVG. This node writes the actual text file, which means the output stays resolution-independent - scale it to a billboard or engrave it at tiny size and it stays crisp. If you're doing laser cutting, plotting, screen printing, or shipping files to a designer, that's the whole point.

      Inputs

      • SVG_String - the SVG markup. Straight from a converter node (TS_ImageToSVGStringBW_Vtracer, TS_ImageToSVGStringColor_Vtracer, TS_ImageToSVGStringBW_Potracer), or from TS_SVGPathSimplify if you're saving the cleaned-up version.
      • filename_prefix - default ComfyUI_SVG. The base filename.
      • append_timestamp - default on, so files get a YYYYMMDDHHMMSS suffix and never overwrite. Flip it off for a stable name.
      • custom_output_path - blank writes to ComfyUI's standard output folder; fill it to write anywhere you like. The directory is created if missing.

      It's an output node with no outputs - the side effect is the point. The UI reports the saved filename and full path after each run.

      Wiring it in

      Trivial by design: image → converter → this node. Because the VTracer converters emit one string per batch image, feeding a batch writes multiple files using your prefix. Preview first with TS_SVGStringPreview so you're not saving four versions of a bad trace.

      Install

      Same pack install as everything here. ComfyUI Manager → search ComfyUI-ToSVG → Install → restart, or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/Yanick112/ComfyUI-ToSVG/
      cd ComfyUI-ToSVG
      pip install -r requirements.txt
      

      Requirements: vtracer, numpy, Pillow, torch, PyMuPDF, potracer. No model downloads, no API keys, CPU-only. Minor ecosystem note: ComfyUI core also ships a Save SVG node, but it writes from the core SVG object type (a BytesIO wrapper), not from a plain string. This pack's nodes produce plain strings, so use this save node - or bridge the types with the pack's BytesIO nodes if you specifically want the core one.

      Category💎TOSVG/Tools

      Inputs (4)

      NameTypeDefaultDescription
      SVG_StringSTRING—
      filename_prefixSTRINGComfyUI_SVG—
      append_timestampoptBOOLEANtrue—
      custom_output_pathoptSTRING—

      Outputs (0)

      No outputs