Abstract
Generating high-quality Scalable Vector Graphics (SVG) remains a significant challenge in generative AI. While diffusion models excel at raster image synthesis, they often produce fragmented, uneditable vector paths. Conversely, Large Language Models (LLMs) generate clean code but lack geometric precision. We present Chat2SVG, a hybrid framework that combines the structural logic of LLMs with the visual creativity of diffusion models. By utilizing a "skeleton-to-flesh" approach, Chat2SVG produces SVGs that are both visually complex and semantically structured for professional editing.
Introduction
Scalable Vector Graphics (SVG) are essential in modern design due to their resolution independence and editability. However, automated SVG generation typically falls into two suboptimal categories: image-based methods that produce "spaghetti code" (hundreds of overlapping, unlabelled paths) and language-based methods that produce oversimplified, clunky shapes. Chat2SVG bridges this gap by treating SVG generation as a collaborative process between an LLM "manager" and a diffusion-based "specialist."
Methodology
The Chat2SVG pipeline operates through a multi-stage process designed to ensure both structural integrity and aesthetic detail.
- SVG Template Generation & Rectification: Using Claude-3.5-Sonnet, the system expands a text prompt into a hierarchical scene description (Scene $\rightarrow$ Object $\rightarrow$ Layout). The LLM then generates a basic SVG template. Through a visual feedback loop, the model "inspects" its own render and iteratively corrects errors like floating limbs or missing features.
- Detail Enhancement: The clean template is passed through SDEdit and ControlNet to generate a high-detail raster target image. This stage adds the "flesh" to the LLM's "skeleton."
- Dual-Stage Optimization: To translate raster details back into clean vector paths, the system performs latent optimization via a pretrained SVG VAE to maintain path smoothness, followed by point optimization to fine-tune coordinates against the target image.
- Semantic Preservation: Because the initial paths are semantically labeled (e.g., "hat," "wing"), the system can integrate decorative elements without losing the underlying structure, allowing for natural language editing (e.g., "change the hat color to red").
Experimental Results
Chat2SVG was evaluated against state-of-the-art baselines like VectorFusion and SVGDreamer using professional datasets (SVGRepo and FIGR-8-SVG) and a custom set of 125 diverse prompts.
- Visual Fidelity: Chat2SVG achieved an Image FID of 33.31, outperforming the next best method (35.48).
- Path Regularity: The framework achieved a Path FID of 39.07, indicating that its generated paths are significantly closer to professional design standards than the fragmented outputs of diffusion-only methods (e.g., VectorFusion at 56.79).
- User Preference: In a study with 31 participants, Chat2SVG was consistently rated highest for its balance of aesthetic quality and practical editability.
Conclusion and Future Work
Chat2SVG successfully demonstrates that the combination of LLM-driven semantic reasoning and diffusion-driven visual refinement can overcome the limitations of previous vector generation methods. While the system currently faces minor challenges with exact spatial layout and extremely fine decorative details, future work will focus on fine-tuning LLMs for layout precision and extending the framework to support consistent multi-frame vector animation.
Summary updated