Extensions/Unlimited SVG
ComfyUI Extension

Unlimited SVG

Turn any image into a structured, editable SVG with Baidu's Unlimited-SVG model, running natively on ComfyUI's text-generation stack.

By jtydhr88·Created a day ago·Updated about 15 hours ago· 38
jtydhr88/ComfyUI-UnlimitedSVG
Nodes—
On cloudLocal install
Stars38
Updatedabout 15 hours ago
Readme

English | 中文

ComfyUI-UnlimitedSVG

Turn any image into a structured, editable SVG inside ComfyUI, with Baidu's Unlimited-SVG model.

Line art to SVG

Illustration to SVG

Shapes and text come out as real SVG elements (<path>, <circle>, <text>), grouped and named, ready to edit.

The model runs natively on ComfyUI's own text-generation stack: it loads as a CLIP model, is managed by ComfyUI's memory system, and its output plugs into the built-in Save SVG node.

Install

Clone this repository into ComfyUI/custom_nodes and restart ComfyUI:

cd ComfyUI/custom_nodes
git clone https://github.com/jtydhr88/ComfyUI-UnlimitedSVG

Model

Download unlimited_svg.safetensors (6.7 GB) into ComfyUI/models/text_encoders. The file holds the weights and the tokenizer.

To build the file yourself from the original weights:

  1. Download baidu/Unlimited-SVG (model-00001-of-000001.safetensors and tokenizer.json) into one folder.
  2. Run the converter with ComfyUI's Python:
python custom_nodes/ComfyUI-UnlimitedSVG/scripts/convert_weights.py /path/to/Unlimited-SVG models/text_encoders/unlimited_svg.safetensors

Nodes

Load Unlimited SVG Model (loaders) loads the converted file and outputs a CLIP.

Image to SVG (Unlimited SVG) (image) converts each image of a batch to an SVG.

| Input | Meaning | |---|---| | max_length | Maximum number of tokens in the SVG. Complex images use 10,000 tokens and more. | | temperature | 0 is deterministic. Keep 0-0.3 for diagrams, charts and CAD; use 0.5-0.8 for photos and natural scenes. | | seed | Used when temperature is above 0. | | mask | Optional. Transparent areas of the image, filled with white before conversion. Connect the MASK output of Load Image for images with a transparent background. |

Connect the SVG output to Save SVG. The SVG keeps the aspect ratio and pixel size of the input image.

Workflow

A ready-made workflow is in example_workflows/image_to_svg.json.

Tips

  • The node draws the SVG on itself while it is being written:

    Live preview

  • When a photo makes the output repeat the same shapes, raise temperature.

  • When the output reaches max_length, the node closes the SVG where it stopped and the console shows a warning; raise max_length for the full image.

  • On an RTX 5090 the model writes about 55-65 tokens per second and uses about 9 GB of VRAM; a 12,000-token SVG takes about 4 minutes.

  • The loaded model also works with the built-in Generate Text node: connect an image and use the prompt SVG: to get the raw text.

License

MIT, same as the original model. The vision encoder follows DeepSeek-OCR's DeepEncoder (SAM ViT-B + CLIP-L).