ptdove-jiuzi/Picture2SVG
Sobre
Turn any picture into structured, editable, layered SVG on Windows - local CPU or NVIDIA CUDA. A/B slider, Photoshop-style layers, layered PSD export, DeepSeek AI layer naming. Powered by Baidu Unlimited-SVG (MIT).
IA e aprendizado de máquinaCrescimento medido de estrelas
- em 24 h
- +1
- em 7 dias
- Coletando histórico
- em 15 dias
- Coletando histórico
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Original
Picture2SVG
Turn any picture into structured, editable, layered SVG — locally, on Windows.
A/B slider comparison · Photoshop-style layer panel · Layered PSD export · DeepSeek AI layer naming · EN / 中文
⬇️ Direct Download
No Python. No CUDA toolkit. No dependencies. Pick one file and run.
| Download | Size | What it is |
|---|---|---|
| ⬇ Picture2SVG-Setup.exe | 65.5 MB | Recommended. Graphical Windows installer: choose install folder, create desktop / Start Menu shortcuts, launch when done. |
| ⬇ Picture2SVG.exe | 65.4 MB | Portable single file. No _internal folder, no install — copy anywhere and double-click. |
→ See all builds on the Releases page · Windows 10 / 11, x64
First launch: a 2-step onboarding guide
The app is intentionally tiny (65 MB). The heavy parts are fetched on demand, from official upstream sources, into a folder you choose:
| Step | What happens |
|---|---|
| 1 · Runtime ~250 MB CPU ~2.7 GB CUDA |
The onboarding guide detects your GPU and offers NVIDIA CUDA 12.4 or CPU PyTorch. One click downloads and configures an isolated Python 3.12 runtime — every package from its official source: python.org · download.pytorch.org/whl/cu124 · /whl/cpu · pypi.org. Live progress + pip log in the dialog. |
| 2 · Model 6.67 GB |
baidu/Unlimited-SVG weights are downloaded from Hugging Face, hf-mirror.com or ModelScope — resumable, or point at a folder you already have. |
Nothing is bundled, nothing is silently installed system-wide: the runtime lives in a folder you pick and can be deleted like any other folder.
📸 Screenshots
A/B slider — original on the left, vector redraw on the right, drag the divider

Photoshop-style layer panel — visibility, solo, rename, reorder, per-layer export

First-run onboarding — bilingual, detects your GPU |
Runtime Environment — official PyTorch install, live log |
🖼 Real-world examples
Every pair below is an unedited field run on a stock build — left half is the original raster, right half is the actual exported SVG re-rendered as-is. No retouching, no cherry-picking. Each caption links the raw .svg (20–50 KB!) so you can drop it straight into Illustrator / Inkscape / Photoshop and inspect the layers yourself — the dot-separated names are the model's own semantic layer groups.
Wild bird close-up — Canon EOS-1D X Mark II · 5472×3648 → 8 layers
|
Bird in bright foliage — Canon EOS-1D X Mark II · 5472×3648 → 7 layers
|
Golden retriever portrait — 1536×1536 → 12 layers
|
Perched bird — most granular photo run — 2339×2339 → 14 layers
|
Modern glass tower — noise-reduced shot · 5472×3648 → 7 layers
|
AI-generated park bench — MiniMax H3 t2i · 2496×1664 → 14 layers
|
AI-generated misty lake — MiniMax H3 t2i · 5024×3360 → 7 layers
|
Anime character, front view — deepest tree — 1760×1344 → 22 layers
|
①②⑤ are real photographs (①② on a Canon EOS-1D X Mark II); ⑥⑦ are AI-generated stills and ⑧ an illustration — included to show how layering behaves on synthetic art. Raster files over 4 MB were recompressed for repo weight; the SVGs are byte-for-byte the app's exports.
✨ Why this is different
Most image→SVG tools give you one flat path soup. Picture2SVG gives you a layered document you can actually edit — because Unlimited-SVG redraws images stroke-by-stroke into grouped, id-tagged SVG elements, and this app turns every one of them into a real layer.
| Feature | Details |
|---|---|
| 🎚 Five comparison modes | Slider (drag / arrow keys ±1 %, Shift ±5 %) · Side by side · Crossfade (mouse wheel) · Difference heatmap · Hold Space to flip. Fully hot-switchable, divider position preserved. Either side can show the original or the SVG composite — mix freely. |
| 🗂 Real layer tree | Every top-level SVG child becomes a layer (structure-agnostic: works with any model output). Eye toggle, Alt+click for Solo, double-click rename, drag to reorder paint order, per-layer export checkbox, delete, live-rendered thumbnails and colour swatches. |
| 💾 Layered PSD export | Not a flattened image — a genuine Photoshop document with one layer per SVG group, correct names, correct visibility state, and a flattened composite preview baked in. |
| ⏹ Stop anytime, keep the work | Generation is streamed token by token with live re-render. Stop during decoding → the partial SVG is auto-closed and stays fully editable. Stop during vision prefill → the worker is recycled in 1.6 s (nothing had been produced yet). |
| 🤖 AI layer naming | Optional DeepSeek (any OpenAI-compatible endpoint) reads each layer's structure — element type, geometry, palette, text content — and returns professional layer names + semantic groups, in English or Chinese. |
| 🌐 Bilingual UI | English by default. One click on `EN / 中文` — or the picker in Settings — and the whole interface, dialogs, onboarding guide and default layer names switch instantly, no restart. |
| 🧠 Runs on your terms | CPU-only laptop or NVIDIA GPU. Zero-copy `mmap` weight loading on Windows (≈2 s model load, ~350 MB private RAM) so 16 GB machines work; BF16 CUDA when a card is present. AMD/Intel GPUs simply fall back to CPU. |
| ✈️ No model redistribution | The app contains no weights and ships no torch build. Both come straight from official mirrors, so licensing stays clean and the download stays 65 MB. |
🚀 Quick start
Option A — Installer (recommended)
- Download
Picture2SVG-Setup.exefrom Releases. - Run it, pick a folder, tick desktop shortcut, click Install Now.
- Follow the 2-step onboarding guide → then open an image and press Vectorize.
Option B — Portable
Copy Picture2SVG.exe anywhere (USB stick works) and double-click it.
Option C — From source
git clone https://github.com/ptdove-jiuzi/Picture2SVG.git
cd Picture2SVG
uv venv .venv --python 3.12
uv pip install --python .venv\Scripts\python.exe -r requirements.txt
python run.py
Source mode needs the AI packages locally (requirements.txt). The packaged EXE does not — it fetches them through Settings.
⚙️ Hardware & measured performance
All numbers below are measured, not estimated — Intel i5-12490F (6C/12T), 16 GB RAM, no NVIDIA GPU, mmap precision, 1024 × 1024 inference:
| Stage | Measured |
|---|---|
Model load (mmap, zero-copy) |
~2 s, ~350 MB private RAM |
| Vision encoding + prefill | ~52 s |
| Token decoding | 17.5 tok/s |
| Simple image end-to-end (235 tokens) | 76 s |
| Complex image (≈10 k tokens) | ~10 min — interruptible, partial result kept |
| Resident working set | ~6.4 GB (file-backed pages, not commit) |
With an NVIDIA GPU the same build runs the official BF16/CUDA path (torch.autocast("cuda", bfloat16), 2048 × 2048 global view) and is dramatically faster. GPU timings are hardware-dependent and were not measured on the development machine — contributions of benchmark numbers are welcome.
| Tier | Requirement | Recommended settings |
|---|---|---|
| CPU | 16 GB RAM, AVX2, ~3 GB free on the runtime drive | resolution 1024, precision auto (mmap), low-memory attention ON |
| CPU (tight RAM) | 8 GB RAM | resolution 1024, close other apps |
| NVIDIA GPU | Any BF16-capable card (12 GB+ VRAM comfortable) | resolution 2048, precision auto (BF16) |
🧩 How it works
┌────────────── Picture2SVG.exe (65 MB, no torch inside) ───────────────┐
│ Qt GUI: A/B compare view · layer panel · settings · onboarding │
│ │
│ QProcess ──JSON-lines──► <your runtime>/python.exe │
│ -m picture2svg.core.worker │
│ │ │
│ ├─ model_loader (mmap / BF16) │
│ ├─ runner (stream + abort)│
│ └─ svg doc (partial-safe) │
│ │
│ Exports (GUI thread): SVG (all / checked / visible) · PSD · PNG │
└─────────────────────────────────────────────────────────────────────┘
▲ ▲
official Python + PyTorch baidu/Unlimited-SVG weights
(python.org / pytorch.org) (Hugging Face · hf-mirror · ModelScope)
Why a subprocess? The model needs ~6.7 GB; the GUI needs ~150 MB. Isolating inference means the model can be unloaded on idle, cancelled safely, and a crash can never take the editor down with it.
Why is the EXE only 65 MB? PyTorch and Transformers are excluded from the build and executed by the external runtime you configure. The app also ships a tiny copy of the worker sources so that runtime can run them without a checkout.
picture2svg/
├── core/ worker (stdio protocol) · runner (device-agnostic inference)
│ env_manager (official runtime installer) · hw_probe · model_manager · deepseek
├── svg/ document (layer tree, partial-safe parsing) · render (Qt rasterizer)
├── export/ exporters (SVG / PSD / PNG) · psd (pytoshop compatibility layer)
└── ui/ main_window · compare_view · layer_panel · settings_dialog
model_wizard (onboarding) · inference_bridge · icons
❓ FAQ
The runtime download failed / is slow. What now?
Retry — pip resumes where it stopped. Behind a slow link to PyPI, switch PyPI Package Index to the Tsinghua mirror in Settings → Runtime Environment. You can also press Browse… and select any existing Python 3.12 environment that already has torch + transformers.
Do I need to install CUDA or cuDNN myself?
No. The CUDA build pulls the official PyTorch wheels, which bundle the CUDA 12.4 runtime. You only need a reasonably recent NVIDIA driver. If no NVIDIA GPU is found the app stays on CPU automatically.
I have an AMD / Intel GPU. Can it be used?
The upstream model pipeline is CUDA-oriented, so non-NVIDIA cards run in CPU mode. It works, just slower.
Why `mmap` precision on Windows?
Official PyTorch Windows wheels ship without the INT8 quantized::linear CPU kernels, and resident BF16 needs ~8 GB of free commit. Memory-mapping the safetensors file keeps full BF16 fidelity while letting the OS page weights in and out — the model file itself is the backing store. Linux builds can use stream-quantized INT8 instead.
Where is my data / API key stored?
%APPDATA%\Picture2SVG\config.json. The DeepSeek key never leaves your machine except in requests to the endpoint you configure. Images are only read from disk and passed to your local model.
The output SVG has too few / too many layers.
Raise Max Generated Tokens (complex photos need 10 000+). For photos, try temperature 0.5–0.8 to avoid repetitive strokes; for CAD, diagrams and charts keep 0–0.3. You can also stop early and edit the partial result.
🙏 Model attribution
This project is a Windows front-end. All of the intelligence comes from Baidu's open-source model — please cite the model, not just this app.
| Model | baidu/Unlimited-SVG — “Unlimited SVG Works: Trace On — Projection of Visual Worlds into SVG-Anything” |
| Author | Baidu Inc. — ERNIE Multimodal Team |
| License | MIT |
| Size | 3.34 B parameters total · ≈0.5 B activated per token (MoE) |
| Lineage | Built on DeepSeek-OCR: DeepEncoder compresses a 2048 × 2048 image into 1024 vision tokens; a DeepSeek-V2 MoE decoder redraws it as SVG |
| Links | GitHub · Hugging Face · ModelScope · Project page |
@misc{unlimitedsvg2026,
title = {Unlimited SVG Works: Trace On -- Projection of Visual Worlds into SVG-Anything},
author = {Baidu ERNIE, Multimodal Team},
year = {2026},
url = {https://unlimited-svg.github.io/}
}
How this repository relates to the official code
The upstream inference script targets Linux + CUDA. This project does not change the model's mathematics; it:
- reimplements
model.infer()'s global-view path (crop_mode=False) in a device-agnostic way so it runs on Windows CPU and CUDA; - applies one minimal, documented device patch to the official remote code on first load —
masked_scatter_(…cuda())→.to(inputs_embeds.device), original kept as.bak, behaviour on CUDA unchanged; - adds streaming output, cancellation, chunked low-memory attention for 2048² SAM, and memory-mapped weight loading.
See NOTICE for the full third-party list.
Explore projetos relacionados
Carregando…







