Raster to Vector (SVG)Color
Where this pack actually gets interesting
- image
- STRING
Let's get the rename out of the way: ConvertRasterToVectorColor is the old name. The ComfyUI-ToSVG pack's June 17 update renamed it to TS_ImageToSVGStringColor_Vtracer (same inputs, same output, same behavior), and the current code only ships the new class. If a stale workflow points at this name, swap in the TS_ version. Fine. Now the interesting part.
Black-and-white tracing is easy for a machine - one threshold, done. Color tracing is where it gets fun, because the tracer has to decide how to carve a full-color bitmap into stacked layers of shapes, each with a fill color, without turning your image into a 40 MB mess. That's what this node does, via visioncortex/vtracer with colormode="color".
The inputs that matter
You get the same shared knobs as the BW node - mode, filter_speckle, corner_threshold, length_threshold, splice_threshold - plus the color-specific ones:
- hierarchical -
stackedorcutout. Stacked builds the image as layers painted on top of each other (smaller files, slightly less accurate edges); cutout carves shapes that fit together like a jigsaw (more accurate, heavier). - color_precision - the README's "more accurate" dial. Higher = more color layers, truer to the original.
- layer_difference - the README calls this the gradient-step control; it sets how much the tracer tolerates between layers, so it effectively decides "less layers" as you raise it.
- max_iterations - how hard the algorithm works on edge refinement. More is better quality and slower.
- path_precision - how precisely paths follow edges. Higher is heavier output.
Output is a STRING, one per image in the batch. Wire it to TS_SVGStringPreview to look, TS_SaveSVGString to save, or TS_SVGStringToImage to rasterize back into the pixel pipeline.
Where color vectorization earns its keep
This is the path people use when they want more than a flat logo: vectorizing generated illustrations or icons with a handful of flat colors, prepping art for screen printing (where each layer is a separate screen), or feeding a cricut/laser workflow that needs color-separated SVG. The "Flux Icon Maker" style workflows - the ones that blew up on r/StableDiffusion - lean on exactly this kind of output for icons and design assets.
Two honest warnings. First, trace quality lives or dies by your source: something with large flat color regions traces beautifully; noisy or photorealistic output turns into a bloated, muddy SVG. Run TS_ImageQuantize first to collapse the palette, and suddenly the same image traces clean. Second, the defaults are a starting point, not a promise - if your result has speckles, raise filter_speckle; if colors smear together, raise color_precision and lower layer_difference.
Installing it
One install covers all the pack's nodes. 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
Dependencies are vtracer, numpy, Pillow, torch, PyMuPDF, and potracer - no model files, no API keys, all local CPU work. If fitz ever refuses to import after an update, reinstall PyMuPDF; that compiled dependency is the usual suspect when this pack's requirements collide with another node pack's.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| hierarchical | COMBO | stacked | 2 options: stacked, cutout |
| mode | COMBO | spline | 3 options: spline, polygon, none |
| filter_speckle | INT | 40–100 | — |
| color_precision | INT | 60–10 | — |
| layer_difference | INT | 160–256 | — |
| corner_threshold | INT | 600–180 | — |
| length_threshold | FLOAT | 4.00–10 | — |
| max_iterations | INT | 101–70 | — |
| splice_threshold | INT | 450–180 | — |
| path_precision | INT | 30–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |