ComfyUI Extension: ComfyUI-Svg2Raster
A ComfyUI custom node to load SVG files and convert them to raster images, with options for resizing, background color, and borders.
Custom Nodes (0)
README
ComfyUI-Svg2Raster
This is a simple and efficitent ComfyUI node to load SVG files and rasterize them into images that can be used in your workflows.

Updates
2025-09-10:
- First release of the
ComfyUI-Svg2Rasternode. - Added two nodes:
Load SVG ImageandSVG Rasterizer (Simple).
Installation
[!IMPORTANT] This package uses
CairoSVGfor SVG loading and manipulation, which requiresCairoto 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.
Features
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 Imagenode) 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. Overridesscaleif set.scale: A scaling factor for the SVG. Used only ifwidthis 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'.