ComfyUI-SVGFullfill is a custom node for ComfyUI that handles SVG file processing. Key features: - SVG file upload and preview - Replace images (up to 3) and text elements (up to 10) in SVG - Chinese font support - Real-time canvas preview - PNG export
A ComfyUI custom node that enables SVG file integration and editing. This node allows you to upload SVG files, preview them in real-time, replace images and text elements within the SVG, and export the result as a PNG image.
cd ComfyUI/custom_nodes
git clone https://github.com/YourUsername/ComfyUI-SVGFullfill.git
pip install cairosvg Pillow
cd ComfyUI-SVGFullfill
mkdir font
# Copy your .ttf or .otf fonts into the font directory
Your SVG file should:
text1
, text2
, etc., for text replacement<image>
elements for image replacementExample SVG structure:
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600">
<text id="text1">Replaceable Text 1</text>
<text id="text2">ćżć˘ććŹ2</text>
<image x="10" y="10" width="200" height="200" />
</svg>
The extension provides two main nodes:
SVG Uploader
SVG Editor
graph TD
A[SVG Uploader] -->|SVG File| B[SVG Editor]
C[Image 1] -->|Optional| B
D[Image 2] -->|Optional| B
E[Image 3] -->|Optional| B
B -->|Final Image| F[Output]
To use custom fonts (especially for Chinese text):
.ttf
or .otf
font files in the font
directoryContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to the ComfyUI community for their support and inspiration.