Unlimited SVG: Trace On – Projection of Visual Worlds into SVG-Anything Baidu released Unlimited-SVG, a multimodal model built on DeepSeek-OCR that redraws any image as a structured, editable SVG while activating only about 0.5B parameters per token. Unlimited-SVG's DeepEncoder compresses a 2048 × 2048 image into 1024 vision tokens, and its mixture-of-experts decoding sustains real-time generation past 10,000 tokens, the length a complex SVG can require. The model is available on Hugging Face as baidu/Unlimited-SVG and on ModelScope, and runs locally on a BF16-capable NVIDIA GPU with greedy decoding by default. - 2026/12/01 🤝 Thanks to the ModelScope community https://github.com/modelscope for their support. Our model is now available at ModelScope https://modelscope.cn/models/baidu/Unlimited-SVG . - 2026/12/01 🚀 We present Unlimited-SVG https://github.com/baidu/Unlimited-SVG/ , a multimodal model that redraws any image as a structured, editable SVG using just 0.5B activated parameters. Generating a complete SVG for a complex image often exceeds 10,000 tokens—a long-context regime where large models quickly become slow and prohibitive. Built on DeepSeek-OCR, Unlimited SVG breaks this bottleneck from both ends. On the input side, DeepEncoder compresses an entire 2048 × 2048 image into just 1024 vision tokens while preserving fine details such as small text, thin strokes, and exact spatial coordinates—dramatically shrinking the visual prefix before decoding even begins. On the decoding side, its mixture-of-experts MoE architecture activates only ~0.5B parameters per token. Minimal visual prefix meets sparse active compute: Unlimited SVG sustains real-time generation well past 10,000 tokens—making long-horizon, complex SVG conversion practical on a compact, locally deployable model rather than relying on heavy frontier APIs like GPT-6.2 Astra and Claude Fable 5.2. Run from the repository root on x86-64 Linux with uv , a compatible NVIDIA driver, and a free BF16-capable GPU. Use the Hugging Face model baidu/Unlimited-SVG , which supports 2048 × 2048 global inference. Both examples use ImageOps.pad to resize the long edge to 2048 pixels while preserving the aspect ratio, then center the image on a gray 2048 × 2048 canvas without tiling. Transparent pixels are composited onto white first, so images with alpha do not turn black. Both examples run greedily by default do sample=False in Transformers, temperature=0 in vLLM for deterministic output. Tune the sampling temperature to the image type: - CAD, diagrams, charts, and other images that need exact detail consistency : keep the temperature low e.g., 0–0.3 to preserve precise geometry and text. - Natural scenes and photos : raise the temperature e.g., 0.5–0.8 to avoid repetitive loops and encourage more varied strokes. To sample with Transformers, pass do sample=True and a temperature instead of the greedy override above; with vLLM, set temperature in the request. Install dependencies. uv venv .venv-svg-hf --python 3.12 uv pip install --python .venv-svg-hf/bin/python \ torch==2.6.0 torchvision==0.21.0 transformers==4.46.3 tokenizers==0.20.3 \ safetensors==0.8.0 pillow==13.0.0 einops==0.8.2 addict==2.4.0 \ easydict==1.14 accelerate==1.16.0 requests==2.34.2 \ huggingface hub==0.36.0 Save the following code as infer hf.py . python import re import sys from pathlib import Path from tempfile import TemporaryDirectory from xml.etree import ElementTree import torch from PIL import Image, ImageOps from huggingface hub import snapshot download from safetensors import safe open from safetensors.torch import load file from transformers import AutoModel, AutoTokenizer model name = "baidu/Unlimited-SVG" image path = sys.argv 1 def flatten alpha image : """Composite transparent pixels onto white so they do not turn black.""" if image.mode not in "RGBA", "LA", "PA" and "transparency" not in image.info: return image.convert "RGB" rgba = image.convert "RGBA" white = Image.new "RGB", rgba.size, 255, 255, 255 white.paste rgba, mask=rgba.getchannel "A" return white model path = snapshot download model name tokenizer = AutoTokenizer.from pretrained model path, trust remote code=True options = {"low cpu mem usage": True} weights = list Path model path .glob "model .safetensors" if len weights == 1: with safe open weights 0 , framework="pt", device="cpu" as shard: metadata = shard.metadata if metadata is None: options = {"low cpu mem usage": False, "state dict": load file weights 0 } model = AutoModel.from pretrained model path, trust remote code=True, use safetensors=True, torch dtype=torch.bfloat16, attn implementation="eager", options, .eval .cuda original generate = model.generate def generate args, kwargs : kwargs.pop "temperature", None kwargs.update max new tokens=30000, no repeat ngram size=0, do sample=False, repetition penalty=1 return original generate args, kwargs model.generate = generate with TemporaryDirectory as directory: prepared = Path directory / "input.png" with Image.open image path as image: ImageOps.pad flatten alpha ImageOps.exif transpose image , 2048, 2048 , method=Image.Resampling.BICUBIC, color= 127, 127, 127 , .save prepared with torch.inference mode : raw = model.infer tokenizer, prompt="