Extensions/ComfyUI-Svg2Raster
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.

By garg-aayush·Created 11 months ago·Updated 11 months ago· 0
garg-aayush/ComfyUI-Svg2Raster
Nodes2
On cloudLocal install
CategoryFromSVG/Tools
Stars0
Updated11 months ago
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. Workflow Example

Updates

2025-09-10:

  • First release of the ComfyUI-Svg2Raster node.
  • Added two nodes: Load SVG Image and SVG Rasterizer (Simple).

Installation

[!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:

  1. Navigate to the ComfyUI/custom_nodes/ directory.
  2. Clone this repository:
    git clone https://github.com/garg-aayush/ComfyUI-Svg2Raster.git
    
  3. Install the required dependencies:
    pip install -r requirements.txt
    
  4. Restart ComfyUI.

Features

This package includes two main nodes to handle SVG images in your workflows:

  1. 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.

  2. SVG Rasterizer (Simple): This node takes SVG text (for example, from the Load 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. Overrides scale if set.
    • scale: A scaling factor for the SVG. Used only if width 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'.