Save SVG
Stop losing generated vectors to the void
- ui_widget
- svg
If you've ever had an LLM or a code node hand you a string full of <svg> tags and then watched it vanish into the widget, this is the node that fixes that. LF_SaveSVG takes SVG data from anywhere in your graph, writes it to disk as .svg files, and shows you what actually got saved in a little gallery widget on the node itself. It's the "save this thing" output node for the vector corner of your workflow - the sibling of the pack's View SVGs preview node.
It's part of lf-nodes, Luca Foscili's UX-first custom node suite. The whole pack leans on custom webcomponent widgets (the LF Widgets library) to make nodes feel less like raw sockets, and this one is a good example: instead of a text box telling you it saved, you get a masonry-style gallery of the files it wrote.
How it works
Feed it an SVG string and it does three things. First, it splits the input into individual <svg>...</svg> blocks using a simple regex, so one string containing three concatenated SVGs becomes three files rather than one mangled file. Then it writes each block to ComfyUI's output directory using the same path-resolution machinery the core Save Image node uses - which means counters, timestamp suffixes, and subfolder support all come along for free. Finally it fires the result back to a frontend gallery widget so you can eyeball each file without opening a browser tab.
The inputs that matter
Four inputs, and you mostly touch two of them:
- svg (STRING) - the SVG data. If your upstream node emits bytes or a dict with a
valuekey, it handles that too; it's forgiving on purpose. - filename_prefix (STRING) - path and filename. Slashes create subdirectories under
output, sologos/herowrites toComfyUI/output/logos/hero.svg. Leave it empty and it uses the default folder. - add_timestamp (BOOL, default true) - appends a date-time suffix so you don't get name collisions.
- add_counter (BOOL, default true) - appends
_1,_2, ... to avoid overwriting existing files. This is your safety net when you forget to change the prefix.
The one output is svg (STRING), which passes the saved string through - handy if you want to save and keep piping the same SVG further down the graph.
Install
Install the whole pack once - every LF node comes from the same repo:
- ComfyUI Manager: search "LF Nodes" and install, then restart ComfyUI.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/lucafoscili/lf-nodes.git, restart.
No model files needed for this one. The pack's requirements.txt is heavy (opencv, onnxruntime, transformers, rembg...) but those are for the filter and LLM nodes; Manager handles dependency installation for you either way.
Common issues
- "Where did my file go?" - It's under
ComfyUI/output, in whatever subfolder your prefix created. Iffilename_prefixhas no leading slash, it's relative to the output root. - Old version of the pack? - The original repo (
comfyui-lf) was archived in late 2025 and replaced bylucafoscili/lf-nodes. If Manager still shows the old one or you cloned it by hand, uninstall and reinstall from the new repo - that migration trip-up is the most common way people end up on a stale build of this suite. - It's an output node - which means it always runs, and it will force whatever's upstream to execute every time. That's fine here (saving is the point), but don't wire expensive generations into it and wonder why the graph won't idle.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| svg | STRING | SVG data to save (.svg). | |
| filename_prefix | STRING | Path and filename for saving the SVG. Use slashes to set directories. | |
| add_timestamp | BOOLEAN | true | Add timestamp to the filename as a suffix. |
| add_counter | BOOLEAN | true | Add a counter to the filename to avoid overwriting. |
| ui_widgetopt | LF_MASONRY | [object Object] | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| svg | STRING | Saved SVG string. |