ComfyUI Extension: ComfyUI OmniSVG Nodes
Generate high-quality SVG graphics from text descriptions and images using OmniSVG in ComfyUI.
Custom Nodes (0)
README
ComfyUI OmniSVG Nodes
Generate high-quality SVG graphics from text descriptions and images using OmniSVG in ComfyUI.
šÆ Features
- š§ OmniSVG Model Loader: Load and manage OmniSVG models
- š Text to SVG: Generate SVG graphics from text descriptions
- š¼ļø Image to SVG: Convert images to SVG format
- š SVG to Image: Convert SVG strings to ComfyUI IMAGE tensors
- š¾ SVG Saver: Save SVG files to disk
š Quick Start
# Clone to ComfyUI custom_nodes directory
cd ComfyUI/custom_nodes/
git clone https://github.com/yourusername/ComfyUI-OmniSVG.git
cd ComfyUI-OmniSVG
# Install dependencies and setup
python install.py
# Restart ComfyUI
š Table of Contents
š¦ Installation
Method 1: Automated Installation (Recommended)
# Navigate to ComfyUI custom_nodes directory
cd ComfyUI/custom_nodes/
# Clone the repository
git clone https://github.com/yourusername/ComfyUI-OmniSVG.git
cd ComfyUI-OmniSVG
# Run automated installer
python install.py
# Restart ComfyUI
The installer will:
- ā Install all Python dependencies
- ā Set up the models directory
- ā Verify the installation
- ā Provide next steps
Method 2: Manual Installation
<details> <summary>Click to expand manual installation steps</summary>-
Clone Repository
cd ComfyUI/custom_nodes/ git clone https://github.com/yourusername/ComfyUI-OmniSVG.git cd ComfyUI-OmniSVG
-
Install Dependencies
pip install -r requirements.txt
-
Download Model Weights
# Create models directory mkdir -p ../../models/omnisvg/ # Download model (requires huggingface-cli) huggingface-cli download OmniSVG/OmniSVG --local-dir ../../models/omnisvg/OmniSVG-3B
-
Restart ComfyUI
Method 3: Using Existing OmniSVG Installation
If you already have OmniSVG installed (e.g., in /mnt/storage/OmniSVG-3B
), the nodes will automatically detect and use it.
Requirements
- GPU Memory: 17GB+ VRAM for optimal performance
- Python: 3.8+
- PyTorch: 2.3.0+
- CUDA: 12.1+ (recommended)
Usage
Basic Workflow
- Load Model: Use "OmniSVG Model Loader" to load the model
- Generate SVG:
- Use "OmniSVG Text to SVG" for text-based generation
- Use "OmniSVG Image to SVG" for image conversion
- Process Output:
- Use "SVG to Image" to convert SVG to ComfyUI images
- Use "SVG Saver" to save SVG files
Node Parameters
OmniSVG Text to SVG
- text_prompt: Description of the SVG to generate
- temperature: Controls randomness (0.1-2.0)
- top_p: Nucleus sampling parameter (0.1-1.0)
- top_k: Top-k sampling parameter (1-100)
- repetition_penalty: Prevents repetition (1.0-2.0)
OmniSVG Image to SVG
- image: Input image to convert
- target_size: Resize image before processing (64-512px)
- temperature: Lower values for more faithful conversion (0.01-1.0)
- top_p: Nucleus sampling (0.001-1.0)
Model Storage
Models should be placed in:
ComfyUI/models/omnisvg/
āāā OmniSVG-3B/
āāā config.yaml
āāā config.json
āāā pytorch_model.bin
āāā README.md
Performance Tips
- GPU: Use CUDA for 10-50x faster generation
- Memory: Ensure 17GB+ VRAM available
- Batch Size: Process one image at a time for stability
- Temperature: Lower values (0.1-0.3) for more consistent results
Troubleshooting
Common Issues
-
"Download Required" in model list
- Download OmniSVG models to
ComfyUI/models/omnisvg/
- Or ensure existing installation is accessible
- Download OmniSVG models to
-
CUDA Out of Memory
- Free up GPU memory from other processes
- Use CPU mode (slower but functional)
-
Import Errors
- Install all requirements:
pip install -r requirements.txt
- Ensure OmniSVG core files are copied correctly
- Install all requirements:
Error Messages
- "Model not found": Check model path and file permissions
- "Generation error": Check GPU memory and model loading
- "SVG conversion failed": Verify CairoSVG installation
Examples
Text to SVG
Input: "A minimalist icon of a coffee cup with steam"
Output: Clean SVG icon suitable for web use
Image to SVG
Input: Photo of a simple logo or icon
Output: Vector SVG representation
License
This project follows the same license as OmniSVG. Please refer to the original OmniSVG repository for licensing details.
Credits
- OmniSVG: Original model and implementation
- ComfyUI: Node framework and integration
- Qwen2.5-VL: Base vision-language model
Support
For issues and questions:
- Check this README and troubleshooting section
- Review ComfyUI console output for error details
- Open an issue on GitHub with error logs