SVG File Saver
The node that gets your vector out of ComfyUI and into the real world
- file_path
Every other node in this pack produces an SVG string - a blob of text that only exists inside your graph. SVG File Saver is the exit door: it writes that string to an actual .svg file on disk, which is the moment your vectorized line art becomes something a laser cutter, a plotter, Inkscape, or Illustrator can actually open. If you want a real, shareable, editable vector file at the end of your workflow, this is the node.
Inputs
Three required, all simple:
svg_string- the SVG from Centerline to SVG or any editor node.filename_prefix- the base name, defaultcenterline.output_path- where to write, defaultoutput/svg(relative to ComfyUI's working directory, so it lands under ComfyUI's output tree).
Two optional toggles give you control over the collision case:
auto_timestamp(default on) - appends a timestamp to the filename so repeated runs don't stomp each other.overwrite(default off) - when on, deliberately replaces an existing file with the same name.
Output: file_path, a STRING with the absolute path to what you just wrote. Wire it to a text/display node if you want to see where the file went - or just log it in the console.
Why save files at all when there's SVG To Image?
Because SVG To Image is deliberately basic. It renders simple paths with Pillow so you can preview and recycle inside the graph, but it won't do gradients, filters, or fancy path syntax - and it's not what you'd engrave anything from. The README's stated workflow for high-quality output is: save with this node, then render in Inkscape / Illustrator / your browser. A saved .svg is also infinitely editable downstream - you can open it, recolor it, ungroup it, and nobody will ever know it started life in a diffusion model. This node is how "line art → vector" stops being a party trick and becomes a deliverable.
Install
It's part of the pack - there's no standalone install:
cd ComfyUI/custom_nodes
git clone https://github.com/TJ16th/TJ_ComfyUI_Lineart2Vector.git
# restart ComfyUI
or ComfyUI Manager → search TJ_ComfyUI_Lineart2Vector. No model downloads, no API keys. The requirements.txt list (numpy, Pillow, opencv-python, opencv-contrib-python, scikit-image, scipy, torch) is nearly all stock ComfyUI, so a bare clone usually just works.
Where people get burned
- "Where did my file go?" -
output/svgis relative to the ComfyUI working directory, and on portable installs that's inside the portable folder, not your desktop. Read thefile_pathoutput - it's the source of truth. - Silent overwrite surprises - with
auto_timestampon, you'll get a pile ofcenterline_<timestamp>.svgfiles, which is fine for batching but confusing if you expected one file. Turn it off and setoverwriteon when you want a stable filename. - Writing an empty SVG - the saver is a dumb writer: if the
svg_stringinput is empty or the upstream node produced garbage, you get an empty file and no error. Checksvg_stringis actually populated (SVG To Image or SVG Group Layout are good spot-checkers) before you blame the saver.
For production, the flow that works: vectorize → clean up paths → style → auto-reorder with renumbering so your layers are predictable → save here. Then open the result in a real editor and marvel that it's not a PNG anymore.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| svg_string | STRING | — | |
| filename_prefix | STRING | centerline | — |
| output_path | STRING | output/svg | — |
| auto_timestampopt | BOOLEAN | true | — |
| overwriteopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |