Header-only C++ library for Stable Diffusion inference
Top 97.5% on sourcepulse
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
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
Highlighted Details
stb_image_write.h
).Maintenance & Community
Licensing & Compatibility
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.
1 year ago
Inactive