stable-diffusion-burn  by Gadersd

Rust port of Stable Diffusion v1.4

Created 2 years ago
339 stars

Top 81.3% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a Rust implementation of the Stable Diffusion v1.4 model, leveraging the burn deep learning framework. It targets developers and researchers interested in exploring or deploying diffusion models within the Rust ecosystem, offering a performant and memory-efficient alternative to Python-based solutions.

How It Works

The project directly ports the Stable Diffusion v1.4 architecture into Rust, utilizing the burn framework for tensor operations and automatic differentiation. This approach aims to provide native performance and memory safety benefits inherent to Rust, while burn's design facilitates backend flexibility (CUDA, MPS, WGPU) and efficient execution.

Quick Start & Requirements

  • Install: cargo run --release --bin sample burn SDv1-4 7.5 20 "An ancient mossy stone." img [cuda|mps|cpu]
  • Prerequisites: libtorch v2.4.1, at least 6 GB VRAM for CUDA.
  • Model Download: wget https://huggingface.co/Gadersd/Stable-Diffusion-Burn/resolve/main/SDv1-4.mpk
  • Fine-tuning Conversion: Requires Python 3, tinygrad, and a .ckpt model file. Conversion script is not compatible with Windows.
  • Links: HuggingFace Model

Highlighted Details

  • Native Rust implementation of Stable Diffusion v1.4.
  • Supports CUDA, MPS (Apple Silicon), and CPU backends via burn.
  • Includes Python scripts for converting fine-tuned models to burn's format.

Maintenance & Community

No specific community channels or contributor information is provided in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive license allows for commercial use and integration into closed-source projects.

Limitations & Caveats

The WGPU backend is explicitly marked as unstable. Model conversion scripts are not compatible with Windows. The sample binary requires CUDA for execution, while convert works on CPU.

Health Check
Last Commit

11 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), Chaoyu Yang Chaoyu Yang(Founder of Bento), and
13 more.

neon by NervanaSystems

0%
4k
Deep learning framework (discontinued)
Created 11 years ago
Updated 4 years ago
Feedback? Help us improve.