ERNIE Unlimited SVG: Baidu's 0.5B Model for Editable Vector Art
ERNIE Unlimited SVG is Baidu's open multimodal model that redraws an image as structured, editable SVG code using about 0.5B activated parameters. Released on 1 December 2026, it compresses a 2048×2048 image into 1,024 vision tokens and generates outputs beyond 10,000 tokens. This guide covers its architecture, inference scripts, temperature settings, and practical limits.
View 2 referencesAllow the functional cookie to save your likes. Privacy details
ERNIE Unlimited SVG is Baidu's open-weight multimodal model that redraws an input image as structured, editable SVG code. Released on 1 December 2026, it activates only about 0.5 billion parameters per token yet generates SVGs exceeding 10,000 tokens. This guide covers how it works, how to run it locally, and where its limits are.
What is ERNIE Unlimited SVG?
ERNIE Unlimited SVG is a multimodal model from Baidu's ERNIE team that converts an image into a structured, editable SVG document. Released on 1 December 2026, it redraws objects layer by layer rather than tracing pixels, and activates roughly 0.5 billion parameters per decoded token. Weights are on Hugging Face and ModelScope.
The official repository describes the project as "Trace On — Projection of Visual Worlds into SVG-Anything". Baidu positions it as a follow-up to the Unlimited OCR family and as a step toward language models that reason about physical structure.
How does ERNIE Unlimited SVG turn a photo into vectors?
Unlike pixel-tracing vectorizers, the model reasons about objects, contours, colours, and spatial relationships. It separates foreground from background, infers occluded regions, and draws layers in a sensible order. The output contains exact coordinates, grouped shapes, and layer information, so individual elements can be edited after generation.
This is closer to a human illustrator rebuilding a scene than to a contour sampler. A complex image can produce more than 10,000 tokens of SVG source, and the result can be re-rendered for pixel-level verification.
Why is a 0.5B model able to generate 10,000-token SVGs?
Efficiency comes from both ends. On the input side, DeepEncoder compresses a 2048×2048 image into just 1,024 vision tokens while retaining small text, thin strokes, and precise coordinates. On the output side, a mixture-of-experts decoder activates only about 0.5B parameters per token, keeping long generations fast.
The model is built on DeepSeek-OCR. That lineage explains the aggressive visual compression: the same trick used to read very long documents is repurposed to describe a picture in code. A short visual prefix plus sparse decoding is what makes local, real-time-ish generation plausible.
What can I actually edit in the generated SVG?
Because the picture is expressed as independent shapes, you can change a single element's colour, size, or position without regenerating the whole image. Baidu and its coverage show use cases including portraits, product objects, CAD drawings, paper figures, architectural elevations, and floor plans, where layered structure matters more than photographic texture.
For documentation work, this means a figure can be re-labelled or re-laid-out downstream. For design work, the SVG is a starting draft rather than a finished asset; expect to clean up paths and grouping in a vector editor.
How do I run ERNIE Unlimited SVG locally?
The official repository provides two inference paths: Transformers and vLLM. Both expect a square 2048×2048 canvas created with ImageOps.pad, no tiling, and transparent pixels composited onto white. The example below follows the official Transformers script and validates the SVG before saving it.
# Simplified from the official infer_hf.py
import re
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 transformers import AutoModel, AutoTokenizer
model_path = snapshot_download("baidu/Unlimited-SVG")
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModel.from_pretrained(
model_path, trust_remote_code=True, torch_dtype=torch.bfloat16,
attn_implementation="eager", low_cpu_mem_usage=True,
).eval().cuda()
with TemporaryDirectory() as d:
prepared = Path(d) / "input.png"
with Image.open("photo.png") as image:
ImageOps.pad(image.convert("RGB"), (2048, 2048),
color=(127, 127, 127)).save(prepared)
raw = model.infer(tokenizer, prompt="<image> SVG:",
image_file=str(prepared), output_path=d,
base_size=2048, image_size=2048, crop_mode=False)
svg = re.search(r"<svg\b.*?</svg>", raw, re.DOTALL).group()
ElementTree.fromstring(svg)
Path("output.svg").write_text(svg, encoding="utf-8")
Note that the official script pins Transformers 4.46.3 and sets max_new_tokens to 30,000. A BF16-capable NVIDIA GPU and x86-64 Linux are expected.
Which temperature settings should I use?
The repository runs greedily by default, which suits geometry that must stay exact. Baidu recommends temperatures of 0 to 0.3 for CAD, diagrams, and charts to preserve precise text and shapes, and 0.5 to 0.8 for natural scenes and photos to avoid repetitive stroke loops during long generations.
Greedy decoding is also the safest starting point when you plan to diff the SVG output. Raise temperature only after you have measured how often the model enters repetition loops on your own image category.
What are the limits of ERNIE Unlimited SVG?
It is a research release, not a polished design tool. The model is built on DeepSeek-OCR, needs a CUDA GPU and roughly 30,000 output tokens of headroom for complex images, and the repository's LICENSE should be read before commercial use. Quality on dense photographs may be weaker than on line art.
The output also depends on the 2048×2048 preprocessing contract. Images are padded rather than tiled, so extreme aspect ratios lose effective resolution.
Frequently asked questions about ERNIE Unlimited SVG
Readers usually ask about licensing, hardware, and how this differs from ordinary image vectorization. In short: check the repository LICENSE, a BF16-capable NVIDIA GPU is expected, and the key difference is semantic layer reconstruction instead of pixel contour tracing. Benchmark tables on the project page should be read as vendor-reported results.
Is ERNIE Unlimited SVG really only 0.5B parameters?
The 0.5B figure refers to activated parameters per decoded token, not the total parameter count. The decoder uses a mixture-of-experts design that routes each token to a small subset of experts, which is why a much larger model can behave like a compact one at inference time.
Can I use the output commercially?
Read the LICENSE file in the official repository before shipping. The weights are hosted openly on Hugging Face and ModelScope, but open hosting does not itself grant commercial rights. Confirm the exact terms, and check whether generated SVGs inherit any attribution requirement.
How does it compare with a normal vector trace tool?
A conventional tracer converts pixels into paths without understanding the scene. ERNIE Unlimited SVG infers objects, occlusion, and layer order, then emits grouped shapes with coordinates. That makes the result editable by element, but it also means output is generated, not guaranteed to match the source exactly.