This is a simple and efficitent ComfyUI node to load SVG files and rasterize them into images that can be used in your workflows.
2025-09-10:
- First release of the
ComfyUI-Svg2Raster
node. - Added two nodes:
Load SVG Image
andSVG Rasterizer (Simple)
.
Important
This package uses CairoSVG
for SVG loading and manipulation, which requires Cairo
to be installed as a system dependency. Please follow the instructions for your operating system to install it before proceeding.
After installing Cairo:
- Navigate to the
ComfyUI/custom_nodes/
directory. - Clone this repository:
git clone https://github.com/garg-aayush/ComfyUI-Svg2Raster.git
- Install the required dependencies:
pip install -r requirements.txt
- Restart ComfyUI.
This package includes two main nodes to handle SVG images in your workflows:
-
Load SVG Image
: This node is used to import or load an SVG file. It outputs the SVG content as a text string and also provides a rasterized preview image that can be directly used in your workflow. -
SVG Rasterizer (Simple)
: This node takes SVG text (for example, from theLoad SVG Image
node) and rasterizes it into an image with various customization options.Parameters:
svg_text
: The SVG content as a string.width
: The desired output width in pixels. Overridesscale
if set.scale
: A scaling factor for the SVG. Used only ifwidth
is 0.background_color
: The background color in hex format or 'transparent'.border_width
: The width of the border in pixels.border_color
: The color of the border in hex format or 'transparent'.