stable-diffusion.cpp is an open-source project enabling diffusion model inference in pure C/C++, similar to llama.cpp. It supports a wide array of image and video models including SD1.x, SD2.x, SDXL, FLUX, Qwen Image, Z-Image, and Wan. The tool is designed to be super lightweight with no external dependencies, making it efficient for various platforms like Linux, Mac OS, Windows, and Android. Key features include LoRA support, Latent Consistency Models, faster latent decoding with TAESD, and image upscaling with ESRGAN. It also supports multiple backends like CPU, CUDA, Vulkan, Metal, OpenCL, and SYCL, along with various weight formats such as Pytorch checkpoint, Safetensors, and GGUF. The project is under active development, with frequent updates to its API and command-line options.
Best used for
Ideal for developers who need to implement and run various diffusion models for image and video generation, edit existing images, and upscale results. Especially valuable for those seeking a lightweight, pure C/C++ solution with broad model and platform compatibility.
Common actions