ComfyUI Node
Inkvec Trace (raster to SVG)
Trace an image to SVG with the Inkvec tracer. Runs the native inkvec binary, which is downloaded from github.com/logolabs/inkvec on first use. Connect LoadImage's MASK to carry transparency.
Inkvec Trace (raster to SVG)
- image
- mask
- svg
- preview
- mask
◄precision0.10►
◄min_area2.0►
◄colors64►
◄merge0.035►
◄max_dim2048►
◄time_budget0.0►
◄margin0.00►
◄cutoutauto►
◄no_backgroundfalse►
◄minifyfalse►
◄lossyauto►
◄harmonizetrue►
◄harmonize_threshold0.92►
◄native_alphatrue►
◄content_unitsfalse►
◄timeout_sec300►
◄extra_args►
CategoryInkvec
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| precision | FLOAT | 0.100.01–10 | Sets the MDL cost of a coordinate: lambda = ln(extent / precision). Smaller keeps more detail with more points. It does not set the digits the emitter writes; output coordinates are fixed at 2 decimals. CLI --precision. |
| min_area | FLOAT | 2.00–10000 | Discard features below this area, in px^2. CLI --min-area. |
| colors | INT | 641–4096 | Maximum palette size. CLI --colors. |
| merge | FLOAT | 0.0350–0.5 | OKLab distance below which two colours are one ink. CLI --merge. |
| max_dim | INT | 20480–16384 | Inputs larger than this on their longer side are traced at this size and the SVG is written at the original size. Trace time grows with the pixel count. 0 means no cap. CLI --max-dim. |
| time_budget | FLOAT | 0.00–3600 | Advisory wall-clock budget in seconds. When it runs out the output is still a correct trace, with more fills or a less polished outline. 0 means no budget. CLI --time-budget. |
| margin | FLOAT | 0.000–0.5 | Transparent margin around the output, as a fraction of the larger side; the viewBox grows, the geometry does not move. CLI --margin. |
| cutout | COMBO | auto | Carry the input's transparency into the SVG: transparent areas stay holes, a shape drawn at one opacity keeps fill-opacity, and white artwork on a transparent ground survives. auto = on when the image or the mask input has any transparency, off for opaque images. Inkvec 0.1.4 traces transparency natively (native_alpha), which already carries it out, so there this only matters with native_alpha off; on 0.1.3 and older it is what keeps the holes, which is why auto passes it for any transparent image. CLI --cutout. |
| no_background | BOOLEAN | false | Knock the background out: the face that covers the whole canvas is not painted, so the artwork sits on transparency. CLI --no-background. |
| minify | BOOLEAN | false | No ids or groups, no trailing zeros. Same geometry, typically about a tenth smaller. CLI --minify. |
| lossy | COMBO | auto | Noise-aware intake for compressed input. The CLI's auto reads the file type, but ComfyUI hands the node decoded pixels (written as PNG), so auto behaves like a PNG here. Set on for JPEG/WebP sources and for images from Inkvec Denoise (inkvec --restore does the same). CLI --lossy. |
| harmonize | BOOLEAN | true | Shape harmonization (the CLI default: on). Marks that repeat across the drawing are matched by outline similarity and redrawn from one consensus geometry per cluster, which saves parameters on repetitive art. A mark takes the consensus only where that stays within 0.1 px of the boundary traced for it and costs fewer parameters; a face another face is drawn against, and a fitted circle or rounded rectangle, is never moved. Turn it off to skip the pass. CLI --harmonize. |
| harmonize_threshold | FLOAT | 0.920–1 | Shape-equivalence IoU threshold for harmonization. CLI --harmonize-threshold. |
| native_alpha | BOOLEAN | true | Trace transparency natively: each ink carries an opacity and the transparent ground is an ink of its own -- holes stay holes, glows and shadows stay translucent, and white artwork on a transparent ground traces. An opaque image traces the same either way, so leave it on. Off composites onto a matte first, as inkvec releases up to 0.1.3 did. Needs inkvec 0.1.4; an older binary reports --no-native-alpha as an unknown option. CLI --native-alpha. |
| content_units | BOOLEAN | false | Scale the fit tolerances with the raster, so a large, simple drawing gets the parameter count of a small one. Trades fidelity for parsimony: small squares can come back as circles and thin rings broken. Needs inkvec 0.1.4. CLI --content-units. |
| timeout_sec | INT | 3005–7200 | The node stops the tracer after this many seconds and reports an error. |
| maskopt | MASK | Transparency, as LoadImage outputs it (1 = transparent). A mask where 1 marks the subject must be inverted first (InvertMask). | |
| extra_argsopt | STRING | Further inkvec flags, appended last so they override the widgets, e.g. --strokes or --layers. A flag the installed binary does not know is reported as an error. -o/--output/--help/--version are not allowed. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| svg | STRING | The SVG source, one string per image in the batch. |
| preview | IMAGE | The SVG rendered back to pixels (needs resvg-py or cairosvg; otherwise the input image). |
| mask | MASK | Transparency of the rendered SVG, 1 = transparent (LoadImage's convention). |