Go to file
2026-01-23 22:13:59 +08:00
.github ci: only push Docker images on master or release 2026-01-08 23:03:32 +08:00
assets add support for flux2 klein (#1193) 2026-01-18 01:17:33 +08:00
docs feat: add support for Segmind's Vega model (#1195) 2026-01-19 23:15:47 +08:00
examples fix: set default lora_model_dir to . (#1224) 2026-01-23 22:13:59 +08:00
ggml@8891ab6fc7 sync: update ggml (#1187) 2026-01-14 00:28:55 +08:00
thirdparty chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
.clang-format
.clang-tidy
.dockerignore chore: add Linux Vulkan build and Docker image workflows (#1164) 2026-01-05 23:42:12 +08:00
.gitignore
.gitmodules
cache_dit.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
clip.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
CMakeLists.txt chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
common.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
conditioner.hpp add support for flux2 klein (#1193) 2026-01-18 01:17:33 +08:00
control.hpp
denoiser.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
diffusion_model.hpp feat: add support for qwen image edit 2511 (#1096) 2025-12-24 23:00:08 +08:00
Dockerfile chore: add Linux Vulkan build and Docker image workflows (#1164) 2026-01-05 23:42:12 +08:00
Dockerfile.musa chore: downgrade ubuntu base image in musa container image (#1176) 2026-01-05 23:56:34 +08:00
Dockerfile.sycl chore: add Linux Vulkan build and Docker image workflows (#1164) 2026-01-05 23:42:12 +08:00
Dockerfile.vulkan chore: add Linux Vulkan build and Docker image workflows (#1164) 2026-01-05 23:42:12 +08:00
easycache.hpp
esrgan.hpp feat: support custom upscale tile size (#896) 2025-12-10 22:25:19 +08:00
face_detect.py
flux.hpp feat: support new chroma radiance "x0_x32_proto" (#1209) 2026-01-19 23:51:26 +08:00
format-code.sh feat: simple openai image generation api compatiple server (#1037) 2025-12-13 13:53:21 +08:00
ggml_extend.hpp add support for flux2 klein (#1193) 2026-01-18 01:17:33 +08:00
gguf_reader.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
gits_noise.inl
latent-preview.h chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
LICENSE
llm.hpp add support for flux2 klein (#1193) 2026-01-18 01:17:33 +08:00
lora.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
ltxv.hpp
mmdit.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
model.cpp chore: clarify warning about missing model files (#1219) 2026-01-21 22:34:11 +08:00
model.h feat: add support for Segmind's Vega model (#1195) 2026-01-19 23:15:47 +08:00
name_conversion.cpp feat: add support for more underline loras (#1135) 2025-12-24 22:59:23 +08:00
name_conversion.h
ordered_map.hpp
pmid.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
preprocessing.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
qwen_image.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
README.md docs: add FLUX.2-klein support to news 2026-01-19 23:56:50 +08:00
rng_mt19937.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
rng_philox.hpp
rng.hpp
rope.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
stable-diffusion.cpp fix: set VAE conv scale for all SDXL variants 2026-01-19 23:21:48 +08:00
stable-diffusion.h feat: enable vae tiling for vid gen (#1152) 2026-01-08 23:23:05 +08:00
t5.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
tae.hpp feat: add taef2 support (#1211) 2026-01-19 23:39:36 +08:00
tokenize_util.cpp
tokenize_util.h
ucache.hpp feat: add more caching methods (#1066) 2025-12-22 23:52:11 +08:00
unet.hpp feat: add support for Segmind's Vega model (#1195) 2026-01-19 23:15:47 +08:00
upscaler.cpp feat: support custom upscale tile size (#896) 2025-12-10 22:25:19 +08:00
util.cpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00
util.h feat: support mmap for model loading (#1059) 2025-12-28 22:38:29 +08:00
vae.hpp refactor: replace ggml_ext_attention with ggml_ext_attention_ext (#1185) 2026-01-11 16:34:13 +08:00
version.cpp feat: embed version string and git commit hash (#1008) 2025-12-09 22:38:54 +08:00
vocab_mistral.hpp
vocab_qwen.hpp
vocab_umt5.hpp
vocab.hpp
wan.hpp refactor: replace ggml_ext_attention with ggml_ext_attention_ext (#1185) 2026-01-11 16:34:13 +08:00
z_image.hpp chore: eliminate compilation warnings under MSVC (#1170) 2026-01-04 22:26:57 +08:00

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

  • 2026/01/18 🚀 stable-diffusion.cpp now supports FLUX.2-klein
    👉 Details: PR #1193

  • 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