Abstract
DiffSketcher is a novel framework designed to synthesize high-quality, vectorized free-hand sketches directly from text prompts. By leveraging the prior knowledge embedded within pre-trained latent diffusion models (LDMs), DiffSketcher optimizes Bézier curves through a differentiable rasterizer using an extended Score Distillation Sampling (SDS) loss. This approach allows for the creation of sketches that are semantically accurate, aesthetically pleasing, and capable of varying levels of abstraction without requiring specialized sketch datasets for training.
1. Introduction
While text-to-image generation has achieved remarkable success in producing photorealistic imagery, the synthesis of vector sketches—characterized by sparse, expressive strokes—remains a significant challenge. Most existing sketch synthesis methods are image-conditioned, requiring a reference photo, or they produce raster-based outputs that lack the scalability and editability of vector graphics. Furthermore, the scarcity of paired text-sketch datasets makes training specialized models difficult.
DiffSketcher addresses these limitations by treating sketch generation as an optimization problem. It distills the extensive visual knowledge of large-scale text-to-image diffusion models (such as Stable Diffusion) into sparse vector representations, enabling the generation of elegant drawings from natural language descriptions.
2. Methodology
DiffSketcher represents a sketch as a collection of $n$ Bézier curves and optimizes their parameters to align with a given text prompt. The framework consists of several integrated components:
2.1 Vector Representation and Differentiable Rasterization
Each sketch is defined by a set of Bézier curves. To mimic human drawing techniques, the authors introduce an opacity property for each stroke, allowing for varying line weights and the appearance of "heavy and light" brushstrokes. To bridge the gap between vector curves and the pixel-based evaluation of diffusion models, a differentiable rasterizer is employed. This allows gradients to flow from the loss functions back to the stroke coordinates and opacity values.
2.2 Augmentation Score Distillation Sampling (ASDS)
Inspired by the DreamFusion framework, DiffSketcher utilizes a pre-trained diffusion model as a "critic." Through the ASDS loss, the model adds noise to the current sketch and predicts the necessary refinements to better match the text prompt. This iterative process guides the Bézier control points toward a semantically coherent representation.
2.3 Joint Visual Semantic and Perceptual (JVSP) Loss
To maintain structural integrity, the framework incorporates a multi-stage refinement process. This involves LPIPS (perceptual loss) and CLIP (semantic loss) to ensure the sketch remains faithful to the underlying structure of the objects as perceived by the LDM.
2.4 Attention-based Initialization
Rather than initializing strokes randomly, DiffSketcher extracts cross-attention and self-attention maps from the diffusion model’s U-Net. These maps serve as a spatial prior, identifying the most semantically important regions of an object. By placing strokes in these high-importance areas, the model achieves significantly faster convergence and more natural stroke placement.
3. Evaluation and Results
DiffSketcher was evaluated using zero-shot classification across 34 categories and compared against baselines such as Canny edge detection and CLIPasso.
3.1 Quantitative Performance
- Semantic Consistency: DiffSketcher achieved a CLIP cosine similarity of 0.3494, outperforming both Canny edge detection (0.328) and CLIPasso (0.3075).
- Aesthetics: Using an aesthetic predictor trained on LAION-400M, DiffSketcher scored 4.82, a notable improvement over CLIPasso’s 4.08.
- Human-Like Quality: In a "confusion" user study involving 30 real hand-drawn sketches, DiffSketcher achieved a score of 0.65 (where 1.0 is indistinguishable from human work), nearly matching the 0.67 score of actual human sketches.
3.2 Abstraction and Expression
One of the framework's strengths is its ability to control abstraction through stroke sparsity. By adjusting the number of Bézier curves (e.g., from 16 to 128), the model can transition from minimal, abstract representations to detailed drawings. The inclusion of stroke opacity was also found to be crucial for capturing the artistic "feel" of free-hand sketching.
4. Conclusion and Future Work
DiffSketcher demonstrates that pre-trained diffusion models can serve as universal critics for vector art, eliminating the need for specialized sketch datasets. However, the authors note certain limitations, such as the lack of an automated mechanism to determine the optimal number of strokes for varying prompt complexities. Additionally, while the model excels at free-hand styles, specific artistic style transfer remains an area for future exploration. Future research may focus on automated stroke count adjustment and the integration of explicit style-transfer latent spaces to further enhance artistic diversity.
Summary updated