# stable-diffusion.cpp

A pure C/C++ implementation, based on ggml, for running diffusion image, image-editing and video generation models such as Stable Diffusion, Flux, Wan and Qwen Image on the CPU or GPU with no external dependencies.

stable-diffusion.cpp is a plain C/C++ implementation for running diffusion model inference, built on ggml in the same way as llama.cpp, and is super lightweight with no external dependencies. It supports a wide range of image models (including the SD1.x, SD2.x, SDXL, SD3/3.5, FLUX, Qwen Image and Z-Image families), image-editing models, and video models such as Wan2.1/2.2, MiniMax-H3 and LTX.

Supported techniques include PhotoMaker, IP-Adapter, ControlNet with SD 1.5, ADetailer, LoRA (as in the stable-diffusion-webui project), and Latent Consistency Models, alongside memory-efficiency features for faster generation. A brand-new embedded web UI is included for interacting with the models without a separate frontend.

The project is under active development, so its API and command-line options may change frequently, and it regularly adds support for newly released diffusion models shortly after they appear.

Website: https://github.com/leejet/stable-diffusion.cpp
