Espelho do repositório github do stable-diffusion.cpp
Find a file
lcy 59ebdf0bb5
chrore: enable Windows ROCm(HIP) build release (#956)
* build: fix missing commit sha in macOS and Ubuntu build zip name

The build workflows for macOS and Ubuntu incorrectly check for the
"main" branch instead of "master" when retrieving the commit hash for
naming the build artifacts.

* build: correct Vulkan SDK installation condition in build workflow

* build: Enable Windows ROCm(HIP) build release

Refer to the build workflow of llama.cpp to add a Windows ROCm (HIP)
build release to the workflow.
Since there are many differences between the HIP build and other
builds, this commit add a separate "windows-latest-cmake-hip" job,
instead of enabling the ROCm matrix entry in the existing Windows
build job.

Main differences include:

- Install ROCm SDK from AMD official installer.
- Add a cache step for ROCm installation and a ccache step for build
  processing, since the HIP build takes much longer time than other
  builds.
- Include the ROCm/HIP artifact in the release assets.
2025-11-12 00:28:55 +08:00
.github chrore: enable Windows ROCm(HIP) build release (#956) 2025-11-12 00:28:55 +08:00
assets feat: add chroma radiance support (#910) 2025-10-25 23:56:14 +08:00
docs feat: add support for SD2.x with TINY U-Nets (#939) 2025-11-09 22:47:37 +08:00
examples feat: add image preview support (#522) 2025-11-10 00:12:02 +08:00
ggml@2d3876d554 sync: update ggml 2025-10-24 00:32:45 +08:00
thirdparty feat: add wan2.1/2.2 support (#778) 2025-09-06 18:08:03 +08:00
.clang-format style: format code 2024-01-29 23:05:18 +08:00
.clang-tidy chore: add .clang-tidy configuration and apply modernize checks (#902) 2025-10-18 23:23:40 +08:00
.dockerignore chore: add sd Dockerfile 2023-08-22 22:14:20 +08:00
.gitignore feat: add image preview support (#522) 2025-11-10 00:12:02 +08:00
.gitmodules feat: add wan2.1/2.2 support (#778) 2025-09-06 18:08:03 +08:00
clip.hpp refactor: simplify the model loading logic (#933) 2025-11-03 21:21:34 +08:00
CMakeLists.txt chore: allow building ggml as a separate shared lib (#468) 2025-10-15 22:10:26 +08:00
common.hpp fix: compatibility for models with modified tensor shapes (#951) 2025-11-07 23:04:41 +08:00
conditioner.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
control.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
denoiser.hpp refactor: unify the naming style of ggml extension functions (#921) 2025-10-28 23:26:48 +08:00
diffusion_model.hpp refactor: simplify the model loading logic (#933) 2025-11-03 21:21:34 +08:00
Dockerfile chore: fix dockerfile libgomp1 dependency + improvements (#852) 2025-10-11 00:17:45 +08:00
Dockerfile.musa feat: upgrade musa sdk to rc4.2.0 (#732) 2025-07-28 21:51:11 +08:00
Dockerfile.sycl feat: Add SYCL Dockerfile (#651) 2025-09-14 13:02:59 +08:00
esrgan.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
face_detect.py feat: add PhotoMaker Version 2 support (#358) 2024-11-23 11:50:14 +08:00
flux.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
format-code.sh chore: add .clang-tidy configuration and apply modernize checks (#902) 2025-10-18 23:23:40 +08:00
ggml_extend.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
gguf_reader.hpp feat: add wan2.1/2.2 support (#778) 2025-09-06 18:08:03 +08:00
gits_noise.inl fix: clang complains about needless braces (#618) 2025-03-09 12:26:41 +08:00
latent-preview.h feat: add image preview support (#522) 2025-11-10 00:12:02 +08:00
LICENSE Initial commit 2023-08-13 16:00:22 +08:00
lora.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
ltxv.hpp refactor: introduce GGMLRunnerContext (#928) 2025-11-02 02:11:04 +08:00
mmdit.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
model.cpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
model.h refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
name_conversion.cpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
name_conversion.h refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
ordered_map.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
pmid.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
preprocessing.hpp refactor: unify the naming style of ggml extension functions (#921) 2025-10-28 23:26:48 +08:00
qwen_image.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
qwenvl.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
README.md docs: add Koboldcpp as an available UI (#930) 2025-11-02 02:03:01 +08:00
rng.hpp chore: add .clang-tidy configuration and apply modernize checks (#902) 2025-10-18 23:23:40 +08:00
rng_philox.hpp chore: add .clang-tidy configuration and apply modernize checks (#902) 2025-10-18 23:23:40 +08:00
rope.hpp refactor: introduce GGMLRunnerContext (#928) 2025-11-02 02:11:04 +08:00
stable-diffusion.cpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
stable-diffusion.h fix: specify enum modifier in sd_set_preview_callback signature (#959) 2025-11-12 00:27:23 +08:00
t5.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
tae.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
tokenize_util.cpp feat: add Qwen Image support (#851) 2025-10-12 23:23:19 +08:00
tokenize_util.h feat: add Qwen Image support (#851) 2025-10-12 23:23:19 +08:00
unet.hpp feat: add support for SD2.x with TINY U-Nets (#939) 2025-11-09 22:47:37 +08:00
upscaler.cpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +08:00
util.cpp feat: add image preview support (#522) 2025-11-10 00:12:02 +08:00
util.h feat: add image preview support (#522) 2025-11-10 00:12:02 +08:00
vae.hpp fix: compatibility for models with modified tensor shapes (#951) 2025-11-07 23:04:41 +08:00
vocab.hpp feat: add sd3 support (#298) 2024-07-28 15:44:08 +08:00
vocab_qwen.hpp feat: add Qwen Image support (#851) 2025-10-12 23:23:19 +08:00
vocab_umt5.hpp feat: add wan2.1/2.2 support (#778) 2025-09-06 18:08:03 +08:00
wan.hpp refactor: optimize the logic for name conversion and the processing of the LoRA model (#955) 2025-11-10 00:12:20 +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/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 -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