TL;DR
SwiftSketch is a novel conditional diffusion model that generates high-quality vector sketches from images in under half a second, bypassing the slow optimization loops of prior state-of-the-art methods. By modeling sketches directly in the coordinate space of stroke control points and training on a newly curated high-quality synthetic dataset, it achieves an impressive balance of artistic abstraction, structural fidelity, and real-time efficiency.
What Problem Does This Paper Address?
Vector sketches are highly desirable in digital art and design because they are resolution-independent, clean, and easily editable. However, training data-driven models to generate them is notoriously difficult. Large-scale human sketch datasets (like QuickDraw) mostly consist of amateur doodles, while professional artist datasets are too small and domain-specific to generalize well.
To circumvent this data scarcity, recent state-of-the-art methods turn to large Vision-Language Models (VLMs) and use Score Distillation Sampling (SDS) to optimize stroke placements iteratively. The catch? This optimization process is incredibly slow, taking anywhere from several minutes to over an hour to produce a single sketch. This computational bottleneck makes interactive, real-time applications impossible. SwiftSketch bridges this gap by delivering optimization-grade vector sketches in a single, sub-second forward pass.
Methods
The authors split their solution into two core components: a high-quality dataset generator and a fast feed-forward diffusion network.
- ControlSketch (The Dataset Generator): To create high-quality training data, the authors developed an optimization-based method called ControlSketch. It enhances standard SDS by incorporating spatial control via a depth-aware ControlNet. It also introduces a smart stroke initialization strategy using weighted K-Means to ensure full coverage of the object's geometry, and a heuristic stroke-sorting scheme that orders strokes from major contours to fine details.
- SwiftSketch (The Real-Time Model): SwiftSketch is a conditional diffusion model built on a transformer-decoder architecture. Instead of operating on pixels, it directly denoises the $(x, y)$ coordinates of stroke control points (Bézier curves) sampled from a Gaussian distribution.
The model conditions on CLIP image embeddings via a cross-attention mechanism. It is trained using a dual-objective loss function: an $L_1$ loss on the control points for stroke precision, and an LPIPS loss on the rendered pixels to ensure global structural alignment. Because the final output of the 50-step denoising process can retain minor noise, the authors append a neural refinement stage ($M_{\theta^*}$) to clean up the final vector paths.
Datasets
- ControlSketch Dataset: A newly introduced synthetic dataset containing over 35,000 image-sketch pairs across 100 diverse categories. The source images were generated using SDXL, and the vector sketches were produced via ControlSketch.
- Training/Testing Split: The model was trained on 15 categories (1,000 samples each, including cats, dogs, bicycles, and astronauts). The remaining 85 categories were used to evaluate zero-shot generalization.
- SketchyCOCO: An external human-drawn sketch dataset used as a challenging benchmark to test the model's performance on real-world, low-resolution, and poorly lit images.
Key Insights and Ideas
- Vector-Space Denoising: By running the diffusion process directly on the mathematical control points of Bézier curves rather than on a pixel grid, the transformer decoder can efficiently map long-range topological relationships between individual strokes.
- Knowledge Distillation via Synthetic Data: Since large-scale professional datasets don't exist, the authors proved that you can use a slow, expensive optimization method (ControlSketch) to bootstrap a synthetic dataset, effectively distilling its quality into a real-time model (SwiftSketch).
- Implicit Abstraction via Sorting: Sorting the training strokes by structural importance (contours first) allows the model to implicitly learn stroke hierarchy. At inference time, users can truncate the stroke sequence early to generate highly abstract sketches that still preserve the object's core identity.
Key Results
- Massive Speedup: SwiftSketch generates a complete vector sketch in ~0.5 seconds, representing a massive speedup over optimization methods like CLIPasso (~5 minutes) and ControlSketch (~10 minutes).
- High Fidelity: Quantitative evaluations (using CLIP zero-shot classification and MS-SSIM) show that SwiftSketch closely matches the quality of optimization-based ground truths on seen classes.
- Human Preference: In a 2-Alternative Forced-Choice (2AFC) perceptual study, human participants preferred sketches generated by ControlSketch over CLIPasso in 89% of cases, citing better object coverage and fewer chaotic artifacts.
Limitations and Future Work
- Unseen Category Degradation: While the model generalizes reasonably well, its performance drops when encountering complex unseen categories that differ significantly from the 15 training classes (e.g., inanimate objects like carrots).
- Over-Simplification: The final refinement network can occasionally be overzealous, smoothing out crucial fine details like the eyes or nose of an animal.
- Fixed Stroke Budget: SwiftSketch was trained on a fixed budget of 32 strokes. Dynamically scaling the network to handle variable stroke counts for multi-level abstraction remains an open direction for future research.
- Mask Dependency: The model is trained strictly on masked object images and currently struggles to process complex, unsegmented background scenes.
Summary updated