Image to SVG String BW_Vtracer
The node that turns your AI images into actual vector files
- image
- STRING
The node that turns your AI images into actual vector files. Feed it a normal IMAGE tensor - whatever you just generated with Flux, SDXL, or a controlnet pass - and it returns a real SVG string you can save, plot, laser-cut, or drop into Illustrator. No API, no model downloads, no GPU required. It's the most-searched node in the ComfyUI-ToSVG pack for a reason: it's the missing bridge between "I made an image" and "I have a vector file."
What it actually does
Under the hood this is visioncortex/vtracer, a fast Rust-based raster-to-vector tracer, wrapped in a ComfyUI node. The node converts your tensor to a PIL image, forces an alpha channel, hands the pixels to vtracer.convert_pixels_to_svg() with colormode="binary", and hands you the SVG markup as text. It runs entirely in-process on your CPU - this isn't an LLM doing vision tricks, it's a classic bitmap-tracing algorithm deciding where the shapes are.
It also handles batches: feed it N images and you get a list of N SVG strings back, one per frame.
The knobs that matter
The README's own plain-English descriptions are worth trusting here:
- mode -
spline(default),polygon, ornone. Splines give smooth bezier curves; polygon trades smoothness for hard edges and smaller files. Start with spline. - filter_speckle - cleaner. Higher values kill tiny noise blobs that tracing loves to invent.
- corner_threshold - smoother. This is the one people actually fight with.
- length_threshold - more coarse. Higher = longer, simpler segments.
- splice_threshold - less accurate, but smaller output.
The two to touch first are filter_speckle (your noise control) and corner_threshold (your smoothness control). The defaults are sane for a typical 1024px generation.
Where the output goes
The output is a STRING (a list when you feed a batch). From there it plugs into the rest of this pack:
- TS_SVGStringToImage or TS_SVGStringPreview to actually look at what you got, and
- TS_SaveSVGString to write a real
.svgfile into your ComfyUI output directory.
Or keep it as text and hand it to a plotting, laser, or cutting workflow outside ComfyUI.
The community reality check
This pack is the engine behind the well-known "Flux Icon Maker" workflow (r/StableDiffusion, 500+ upvotes) - icons and logos are the killer use case, because that's exactly where people want vectors instead of pixels. The most common complaint in the wild is jagged lines at default settings; bump corner_threshold toward 90–120 and nudge filter_speckle up, and most of the jaggies vanish. Before you rage-quit on a bad trace, try that, not a different node.
Installing it
Install once and every node in the pack comes along. Easiest route is ComfyUI Manager → Custom Nodes Manager → search ComfyUI-ToSVG → Install, then restart. Manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/Yanick112/ComfyUI-ToSVG/
cd ComfyUI-ToSVG
# Portable install:
path/to/ComfyUI/python_embedded/python.exe -s -m pip install -r requirements.txt
# Or with system Python:
pip install -r requirements.txt
Dependencies are vtracer, numpy, Pillow, torch, PyMuPDF, and potracer. Nothing to download, no keys. Restart ComfyUI and the nodes appear under 💎TOSVG/Convert.
Gotchas
One thing to know: this node used to be called ConvertRasterToVectorBW. The June 17 update renamed the pack's nodes to TS_* prefixes to avoid conflicts - a destructive change, so old workflow JSONs referencing the old class won't load until you swap the name. And because PyMuPDF (fitz) is a compiled dependency that other packs pin differently, "import fitz failed" after an update usually means reinstalling PyMuPDF in the same environment.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mode | COMBO | spline | 3 options: spline, polygon, none |
| filter_speckle | INT | 40–100 | — |
| corner_threshold | INT | 600–180 | — |
| length_threshold | FLOAT | 4.00–10 | — |
| splice_threshold | INT | 450–180 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |