Skip to content
,

Unlimited-SVG: Convert Any Image to Editable SVG Free with Baidu’s Local AI (2026)

9–14 minutes
Woman in a brick-walled loft holding a tablet with an Unlimited-SVG card, hook image to SVG free local AI

Turning a PNG into a clean, editable SVG has always meant one of two things: an auto-tracer that gives you thousands of blobby paths, or an hour of redrawing by hand. Unlimited-SVG, released by Baidu on 1 December 2026, tries a third way. It looks at the picture and writes fresh SVG code for it, the way a designer would redraw it.

The model is free, MIT licensed and small enough (about 3B parameters in BF16) to run on a single consumer NVIDIA GPU. It reached 3,000 GitHub stars within days, and community apps, Spaces and ComfyUI ports appeared almost straight away.

This guide covers what the model does, the exact install steps from Baidu’s repo, both ways to run it (plain Transformers or a vLLM server), the settings that matter, where it beats an auto-tracer and where it does not, and how to use the free online demos if you do not have the GPU.

Everything here is checked against the official model card, the GitHub repo and the project page as of 6 December 2026.

TL;DR

  • What: an image to SVG model that redraws your picture as structured SVG code, not a pixel trace.
  • Size: about 3B parameters in BF16 (roughly a 6 to 7 GB download), with only about 0.5B active per token thanks to a mixture-of-experts decoder.
  • License: MIT, so commercial use is allowed.
  • Runs on: x86-64 Linux (WSL2 works the same way) with an NVIDIA GPU that supports BF16.
  • Two scripts: infer_hf.py (Transformers, simplest) and infer_vllm.py (vLLM server, faster for many files).
  • No GPU? Try the official Hugging Face Space or one of the community ZeroGPU Spaces.

New to running models on your own PC? My VRAM guide explains what fits on which GPU.

What Unlimited-SVG Is

Unlimited-SVG comes from Baidu’s ERNIE multimodal team. It is built on top of DeepSeek-OCR, the document model that compresses a whole page into a small number of vision tokens. Baidu reuses that idea for graphics.

Here is how it works, according to the model card:

  • The encoder (DeepEncoder) squeezes a 2048 x 2048 image into 1,024 vision tokens.
  • The decoder is a mixture-of-experts language model. It activates only about 0.5B parameters for each token it writes, which keeps long outputs fast.
  • The output is plain SVG markup: shapes, paths, fills and text elements you can open in Inkscape, Illustrator, Figma or a code editor.

Baidu’s headline claim is that it “sustains real-time generation well past 10,000 tokens”. That matters because a detailed SVG can easily run to 10,000 or 20,000 tokens of code. The repo scripts allow up to 30,000 new tokens per image.

Key facts in one place:

Item Detail
Release 1 December 2026
Developer Baidu ERNIE Multimodal Team
Base DeepSeek-OCR architecture (deepseek_vl_v2)
Parameters About 3B total, about 0.5B active per token
Precision BF16 safetensors
License MIT
Input One raster image, padded to 2048 x 2048
Output SVG code (saved as output.svg)
Needs trust_remote_code

There is no technical report yet. The project page says one is “coming soon”, and no benchmark table has been published. Baidu compares itself to big closed models in prose only, so treat quality claims as the vendor’s own until independent tests appear.

Model Redraw vs Auto-Trace

It helps to understand why this is different from Image Trace in Illustrator, Inkscape’s Trace Bitmap or Potrace.

An auto-tracer follows the edges of coloured pixel regions. It is fast and faithful, but it has no idea what it is looking at. A gradient becomes dozens of stepped bands, text becomes outlines that you cannot edit, and a simple circle can come out as a lumpy 40-point path.

Unlimited-SVG works more like a designer redrawing the artwork. It decides “this is a circle”, “this is a line of text”, “this is a rounded rectangle” and writes the matching SVG element. The good side is cleaner, smaller, editable files. The other side is that it is a new drawing, so small details can change.

Auto-tracer (Potrace, Image Trace) Unlimited-SVG
Method Follows pixel edges Writes new SVG code
Speed Seconds Seconds to minutes, depends on detail
Text Outlined shapes Can come out as text elements
File size Often large Usually compact
Faithfulness Very close to source Close, but a redraw: check details
Hardware Any CPU NVIDIA GPU

So keep the tracer for exact pixel copies, and reach for Unlimited-SVG when you want something a human could actually edit.

Hardware and Requirements

Baidu’s stated requirements are short: “x86-64 Linux, a compatible NVIDIA driver, and a free BF16-capable GPU.” The scripts call .cuda() directly, so there is no CPU or Apple Silicon path in the official code.

  • GPU: any NVIDIA card with BF16 support, which means RTX 30 series (Ampere) or newer. Baidu does not publish a VRAM figure. A 3B BF16 model needs about 6 to 7 GB for weights alone, plus working memory for long outputs, so plan on a 12 GB card or larger to be comfortable.
  • Windows: run it inside WSL2 Ubuntu. The commands are identical.
  • Disk: about 7 GB for the weights plus the Python environment.
  • Python: 3.12, installed through uv in Baidu’s instructions.

Speed depends mostly on how much SVG code the picture needs. A flat icon may finish in seconds. A busy illustration that needs 12,000 tokens took about four minutes on an RTX 5090 in one port author’s test reported by Kombitz. That is a second-hand figure, but it gives you a sense of scale.

Install and Run with Transformers

This is the simplest path and the one to start with.

Step 1: Clone the repo

git clone https://github.com/baidu/Unlimited-SVG
cd Unlimited-SVG

Step 2: Create the environment

Baidu pins exact versions. Copy this as it is from the model card:

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

If you do not have uv, install it first with pip install uv. The old Transformers version (4.46.3) is on purpose. The DeepSeek-OCR remote code was written against it, so do not “upgrade” it.

Step 3: Convert an image

CUDA_VISIBLE_DEVICES=0 .venv-svg-hf/bin/python infer_hf.py /path/to/image.png

The first run downloads the weights from Hugging Face. When it finishes you get two files in the current folder:

  • output.txt: everything the model wrote, kept for debugging.
  • output.svg: the extracted <svg>...</svg> block, already checked as valid XML.

What the script does to your image

Reading infer_hf.py tells you a few useful things:

  • It fixes phone photo rotation (EXIF transpose).
  • Transparent areas are flattened onto white, so a transparent PNG logo does not turn black.
  • The image is padded (not stretched) to 2048 x 2048 with mid-grey borders.
  • Decoding is greedy (do_sample=False) with up to 30,000 new tokens.
  • If no complete SVG is found it stops with “Incomplete SVG. See output.txt.”

Because the image is padded to a square, a very wide banner gets a lot of grey padding. Crop to the part you need first for better detail.

Faster Batches with vLLM

If you want to convert a folder of icons, the vLLM path is faster and keeps the model loaded between images. It uses a separate environment with newer packages:

uv venv .venv-svg-vllm --python 3.12
uv pip install --python .venv-svg-vllm/bin/python vllm==0.33.0 torch==2.14.0 nvidia-cudnn-cu13==9.24.0.43 openai==3.60.0 pillow==13.0.0

The README then runs a short patch script that sets vLLM’s DeepSeek-OCR processor to a 2048 base size with cropping off. Copy that block from the GitHub README exactly. Without it the image is processed at the wrong size.

Start the server (shortened here; the full command with library paths is in the README):

.venv-svg-vllm/bin/vllm serve baidu/Unlimited-SVG --served-model-name Unlimited-SVG --trust-remote-code --limit-mm-per-prompt '{"image":1}' --max-model-len 32768 --max-num-seqs 1 --gpu-memory-utilization 0.8 --host 127.0.0.1 --port 10000

Then convert images with the client script:

.venv-svg-vllm/bin/python infer_vllm.py /path/to/image.png

The client sends the image to the local OpenAI-compatible endpoint, streams the result into output-vllm.txt, and saves output-vllm.svg. A simple shell loop over a folder turns it into a batch converter. If you have used a local OpenAI-style server before, such as in my vLLM install guide, this will feel familiar.

Note --gpu-memory-utilization 0.8: vLLM grabs 80 percent of your VRAM up front. Lower it if you share the GPU with ComfyUI or a game.

Settings That Change the Result

There are not many knobs, but temperature matters. The model card’s advice:

Image type Suggested temperature Why
CAD drawings, diagrams, charts 0 to 0.3 Precise, repeatable lines
Photos and natural scenes 0.5 to 0.8 Avoids the model looping on the same shapes

Two gotchas:

  • The Transformers script throws away any temperature you pass and forces greedy decoding. To sample you must edit the generate wrapper in infer_hf.py.
  • The vLLM client sends temperature=0. Change that value in infer_vllm.py for photos.

The other “setting” is your input. Clean, high-contrast artwork gives the best SVGs. Upscale tiny icons before you convert them; my local background removal guide also helps if you need to isolate a logo from a photo first.

Free Online Demos

No suitable GPU? Several Hugging Face Spaces host the model. The official one is baidu/Unlimited-SVG, and the release notes link a ZeroGPU version by AK at akhaliq/Unlimited-SVG-ZeroGPU. Others include a WebGPU build and an “SVG studio” Space.

ZeroGPU Spaces share hardware and have daily time limits, so long SVGs can time out. They are fine for testing a handful of images before you commit to a local install. The project’s own demo page currently points to a temporary tunnel address, so the Hugging Face Spaces are the steadier choice.

ComfyUI and Desktop Apps

Within a day of release, Kombitz reported two community ComfyUI nodes, a Mac app, a Windows app that exports layered Photoshop files and a Pinokio one-click launcher. I could not confirm official repo links for these at the time of writing, so I am not linking them here.

If you go looking, check three things before installing any of them:

  1. The repo links to baidu/Unlimited-SVG as the model source, not a re-upload.
  2. It tells you which folder the weights go in. Most ports download to the Hugging Face cache rather than a ComfyUI models folder.
  3. It has been updated recently and has open issues being answered.

Running the official scripts is still the most reliable way, and they are short enough to read in full. For the general ComfyUI basics, see my ComfyUI guide.

A Practical Logo and Icon Workflow

Here is a sensible way to use it for real design work:

  1. Prepare: crop tightly, remove the background, and make sure the art is at least 1024 px on the long side.
  2. Convert: run infer_hf.py at the default greedy setting.
  3. Inspect: open output.svg in a browser next to the original. Check lettering, faces and small marks. Kombitz specifically warns to compare logos and text against the source, because the model redraws rather than copies.
  4. Clean up: open the SVG in Inkscape or Figma. Fix colours to your brand values and correct any letterforms.
  5. Optimise: run it through SVGO or Inkscape’s “Optimized SVG” save to strip extra decimals.

For icon sets, the vLLM server plus a loop gives you a first pass on dozens of files while you get on with other work. Then fix the few that came out wrong.

A word on rights: an MIT license on the model does not give you rights to someone else’s logo. Only vectorise artwork you own or are allowed to use.

Common Problems and Fixes

Problem Cause Fix
“Incomplete SVG. See output.txt.” Output hit the token limit or looped Crop to less detail, or for photos raise temperature to 0.5 to 0.8
Transparent logo has a black box Alpha not flattened Use Baidu’s scripts, which composite onto white
Import errors about the model class Wrong Transformers version Use the pinned 4.46.3 in a fresh venv
CUDA out of memory Another app holds VRAM, or vLLM reserved too much Close other GPU apps, lower --gpu-memory-utilization; see my CUDA out of memory fix
Fine text is wrong Small text at 2048 px canvas Crop closer to the text area and convert again
Wide banner loses detail Padding to a square Split the banner into sections

FAQ

Is Unlimited-SVG free?

Yes. The weights and code are under the MIT license, which allows commercial use.

Can it run on Windows?

The official scripts target Linux. On Windows, install WSL2 with Ubuntu and follow the same commands.

Does it work on a Mac?

Not with the official code, which needs an NVIDIA CUDA GPU. Use a Hugging Face Space instead, or wait for community Mac ports to mature.

How much VRAM do I need?

Baidu does not give a number. The weights are about 6 to 7 GB in BF16, so a 12 GB card is a sensible minimum for long outputs.

Is it better than Illustrator Image Trace?

It is different. It gives cleaner, more editable files, but it redraws the image, so details can shift. Tracing stays more faithful pixel for pixel.

Can it convert photos to SVG?

Yes, the card covers natural scenes, but expect a stylised result. Use a temperature of 0.5 to 0.8 to avoid repetition.

Where are the ComfyUI nodes?

Community nodes exist according to news reports, but I could not verify official links yet. The Python scripts from Baidu’s repo are the safest route today.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a brick-walled loft holding a tablet with an Unlimited-SVG card, hook image to SVG free local AI