Vector to Raster (SVG)
Put your SVG back into the pixel pipeline
- IMAGE
First, the naming truth: ConvertVectorToRaster is the old name. The ComfyUI-ToSVG pack's June 17 update renamed its nodes to TS_* prefixes to avoid conflicts, and the current equivalent is TS_SVGStringToImage - same job, same one input, same IMAGE output. Old workflows reference this class and won't load until you swap the name. Everything below applies to both names.
Now, the actual point of the node: it's the return trip. The pack's vectorizers turn images into SVG text; this node turns SVG text back into pixels so the rest of your ComfyUI graph can keep working with it. Handy when you want to rasterize a vectorized logo and composite it over a generated scene, run it through a second pass, or just eyeball what the tracer produced before you commit to saving it.
How it works
The mechanism is refreshingly direct: it feeds the SVG string to PyMuPDF (fitz) with fitz.open(stream=..., filetype="svg"), renders the first page with get_pixmap(), converts the resulting PNG bytes to a PIL image, and returns a standard IMAGE tensor. That's it - one SVG string in, one image out.
Worth knowing before you rely on it: there's no resolution or scale control. You get whatever default DPI PyMuPDF decides to rasterize at, which tends to be modest. Vector files are resolution-independent; the moment you push one through this node, it's locked to a fixed pixel grid again. For preview and compositing that's fine. For final export, keep the SVG string and save it as SVG instead - that's the whole point of vector.
Inputs and outputs
- svg_strings - a STRING containing SVG markup. Straight from a vectorizer node in this pack, or from any source that gives you SVG as text.
- Output: IMAGE, ready for a PreviewImage, SaveImage, or any image-side node.
Wiring it in practice
A sensible loop: generate → TS_ImageToSVGStringBW_Vtracer (or the color one) → this node → PreviewImage, so you can compare the vector trace against the original before saving. If you're iterating on corner_threshold and filter_speckle, this is the feedback loop that makes it tolerable.
Installing the pack
It's one install for all fifteen nodes. ComfyUI Manager → search ComfyUI-ToSVG → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Yanick112/ComfyUI-ToSVG/
cd ComfyUI-ToSVG
pip install -r requirements.txt # or path/to/ComfyUI/python_embedded/python.exe -s -m pip
Requirements: vtracer, numpy, Pillow, torch, PyMuPDF, potracer. No models to fetch, no API keys, CPU-only. The one dependency to keep an eye on is PyMuPDF - it's a compiled wheel that other packs pin differently, so a mysterious fitz import failure after an update usually means "reinstall PyMuPDF in the same environment."
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| svg_strings | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |