Go to file
2025-12-22 23:52:11 +08:00
.github chore: add compute kernels to Windows CUDA build (#1062) 2025-12-07 22:12:50 +08:00
assets docs: update logo 2025-12-07 15:09:32 +08:00
docs feat: add more caching methods (#1066) 2025-12-22 23:52:11 +08:00
examples feat: add more caching methods (#1066) 2025-12-22 23:52:11 +08:00
ggml@3e9f2ba3b9 feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
thirdparty feat: simple openai image generation api compatiple server (#1037) 2025-12-13 13:53:21 +08:00
.clang-format
.clang-tidy
.dockerignore
.gitignore
.gitmodules
cache_dit.hpp feat: add more caching methods (#1066) 2025-12-22 23:52:11 +08:00
clip.hpp refactor: optimize the handling of LoRA models (#1070) 2025-12-10 00:26:07 +08:00
CMakeLists.txt feat: embed version string and git commit hash (#1008) 2025-12-09 22:38:54 +08:00
common.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
conditioner.hpp fix: resolve embedding loading issue when calling generate_image multiple times (#1078) 2025-12-12 23:08:12 +08:00
control.hpp feat: handle ggml compute failures without crashing the program (#1003) 2025-12-04 22:04:27 +08:00
denoiser.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
diffusion_model.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
Dockerfile feat: simple openai image generation api compatiple server (#1037) 2025-12-13 13:53:21 +08:00
Dockerfile.musa feat: simple openai image generation api compatiple server (#1037) 2025-12-13 13:53:21 +08:00
Dockerfile.sycl feat: simple openai image generation api compatiple server (#1037) 2025-12-13 13:53:21 +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: add seamless texture generation support (#914) 2025-12-21 18:06:47 +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 feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
gguf_reader.hpp
gits_noise.inl
latent-preview.h feat: add Flux.2 VAE proj matrix for previews (#1017) 2025-12-09 22:00:45 +08:00
LICENSE
llm.hpp feat: add ovis image support (#1057) 2025-12-07 12:32:56 +08:00
lora.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
ltxv.hpp
mmdit.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
model.cpp feat: do not convert tensor names by default in convert mode (#1122) 2025-12-21 18:40:10 +08:00
model.h feat: add ovis image support (#1057) 2025-12-07 12:32:56 +08:00
name_conversion.cpp feat: add support for underline style lora of flux (#1103) 2025-12-18 21:44:16 +08:00
name_conversion.h
ordered_map.hpp
pmid.hpp feat: handle ggml compute failures without crashing the program (#1003) 2025-12-04 22:04:27 +08:00
preprocessing.hpp
qwen_image.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
README.md feat: simple openai image generation api compatiple server (#1037) 2025-12-13 13:53:21 +08:00
rng_mt19937.hpp
rng_philox.hpp
rng.hpp
rope.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
stable-diffusion.cpp feat: add more caching methods (#1066) 2025-12-22 23:52:11 +08:00
stable-diffusion.h feat: add more caching methods (#1066) 2025-12-22 23:52:11 +08:00
t5.hpp feat: handle ggml compute failures without crashing the program (#1003) 2025-12-04 22:04:27 +08:00
tae.hpp feat: add taehv support for Wan/Qwen (#937) 2025-12-16 22:57:34 +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: handle ggml compute failures without crashing the program (#1003) 2025-12-04 22:04:27 +08:00
upscaler.cpp feat: support custom upscale tile size (#896) 2025-12-10 22:25:19 +08:00
util.cpp refactor: optimize the handling of LoRA models (#1070) 2025-12-10 00:26:07 +08:00
util.h refactor: optimize the handling of LoRA models (#1070) 2025-12-10 00:26:07 +08:00
vae.hpp feat: handle ggml compute failures without crashing the program (#1003) 2025-12-04 22:04:27 +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 feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +08:00
z_image.hpp feat: add seamless texture generation support (#914) 2025-12-21 18:06:47 +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

  • 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