PyTorch-SVGRender  by ximinng

PyTorch library for differentiable SVG rendering methods

created 1 year ago
430 stars

Top 70.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a comprehensive toolkit for generating and editing Scalable Vector Graphics (SVG) using neural networks and differentiable rendering techniques. It targets researchers and developers interested in text-to-SVG synthesis, image vectorization, and SVG manipulation, offering a unified interface to various state-of-the-art methods.

How It Works

The library leverages differentiable rasterization (e.g., DiffVG) and Score Distillation Sampling (SDS) from diffusion models. SDS allows optimization of SVG parameters (like paths, colors, and shapes) to match text prompts without direct image supervision, enabling text-guided SVG generation and editing.

Quick Start & Requirements

  • Installation:
    • Standard: chmod +x script/install.sh && bash script/install.sh
    • Docker: chmod +x script/run_docker.sh && sudo bash script/run_docker.sh
  • Prerequisites: Python, PyTorch. Some models require Hugging Face diffusers and may need xformers installed via pip install --pre -U xformers. U2Net model download is required for CLIPasso and CLIPascene.
  • Documentation: pytorch-svgrender.readthedocs.io

Highlighted Details

  • Supports multiple SVG generation methods: DiffVG, LIVE, CLIPasso, CLIPascene, CLIPDraw, StyleCLIPDraw, CLIPFont, VectorFusion, DiffSketcher, SVGDreamer, Word-As-Image.
  • Integrates various styles for text-to-SVG: Iconography, Sketch, Pixel Art, Low-Poly, Painting, Ink & Wash.
  • Employs Score Distillation Sampling (SDS) for text-to-SVG without explicit image supervision.
  • Includes methods for image vectorization and semantic sketching.

Maintenance & Community

The project is actively maintained, with recent updates in December 2023. Contributions are welcomed via pull requests.

Licensing & Compatibility

  • License: Mozilla Public License Version 2.0.
  • Compatibility: Generally compatible with commercial use, but users should review the MPL 2.0 terms.

Limitations & Caveats

The project relies heavily on external models and libraries, which may introduce complex dependency management. Some advanced features might require significant computational resources (GPU, VRAM). A TODO list indicates planned features like an SVG Layout Pipeline.

Health Check
Last commit

5 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
29 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Luca Antiga Luca Antiga(CTO of Lightning AI).

mmagic by open-mmlab

0.1%
7k
AIGC toolbox for image/video editing and generation
created 6 years ago
updated 1 year ago
Feedback? Help us improve.