Image Generation

0.5B active parameters, 6.67GB of weights: Baidu open-sources a model that redraws any image as editable SVG

December 1, 20263 views阅读中文原文
0.5B active parameters, 6.67GB of weights: Baidu open-sources a model that redraws any image as editable SVG

On December 1, Baidu's ERNIE multimodal team released Unlimited SVG under the MIT license. Hand it a photo, a screenshot, a floor plan or a parts diagram, and it first works out what is in the picture and what sits in front of what, then redraws the scene stroke by stroke in lines and colour blocks.

What comes out is code, not pixels. Every shape carries coordinates, text stays text, layers stay separate, and the file opens in Illustrator or Figma with each element still editable.

The weights are 6.67GB, the license is MIT, and the model is on both Hugging Face and ModelScope. The GitHub repo ships full inference scripts. It passed 500 stars on launch day.

TL;DR

  • In one line: it translates a bitmap into editable vector code. This is a redraw, not an auto-trace.
  • The backbone is DeepEncoder from DeepSeek-OCR, paired with a mixture-of-experts decoder that activates roughly 0.5B parameters per token.
  • A 2048×2048 image is compressed into 1,024 vision tokens, so a long output does not burn the context window before it starts.
  • Baidu says generation stays real-time past 10,000 tokens, which is what makes complex drawings possible at all.
  • MIT license, so commercial use needs no negotiation.

What it actually does

The usual "image to vector" tool traces edges. It walks the colour boundaries, emits a pile of fragmented paths, turns text into shapes, and forces you to redraw everything when a single word changes.

Unlimited SVG takes a different route. The project page describes it as copying the way a human artist studies a reference: separate foreground from background, infer the parts hidden behind overlapping shapes, then rebuild the scene layer by layer in a logical order.

The gap shows up on messy input. A dense PDF layout, a CAD drawing, an annotated flowchart: tracing turns those into spaghetti, redrawing turns them into layers you can edit.

Why this one is worth a look

Three numbers carry the story.

1,024 vision tokens. A full 2048×2048 image becomes 1,024 tokens before decoding begins. Baidu says small type, thin strokes and exact coordinates survive the squeeze.

0.5B active parameters. IT Home reports roughly 3B total parameters in a mixture-of-experts design that wakes about 0.5B per token. That is why a 6.67GB download runs at all.

10,000+ tokens of real-time output. A complicated image produces SVG source well past ten thousand tokens, a length where large models slow to a crawl. The compression ratio above is what gets it through.

ItemValueSource
LicenseMIT, copyright 2026 BaiduOfficial LICENSE
Weight size6.67GB, single safetensors fileHugging Face file list
Total parametersabout 3BIT Home report
Active per tokenabout 0.5BOfficial README
Input resolution2048×2048 global pass, no tilingOfficial README
Vision tokens1,024Official README
Context length32,768vLLM launch flags

How to use

There are two paths, both on x86-64 Linux, both needing a GPU with BF16 support. No Windows build, and Apple silicon is out.

The first is Transformers, which means installing a stack and running one script:

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
CUDA_VISIBLE_DEVICES=0 .venv-svg-hf/bin/python infer_hf.py /path/to/image.png

One detail in the reference script is worth copying. It resizes the long edge to 2048, then centres the image on a grey 2048×2048 canvas without tiling. Images with an alpha channel get composited onto white first, otherwise transparent pixels come out black.

The second path is vLLM, meant for running many images in a row. The launch flags set --max-model-len to 32768, hand 0.8 of GPU memory to the server, and serve one request at a time.

PathGood forWatch out
TransformersTrying it once, tuning, reading the sourceOne GPU is enough; first run pulls 6.67GB
vLLMBatches and throughputStartup waits on compilation; --max-num-seqs 1 is Baidu's own setting
ModelScopeDownloads inside mainland ChinaMirrored the same day, December 1

