Go to file
2025-12-16 22:45:10 +08:00
.github
assets
docs
examples fix: added a clean exit in ModelLoader::load_tensors if OOM (#1097) 2025-12-16 22:45:10 +08:00
ggml@f5425c0ee5 sync: update ggml (#1082) 2025-12-14 01:23:34 +08:00
thirdparty
.clang-format
.clang-tidy
.dockerignore
.gitignore
.gitmodules
clip.hpp
CMakeLists.txt
common.hpp perf: optimize ggml_ext_chunk (#1084) 2025-12-14 01:22:41 +08:00
conditioner.hpp
control.hpp
denoiser.hpp
diffusion_model.hpp
Dockerfile
Dockerfile.musa
Dockerfile.sycl
easycache.hpp
esrgan.hpp
face_detect.py
flux.hpp
format-code.sh
ggml_extend.hpp fix: avoid crash with VAE tiling and certain image sizes (#1090) 2025-12-15 23:51:40 +08:00
gguf_reader.hpp
gits_noise.inl
latent-preview.h
LICENSE
llm.hpp
lora.hpp
ltxv.hpp
mmdit.hpp
model.cpp fix: added a clean exit in ModelLoader::load_tensors if OOM (#1097) 2025-12-16 22:45:10 +08:00
model.h
name_conversion.cpp
name_conversion.h
ordered_map.hpp
pmid.hpp
preprocessing.hpp
qwen_image.hpp
README.md
rng_mt19937.hpp
rng_philox.hpp
rng.hpp
rope.hpp
stable-diffusion.cpp chore: remove lora_model_dir parameter (#1100) 2025-12-16 22:37:45 +08:00
stable-diffusion.h chore: remove lora_model_dir parameter (#1100) 2025-12-16 22:37:45 +08:00
t5.hpp
tae.hpp
tokenize_util.cpp
tokenize_util.h
unet.hpp
upscaler.cpp
util.cpp
util.h
vae.hpp
version.cpp
vocab_mistral.hpp
vocab_qwen.hpp
vocab_umt5.hpp
vocab.hpp
wan.hpp
z_image.hpp

stable-diffusion.cpp

leejet%2Fstable-diffusion.cpp | Trendshift

Diffusion model(SD,Flux,Wan,...) inference in pure C/C++

Note that this project is under active development.
API and command-line option may change frequently.

🔥Important News

  • 2025/12/01 🚀 stable-diffusion.cpp now supports Z-Image
    👉 Details: PR #1020

  • 2025/11/30 🚀 stable-diffusion.cpp now supports FLUX.2-dev
    👉 Details: PR #1016

  • 2025/10/13 🚀 stable-diffusion.cpp now supports Qwen-Image-Edit / Qwen-Image-Edit 2509
    👉 Details: PR #877

  • 2025/10/12 🚀 stable-diffusion.cpp now supports Qwen-Image
    👉 Details: PR #851

  • 2025/09/14 🚀 stable-diffusion.cpp now supports Wan2.1 Vace
    👉 Details: PR #819

  • 2025/09/06 🚀 stable-diffusion.cpp now supports Wan2.1 / Wan2.2
    👉 Details: PR #778

Features

Quick Start

Get the sd executable

Download model weights

Generate an image with just one command

./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"

For detailed command-line arguments, check out cli doc.

Performance

If you want to improve performance or reduce VRAM/RAM usage, please refer to performance guide.

Bindings

These projects wrap stable-diffusion.cpp for easier use in other languages/frameworks.

UIs

These projects use stable-diffusion.cpp as a backend for their image generation.

Contributors

Thank you to all the people who have already contributed to stable-diffusion.cpp!

Contributors

Star History

Star History Chart

References