leejet/stable-diffusion.cpp

每日信息看板 · 2026-02-10
开源项目
Category
github_search
Source
24
Score
2026-02-10T18:51:55Z
Published

AI 总结

stable-diffusion.cpp 是一个基于纯 C/C++ 与 ggml 的轻量跨平台扩散模型推理项目,近期持续新增 FLUX.2、Qwen Image、Wan2.2、Z-Image 等支持,重要性在于可用统一后端低依赖部署多类图像/视频生成能力。
#GitHub #repo #开源项目 #stable-diffusion.cpp #C++ #ggml #FLUX #Qwen Image

内容摘录

<p align="center">
 <img src="./assets/logo.png" width="360x">
</p>
stable-diffusion.cpp

<div align="center">
<a href="https://trendshift.io/repositories/9714" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9714" alt="leejet%2Fstable-diffusion.cpp | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
</div>

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
Plain C/C++ implementation based on ggml, working in the same way as llama.cpp
Super lightweight and without external dependencies
Supported models
Image Models
SD1.x, SD2.x, SD-Turbo
SDXL, SDXL-Turbo
Some SD1.x and SDXL distilled models
SD3/SD3.5
FLUX.1-dev/FLUX.1-schnell
FLUX.2-dev/FLUX.2-klein
Chroma
Chroma1-Radiance
Qwen Image
Z-Image
Ovis-Image
Image Edit Models
FLUX.1-Kontext-dev
Qwen Image Edit series
Video Models
Wan2.1/Wan2.2
PhotoMaker support.
Control Net support with SD 1.5
LoRA support, same as stable-diffusion-webui
Latent Consistency Models support (LCM/LCM-LoRA)
Faster and memory efficient latent decoding with TAESD
Upscale images generated with ESRGAN
Supported backends
CPU (AVX, AVX2 and AVX512 support for x86 architectures)
CUDA
Vulkan
Metal
OpenCL
SYCL
Supported weight formats
Pytorch checkpoint (.ckpt or .pth)
Safetensors (.safetensors)
GGUF (.gguf)
Supported platforms
Linux
Mac OS
Windows
Android (via Termux, Local Diffusion)
Flash Attention for memory usage optimization
Negative prompt
stable-diffusion-webui style tokenizer (not all the features, only token weighting for now)
VAE tiling processing for reduce memory usage
Sampling method
Euler A
Euler
Heun
DPM2
DPM++ 2M
DPM++ 2M v2
DPM++ 2S a
LCM
Cross-platform reproducibility
--rng cuda, default, consistent with the stable-diffusion-webui GPU RNG
--rng cpu, consistent with the comfyui RNG
Embedds generation parameters into png output as webui-compatible text string
Quick Start
Get the sd executable
Download pre-built binaries from the releases page
Or build from source by following the build guide
Download model weights
download weights(.ckpt or .safetensors or .gguf). For example
Stable Diffusion v1.5 from https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5 

 
Generate an image with just one command

***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.
More Guides
SD1.x/SD2.x/SDXL
SD3/SD3.5
FLUX.1-dev/FLUX.1-schnell
FLUX.2-dev/FLUX.2-klein
FLUX.1-Kontext-dev
Chroma
🔥Qwen Image
🔥Qwen Image Edit series
🔥Wan2.1/Wan2.2
🔥Z-Image
Ovis-Image
LoRA
LCM/LCM-LoRA
Using PhotoMaker to personalize image generation
Using ESRGAN to upscale results
Using TAESD to faster decoding
Docker
Quantization and GGUF
Inference acceleration via caching
Bindings

These projects wrap stable-diffusion.cpp for easier use in other languages/frameworks.
Golang (non-cgo): seasonjs/stable-diffusion
Golang (cgo): Binozo/GoStableDiffusion
C#: DarthAffe/StableDiffusion.NET
Python: william-murray1204/stable-diffusion-cpp-python
Rust: newfla/diffusion-rs
Flutter/Dart: rmatif/Local-Diffusion
UIs

These projects use stable-diffusion.cpp as a backend for their image generation.
Jellybox
Stable Diffusion GUI
Stable Diffusion CLI-GUI
Local Diffusion
sd.cpp-webui
LocalAI
Neural-Pixel
KoboldCpp
Contributors

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

Contributors
Star History

Star History Chart
References
ggml
diffusers
stable-diffusion
sd3-ref
stable-diffusion-stability-ai
stable-diffusion-webui
ComfyUI
k-diffusion
latent-consistency-model
generative-models
PhotoMaker
Wan2.1
Wan2.2