After generation, do one thing the official script already does: pull the <svg> block out with a regex and run it through an XML parser. If parsing fails, the output was truncated. Rerun it rather than shipping a broken file.

Who it's for

  • Design handoff: a client sends a screenshot and asks for the source file. Redraw it, then fix the details.
  • Drawing digitisation: floor plans, parts diagrams and CAD screenshots turned into editable vectors.
  • Layout recovery: PDF pages and figures from papers, converted into editable primitives.
  • Front-end work: design comps rebuilt as SVG icons and illustrations, which beats slicing PNGs.
  • Chart remakes: someone else's bar chart redrawn in your own palette.

Not a good fit

  • Photo retouching. It does not do local repaint, watermark removal or face swaps. That is an image-editing model's job.
  • Upscaling. This is a redraw, not super-resolution. Fine detail is inferred, and skin texture does not come back.
  • Photoreal output. The target is structure, not surface.
  • Machines without an NVIDIA card. The official path is CUDA only.
  • Anyone who wants a web page with a button. This is weights plus scripts.

Pitfalls

The first trap is reading the project's comparison chart as an evaluation. The page pits itself against GPT-6.2 Astra, Claude Fable 5.2 and Gemini 4 Argon, all on the authors' own harness with no third-party scores. Pandaily made the same point in its coverage: that framing belongs to the project, it is not an independent verdict. Winning on a bench you built yourself, how much does that tell you?

The second is ignoring the temperature guidance. Baidu gives ranges: for CAD, diagrams and charts where geometry must hold, keep it between 0 and 0.3. For natural scenes and photos, push to 0.5 to 0.8, or the model falls into repetitive strokes.

The third is feeding it a 4K image. Only the 2048×2048 global pass is validated, with no tiling. Downscale first instead of hoping it splits the canvas itself.

Cost and time

Money is the easy part. MIT license, free weights, no royalty for commercial use. What you spend is VRAM and electricity.

On time, the first run downloads 6.67GB and later runs hit the cache. Baidu gives no single figure for per-image generation, only the claim that it holds real-time speed past 10,000 tokens. Your actual number depends on image complexity and the card, so measure it yourself.

Compare that with hosted APIs. A per-image endpoint usually bills by output tokens, and a complex drawing runs past ten thousand of them, which is not cheap. Locally, the marginal cost is the power bill.

My read

The problem it solves is reconstruction, not generation. Those two words get mixed up constantly in the image-model conversation, but for designers, front-end developers and anyone working with drawings, the difference is overtime versus a normal week.

What surprised me is the size. A 3B model with 0.5B active parameters producing ten-thousand-token SVG was not a realistic proposition six months ago. You could call it one more small-model-beats-big-model story, and I would not argue, but the more interesting choice is the track: SVG as the native output format.

Do not put it in production yet, though. Third-party evaluation does not exist, community fine-tunes have barely started, and whether quality holds on dense layouts is something you have to test on ten of your own images.

Next step

First, open baidu/Unlimited-SVG on Hugging Face, read the temperature notes and the VRAM requirements in the model card, and confirm your card handles BF16. Then pick three of your own images, a simple icon, a screenshot and a complicated drawing, and compare which category comes out usable.

Run that test and you will notice the strength is not how closely it copies. It is how much of the copy you can still change.

Sources

  • Official model card and weights: https://huggingface.co/baidu/Unlimited-SVG
  • Official project page: https://unlimited-svg.github.io/
  • Official code repository: https://github.com/baidu/Unlimited-SVG
  • Official launch post: https://x.com/Baidu_Inc/status/2127594465800204412
  • IT Home report (via ifeng): https://tech.ifeng.com/c/8yVDewyI0n9
  • Pandaily report: https://pandaily.com/baidu-unlimited-svg-open-source-image-to-vector

This article is compiled from multiple media reports, together with the official README and project page. The comparison figures are the project's own claims and have not been independently verified.

Sources

Comments

0 published
Log inorsign up to leave a comment.

Loading comments...