tiny-dream  by symisc

Header-only C++ library for Stable Diffusion inference

created 2 years ago
264 stars

Top 97.5% on sourcepulse

GitHubView on GitHub
Project Summary

Tiny Dream is a header-only, dependency-free C++ implementation of Stable Diffusion, designed for efficient CPU inference with a low memory footprint (1.7-5.5 GB RAM). It targets developers needing to embed AI image generation capabilities into existing C++ applications without requiring specific GPU hardware.

How It Works

Tiny Dream leverages C++17 for its implementation, focusing on CPU efficiency through TBB threading and SSE/AVX vectorization. It uses the ncnn tensor library as its default backend, with plans to migrate to lighter libraries like SOD or GGML for further CPU performance optimization. The library is designed for straightforward integration, requiring only two header files (tinydream.hpp and stb_image_write.h) and pre-trained models.

Quick Start & Requirements

  • Install/Run: Compile with a C++17 compiler (GCC 7+, Clang, MSVC) and link against ncnn. Example command: g++ -o tinydream boilerplate.cpp -funsafe-math-optimizations -Ofast -flto=auto -funroll-all-loops -pipe -march=native -std=c++17 -Wall -Wextra pkg-config --cflags --libs ncnn -lstdc++ -pthread -Wl -flto -fopt-info-vec-optimized
  • Prerequisites: C++17 compiler, ncnn library, pre-trained models (2GB+).
  • Resources: Requires 1.7-5.5 GB RAM.
  • Docs: Official Documentation

Highlighted Details

  • Header-only, dependency-free (except stb_image_write.h).
  • Supports Real-ESRGAN upscaling.
  • Features "Words Priority" for prompt weighting and output metadata linking.
  • Can generate 512x512 or 2048x2048 images.

Maintenance & Community

  • Developed by PixLab / Symisc Systems.
  • Roadmap includes GUI, WebAssembly, and alternative format outputs.
  • Related projects include SOD (Computer Vision), FACEIO (Facial Authentication), and UnQLite (Database).

Licensing & Compatibility

  • License is not explicitly stated in the README, but PixLab projects are typically proprietary or have custom licensing. Further clarification is needed for commercial use.

Limitations & Caveats

The README does not explicitly state the license, which is crucial for commercial adoption. The project currently relies on ncnn, with plans to switch to potentially less mature libraries (SOD, GGML), which might introduce compatibility or stability changes.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Georgios Konstantopoulos Georgios Konstantopoulos(CTO, General Partner at Paradigm), and
7 more.

ThunderKittens by HazyResearch

0.6%
3k
CUDA kernel framework for fast deep learning primitives
created 1 year ago
updated 4 days ago
Starred by Bojan Tunguz Bojan Tunguz(AI Scientist; Formerly at NVIDIA), Mckay Wrigley Mckay Wrigley(Founder of Takeoff AI), and
8 more.

ggml by ggml-org

0.3%
13k
Tensor library for machine learning
created 2 years ago
updated 3 days ago
Starred by George Hotz George Hotz(Author of tinygrad; Founder of the tiny corp, comma.ai), Anton Bukov Anton Bukov(Cofounder of 1inch Network), and
16 more.

tinygrad by tinygrad

0.1%
30k
Minimalist deep learning framework for education and exploration
created 4 years ago
updated 1 day ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Nat Friedman Nat Friedman(Former CEO of GitHub), and
32 more.

llama.cpp by ggml-org

0.4%
84k
C/C++ library for local LLM inference
created 2 years ago
updated 19 hours ago
Feedback? Help us improve.