ComfyUI Node

Vector

The easiest raster-to-SVG node in ComfyUI

By the-hexer·Created about a year ago·Updated about a year ago· 7
Vector
  • image
  • vector_image
colormodecolor
hierarchicalstacked
modespline
filter_speckle4
color_precision6
layer_difference16
corner_threshold60
length_threshold4.0
max_iterations10
splice_threshold45
path_precision8
output_directory

So you've got a gorgeous sticker, logo, or flat-illustration render sitting in your ComfyUI graph, and you need it as an actual SVG - scalable, editable in Illustrator or Inkscape, laser-cutter ready. That's exactly what this node does. The Vector node is a thin ComfyUI wrapper around vtracer, the open-source Rust raster-to-vector tracer, and it's about as plug-and-play as these things get. It's not AI - no model files, no inference, no API key. It's a smart bit of post-processing that turns pixels into bezier paths in a couple of seconds.

The pack is a fork of archifancy's original Image-vector-for-ComfyUI, re-released by Cyber-BlackCat with more hand-holding in the README. For a node like this that's honestly the main difference, and for a beginner it matters.

How it works

Wire any IMAGE into the image input, hit queue, and behind the scenes the node: saves your image to a temp PNG, runs vtracer.convert_image_to_svg_py() to trace it into an SVG file on disk, then uses ImageMagick (via the Wand Python binding) to render that SVG back to a PNG and return it as the vector_image output. So the actual vector result is the .svg file written to disk - the image output is just a rasterized preview so you can see what the trace did, wire it to a preview node, and iterate.

That last point is the one that trips people up, so read it twice: the output is a PNG render, the SVG is the file on disk. No SVG comes out of the node's output socket, which is normal for this whole category of node.

The inputs that actually matter

There are twelve knobs, but they're all straight vtracer parameters, and the defaults are sensible. You'll really touch these:

  • colormode - color (default) for full-color traces, binary for a clean black/white two-tone output. Pick binary for silhouettes, stencils, and logos.
  • hierarchical - stacked (default) builds colors as stacked layers; cutout generates real cutout shapes. For laser cutting, cutout is often what you want.
  • mode - spline (default) gives smooth bezier curves; polygon uses straight line segments (a chunky, geometric look); none skips curve fitting.
  • filter_speckle - removes tiny enclosed noise regions smaller than N pixels. The #1 fix for "my trace has a million specks of dust."
  • color_precision - higher = more accurate color separation, at the cost of bigger files.

The rest - layer_difference, corner_threshold, length_threshold, max_iterations, splice_threshold, path_precision - are fine at defaults until you get nerdy about path quality. Tweak them only after the trace looks wrong.

And then there's output_directory. Set this. If you leave it blank the SVG lands in your system temp folder under a random name, which is the ComfyUI equivalent of dropping your homework down a well. Point it at any folder, like C:\my-svgs or ~/Desktop/svg_out, and your .svg (plus a rendered .png alongside it) shows up there after every queue run.

Installing it

Through ComfyUI Manager, search for ComfyUI-Image-Vector and install. Or, the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/Cyber-BlackCat/ComfyUI-Image-Vector
cd ComfyUI-Image-Vector
pip install -r requirements.txt

Here's the trap hiding in the requirements file: it lists vtracer, Wand, Pillow, torch, numpy - and then, in a comment, admits ImageMagick itself can't be pip-installed. Wand is only a Python wrapper; it needs the actual ImageMagick binary on your system or the SVG→PNG step throws a DelegateError. On Debian/Ubuntu:

sudo apt-get update && sudo apt-get install -y imagemagick libmagickwand-dev

On Windows you run the ImageMagick installer. And if you're on ComfyUI portable, install the Python deps with python_embeded\python.exe -m pip install -r requirements.txt from inside that folder - your system pip won't touch the portable environment. Then restart ComfyUI.

Troubleshooting

  • The node returns None and you're staring at a disconnected output. The node swallows exceptions and prints the error to the console (in Chinese, starting with 错误:). Open the console before you rage-click - that's your error message.
  • DelegateError / "no decode delegate" - ImageMagick isn't installed or Wand can't find it. Go back to the install section.
  • The SVG you find is named something like tmpabc123.svg. Working as intended; that's the temp-file basename. You control the folder via output_directory, not the name.

Is it the most powerful tracer on earth? No - real vector artisans will outgrow it for Potrace or a manual redraw. But for the 90% case - turning a clean AI illustration into a usable SVG in under ten seconds - it's the node you reach for.

CategoryImage Vector

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
colormodeCOMBOcolor2 options: color, binary
hierarchicalCOMBOstacked2 options: stacked, cutout
modeCOMBOspline3 options: spline, polygon, none
filter_speckleINT41–128
color_precisionINT61–10
layer_differenceINT161–20
corner_thresholdINT601–100
length_thresholdFLOAT4.03.5–10
max_iterationsINT101–20
splice_thresholdINT451–100
path_precisionINT81–10
output_directorySTRING

Outputs (1)

NameTypeDescription
vector_imageIMAGE