Vectorizer.ai API
The Vectorizer.ai API Node
- image
- image
- svg_data
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 ComfyUIoutputdirectory underfilename_prefix, and also passed out assvg_data. Theimageoutput is just your original raster passed through - the node isn't faking a render.scaled_png: the SVG is rendered locally by CairoSVG at yourscale(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 toconfig.json(see install), or paste them into the fields.mode-productionortest. Test is free, watermarked, and needs no subscription; use it while you're wiring things up.output_formatandscale- 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_pngwith no Cairo gives you nothing useful -pip install cairosvgdoes not install the C library; that's theaptpackage 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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| api_id | STRING | YOUR_API_ID_HERE | — |
| api_secret | STRING | YOUR_API_SECRET_HERE | — |
| output_format | COMBO | svg | 3 options: svg, png, scaled_png |
| mode | COMBO | production | 2 options: production, test |
| scale | FLOAT | 4.01–16 | — |
| save_svgopt | BOOLEAN | true | — |
| filename_prefixopt | STRING | SVG/vector_raw | — |
| max_colorsopt | INT | 00–256 | — |
| min_shape_areaopt | FLOAT | 1.0000–100 | — |
| adobe_compatibilityopt | BOOLEAN | true | — |
| disable_gap_filleropt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| svg_data | STRING | — |