π SVG to Image
Rasterize your SVG string back into pixels β no model needed
- svg_code
- image
The OmniSVG generators hand you an SVG string, but a string is useless in a graph full of IMAGE tensors. This node renders that SVG_STRING into a normal ComfyUI IMAGE at whatever size you ask - and it's the cheapest node in the pack by a mile. No OmniSVG model, no 17GB VRAM, no Qwen download. It's just CairoSVG doing the rasterization. This is the pack's answer to "how do I actually look at what the model made."
How it works
Simple under the hood: the SVG string goes to cairosvg.svg2png with your requested output width and height, the resulting PNG is decoded to PIL, then converted to the standard [B,H,W,C] float tensor every other node expects. Vector in, pixels out, done. Because the model part is separate, this node works even if you never downloaded an OmniSVG model - it only needs the pack installed.
The inputs
- svg_code (SVG_STRING) - the markup to rasterize.
- width (default 512, range 64β2048) and height (default 512, range 64β2048) - the output resolution.
Since SVG is resolution-independent, both 64 and 2048 are "correct" renders of the same file; higher just costs render time and RAM. Rasterizing at a comfortable size and upscaling later is a perfectly fine move if you want to feed the result through the rest of your graph.
Outputs
- image - a standard IMAGE, so it plugs into anything: preview nodes, Save Image, upscalers, whatever. This is the node you use when you want the pack's output to behave like every other image in ComfyUI.
Two gotchas worth knowing
The wiring one: svg_code is the pack's custom SVG_STRING type, and a plain text node won't plug into it - ComfyUI only connects matching types. So you need a node that outputs SVG_STRING, which in practice means the OmniSVG Text-to-SVG or Image-to-SVG nodes. If you want to rasterize SVG you wrote by hand, you'll need something that emits that type.
The silent-failure one: CairoSVG is picky. If the SVG uses features it doesn't support or the string is malformed, this node doesn't throw - it quietly returns a white placeholder image. White output means read the console and check your SVG. CairoSVG also won't render fonts it can't find, so stick to standard paths and shapes if you want predictable results.
Install
Just the pack install: Manager, search "OmniSVG", or git clone https://github.com/A043-studios/ComfyUI-OmniSVG into custom_nodes and run python install.py. cairosvg comes from requirements.txt. Runs happily on CPU - the only node in this pack you could use on a potato.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| svg_code | SVG_STRING | β | |
| width | INT | 51264β2048 | β |
| height | INT | 51264β2048 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |