Nodes/Vectorizer API/Vectorizer.ai API
ComfyUI Node

Vectorizer.ai API

The Vectorizer.ai API Node

By rickrender·Created about a year ago·Updated about a year ago· 5
Vectorizer.ai API
  • image
  • image
  • svg_data
api_idYOUR_API_ID_HERE
api_secretYOUR_API_SECRET_HERE
output_formatsvg
modeproduction
scale4.0
save_svgtrue
filename_prefixSVG/vector_raw
max_colors0
min_shape_area1.000
adobe_compatibilitytrue
disable_gap_fillertrue

What it actually is

Vector art is the one thing diffusion never hands you. ComfyUI outputs pixels, and pixels are a miserable format for a logo, a sticker sheet, a T-shirt print - anything that has to survive going from favicon to billboard. This node is the bridge: it takes an IMAGE from your graph, sends it to the Vectorizer.AI web service, and hands back a clean, editable SVG.

It costs money, and that's the point. Vectorizer.AI is a commercial API - you make an account, grab a key from your account page, and spend credits per image. The community verdict after trying the free route is remarkably consistent: vectorizer.ai produces cleaner curves than the local Potrace-style tracers you can run in ComfyUI. There's a reason people building upscale-and-vectorize pipelines keep coming back to it even when they'd rather not pay. The one thing this node gives you over the web app is that it all happens inside your graph, with the result feeding straight into the rest of your workflow.

No model downloads, no VRAM, no GPU. The whole pack runs on requests.

How it works

The mechanism is refreshingly boring: the node encodes your image to PNG in memory, POSTs it to https://vectorizer.ai/api/v1/vectorize with your api_id and api_secret as HTTP basic auth, and waits - with a 60-second timeout. What happens next depends on output_format:

  • svg (default): the returned SVG text is saved to your ComfyUI output directory under filename_prefix, and also passed out as svg_data. The image output is just your original raster passed through - the node isn't faking a render.
  • scaled_png: the SVG is rendered locally by CairoSVG at your scale (1–16x) into a crisp high-res PNG. This is the "infinite upscale" trick: keep the vector, and also get a raster at any resolution with zero quality loss.
  • png: the API does its own raster render and returns a PNG.

The optional fields map straight onto the API's processing options: max_colors (0 = auto, lower values flatten into poster colors), min_shape_area (drops tiny stray shapes), adobe_compatibility (Illustrator-friendly SVG, on by default), and disable_gap_filler. You can safely ignore all of them at first.

The inputs that matter

  • image - anything, but flat art vectorizes dramatically better than photos.
  • api_id / api_secret - leave them as the placeholders and the node falls back to config.json (see install), or paste them into the fields.
  • mode - production or test. Test is free, watermarked, and needs no subscription; use it while you're wiring things up.
  • output_format and scale - the two you'll actually touch once it works.

Outputs: image (the IMAGE that keeps flowing through your graph) and svg_data (a STRING). svg_data is the one you want - it's your editable vector, and it's exactly what the pack's Background Remover (Shape) node eats.

Installing it

ComfyUI Manager, search "Vectorizer API", click install. Or by hand:

cd ComfyUI/custom_nodes/
git clone https://github.com/rickrender/ComfyUI-Vectorizer-API
cd ComfyUI-Vectorizer-API
pip install -r requirements.txt

The Python deps are light - requests, lxml, CairoSVG - but scaled_png also needs the system Cairo library:

sudo apt-get install libcairo2-dev pkg-config   # Debian/Ubuntu

Restart ComfyUI and the nodes appear under Conversion. For the keys, drop a config.json into the pack folder (the README calls it "ComfyUI-Vectorizer-Pack"; it's the folder you just cloned):

{
  "api_id": "YOUR_REAL_API_ID",
  "api_secret": "YOUR_REAL_API_SECRET"
}

Where people get burned

  • No key means a silent failure. If the key is missing or the API rejects the request, the node just returns your original image and an empty svg_data, logging the error to the console. Your workflow keeps "working"; your vector is just gone. Always check the terminal.
  • The 60-second timeout. Large or busy images can blow past it, and the failure mode is the same quiet pass-through.
  • scaled_png with no Cairo gives you nothing useful - pip install cairosvg does not install the C library; that's the apt package above.
  • Privacy. Your image leaves your machine and hits a third-party service. Fine for your own art; a real consideration for client work.
  • Don't ship test-mode output - it's watermarked by design.
CategoryConversion

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
api_idSTRINGYOUR_API_ID_HERE
api_secretSTRINGYOUR_API_SECRET_HERE
output_formatCOMBOsvg3 options: svg, png, scaled_png
modeCOMBOproduction2 options: production, test
scaleFLOAT4.01–16
save_svgoptBOOLEANtrue
filename_prefixoptSTRINGSVG/vector_raw
max_colorsoptINT00–256
min_shape_areaoptFLOAT1.0000–100
adobe_compatibilityoptBOOLEANtrue
disable_gap_filleroptBOOLEANtrue

Outputs (2)

NameTypeDescription
imageIMAGE
svg_dataSTRING