ποΈ VTracer (Image vectorizer)
Raster to SVG inside ComfyUI, for logos and laser files
- image
Vectorize the image on your canvas - no leaving ComfyUI, no external website. VTracer is the well-known open-source raster-to-vector engine (the one a lot of web tools and even SVG-dataset projects quietly rely on), and this node wraps it: feed it an image, get back an SVG file in your output directory, ready for Inkscape, a laser cutter, a plotter, or a print shop. If your pipeline ends in "give this to a machine that cuts things," this node is the bridge.
It's a niche node and knows it. But it's a genuinely good niche: pixel images upscale poorly, vectors don't. So when a generated logo, sticker design, or engraving pattern needs to survive scaling from business-card to billboard, tracing it to vector is the right move, and doing it in-graph keeps the workflow reproducible.
How it works
Under the hood it hands the image to vtracer.convert_pixels_to_svg - a proper auto-tracer that builds paths from the image's color regions, not a cheap "embed the raster in an SVG" hack - and writes the result to ComfyUI/output with a filename_prefix you choose. It can also save as PDF, by tracing to SVG and then converting via svglib/reportlab (the temporary SVG is deleted afterward).
The rest of the inputs are VTracer's own tuning knobs, passed straight through:
- colormode -
colororbinary(two-tone, for line art and engraving). - mode -
spline(smooth curves),polygon(straight segments), ornone(raw outlines). - filter_speckle - drops tiny specks/noise; higher = cleaner but lossier. Default 4.
- color_precision - how many colors to keep (default 6; lower = flatter, more posterized).
- layer_difference - color-layering tolerance, 1β30.
- corner_threshold, length_threshold, max_iterations, splice_threshold, path_precision - path-shape parameters. Defaults are sane; tune them only when spline output looks lumpy.
- hierarchical -
stackedorcutout; how color layers nest. - save_format -
SVGorPDF.
For a first pass: leave everything, set colormode to binary if the image is meant as line art, and look at the SVG. Tune color_precision and filter_speckle before anything else - they do 80% of the visible work.
Install
This node pulls in the heavy dependencies - vtracer (a Rust-backed wheel), plus svgwrite, svglib, and reportlab for the PDF path. That's why it's worth calling out: the pack's requirements.txt is shared, and this node is a big chunk of it.
cd ComfyUI/custom_nodes
git clone https://github.com/YarvixPA/ComfyUI-NeuralMedia
cd ComfyUI-NeuralMedia
pip install -r requirements.txt
or ComfyUI Manager β search ComfyUI-NeuralMedia, restart ComfyUI. If the clone 404s (the repo has moved around), Manager's registry entry is the reliable route.
Common issues
- PDF mode fails. It needs
svglibandreportlabinstalled. If your environment predates the requirements update, runpip install svglib reportlaband restart. - Output is a blobby mess. The image probably has gradients or noise. Flatten it first - posterize, reduce colors - or raise
filter_speckleand lowercolor_precision. - The SVG looks fine but is huge. High
color_precisionon a busy image produces thousands of paths. Dial it down for clean output; VTracer is fast, but massive SVGs are annoying everywhere downstream.
The honest take
This is the rare pack node with no real equivalent in core ComfyUI, and it's the one worth installing for if your work touches physical output. For everything else it's a fun toy that occasionally saves you a trip to a web tracer. Know what you're buying: automatic tracing is good, not magical - clean flat images vectorize beautifully, photographic ones don't.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| colormode | COMBO | color | 2 options: color, binary |
| hierarchical | COMBO | stacked | 2 options: stacked, cutout |
| mode | COMBO | spline | 3 options: spline, polygon, none |
| filter_speckle | INT | 41β10 | β |
| color_precision | INT | 61β10 | β |
| layer_difference | INT | 161β30 | β |
| corner_threshold | INT | 601β120 | β |
| length_threshold | FLOAT | 4.003.5β10 | β |
| max_iterations | INT | 101β20 | β |
| splice_threshold | INT | 451β90 | β |
| path_precision | INT | 31β8 | β |
| save_format | COMBO | SVG | 2 options: SVG, PDF |
| filename_prefix | STRING | ComfyUI | β |
Outputs (0)
No outputs