Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
98f70b6
git: Gitignore adjustment
Juste-Leo2 May 31, 2026
f5d1b4d
Feature: Added conversion script
Juste-Leo2 Jun 1, 2026
a5f63bc
remove ggml submodule, keep files directly in repo
Juste-Leo2 Jun 1, 2026
680c402
Cleanup: remove all model architectures except Flux2/Klein
Juste-Leo2 Jun 1, 2026
43d1284
Étape B : nettoyage fin du code après la phase A
Juste-Leo2 Jun 1, 2026
c07ae3d
Remove assets/ directory (demo images, not needed)
Juste-Leo2 Jun 1, 2026
1833b63
Remove unused thirdparty: libwebm, libwebp, darts.h
Juste-Leo2 Jun 1, 2026
53d32bc
Make workflows manual-only (workflow_dispatch)
Juste-Leo2 Jun 1, 2026
212891d
Remove dead docs, scripts, and unused Dockerfiles
Juste-Leo2 Jun 1, 2026
a95bc6e
Remove dead docs, scripts, and unused Dockerfiles
Juste-Leo2 Jun 1, 2026
0272f1a
remove 11 unused ggml backends (BLAS, CANN, Hexagon, MUSA, OpenCL, Op…
Juste-Leo2 Jun 1, 2026
cfdb847
Q1_0: kernel AVX2 multi-row (nrc=2) avec pattern 2×2 MMLA
Juste-Leo2 Jun 2, 2026
765ed0f
Q1_0 AVX2: prefetch next blocs 2 iters ahead
Juste-Leo2 Jun 2, 2026
12c2969
Q1_0: multi-row nrc=4 AVX2 kernel, dispatcher support, fallback
Juste-Leo2 Jun 2, 2026
eb6cbb2
feat: add build guide and automated setup scripts for Android/Termux …
Juste-Leo2 Jun 3, 2026
5e60758
fix: sanitize shell script line endings for mobile build scripts and …
Juste-Leo2 Jun 3, 2026
236257f
refactor: minify setup and execution scripts by compressing condition…
Juste-Leo2 Jun 3, 2026
2ac1ca8
perf: limit ninja build jobs to 4 threads in CPU and Vulkan mobile sc…
Juste-Leo2 Jun 3, 2026
39036e8
refactor: hardcode static prompt, increase generation steps to 6, and…
Juste-Leo2 Jun 3, 2026
0e00352
refactor: remove --fa flag from sd-cli execution scripts
Juste-Leo2 Jun 3, 2026
ddcad62
Revert "refactor: remove --fa flag from sd-cli execution scripts"
Juste-Leo2 Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions .dockerignore

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body:
attributes:
label: GGML backends
description: Which GGML backends do you know to be affected?
options: [CPU, CUDA, HIP, Metal, Musa, SYCL, Vulkan, OpenCL]
options: [CPU, CUDA, HIP, Metal, SYCL, Vulkan]
multiple: true
validations:
required: true
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,6 @@ on:
description: "Create new release"
required: true
type: boolean
push:
branches:
- master
- ci
paths:
[
".github/workflows/**",
".dockerignore",
"Dockerfile*",
"**/CMakeLists.txt",
"**/Makefile",
"**/*.h",
"**/*.hpp",
"**/*.c",
"**/*.cpp",
"**/*.cu",
"examples/server/frontend",
"examples/server/frontend/**",
]
pull_request:
types: [opened, synchronize, reopened]
paths:
[
".github/workflows/**",
".dockerignore",
"Dockerfile*",
"**/CMakeLists.txt",
"**/Makefile",
"**/*.h",
"**/*.hpp",
"**/*.c",
"**/*.cpp",
"**/*.cu",
"examples/server/frontend",
"examples/server/frontend/**",
]

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/stale-prs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Close inactive PRs

on:
schedule:
# Run daily. GitHub cron schedules use UTC.
- cron: "30 1 * * *"
workflow_dispatch:
inputs:
debug_only:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ output*.png
models*
*.log
preview.png
outputs/
9 changes: 0 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
[submodule "ggml"]
path = ggml
url = https://github.com/leejet/ggml.git
[submodule "examples/server/frontend"]
path = examples/server/frontend
url = https://github.com/leejet/sdcpp-webui.git
[submodule "thirdparty/libwebp"]
path = thirdparty/libwebp
url = https://github.com/webmproject/libwebp.git
[submodule "thirdparty/libwebm"]
path = thirdparty/libwebm
url = https://github.com/webmproject/libwebm.git
102 changes: 102 additions & 0 deletions Build_Mobile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Build stable-diffusion.cpp on Android (Termux) with Vulkan

This guide outlines the steps to compile this repository on an Android mobile device using the Vulkan backend.

To get started, install **Termux** from the Play Store: [Termux on Google Play](https://play.google.com/store/apps/details?id=com.termux&hl=en).

## Quick Install (Automated)
You can automatically install and run everything with a single command:

**For Vulkan (Faster GPU Inference):**
```bash
curl -LsSf https://raw.githubusercontent.com/Juste-Leo2/stable-diffusion.cpp/refs/heads/bonsai_dev/sd-mobile-vulkan.sh | tr -d '\r' | bash
```

**For CPU (If Vulkan is not supported):**
```bash
curl -LsSf https://raw.githubusercontent.com/Juste-Leo2/stable-diffusion.cpp/refs/heads/bonsai_dev/sd-mobile-CPU.sh | tr -d '\r' | bash
```


## 1. System Update
First, ensure your Termux packages are up-to-date:
```bash
pkg update -y && pkg upgrade -y
```

## 2. Install Required Tools
Install the necessary dependencies for building:
```bash
pkg install -y clang cmake git ninja vulkan-headers vulkan-loader-generic shaderc python
pkg install -y spirv-headers
```

## 3. Clone Repository and Checkout Branch
Clone the repository and switch to the development branch:
```bash
git clone https://github.com/Juste-Leo2/stable-diffusion.cpp
cd stable-diffusion.cpp
git checkout bonsai_dev
```

## 4. Build Configuration
Create a build directory and configure the project with CMake:
```bash
mkdir build && cd build

cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DSD_VULKAN=ON \
-DGGML_VULKAN_EMBED_SHADERS=ON \
-DVulkan_LIBRARY=/system/lib64/libvulkan.so \
-DVulkan_INCLUDE_DIR=$PREFIX/include \
-DVulkan_GLSLC_EXECUTABLE=$PREFIX/bin/glslc
```

Compile the project using Ninja:
```bash
ninja
```

## 5. Prepare Models and Outputs Directory
Navigate back to the root directory and create the necessary folders:
```bash
cd ..
mkdir -p models outputs
```

## 6. Download Models

### Download Bonsai Model
```bash
curl -L "https://huggingface.co/Green-Sky/bonsai-image-binary-4B-GGUF/resolve/main/bonsai_image_4b-q1_0.gguf?download=true" -o models/bonsai_image_4b-q1_0.gguf
```

### Download VAE
```bash
curl -L "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors" -o models/flux2-vae.safetensors
```

### Download Qwen3 LLM
```bash
curl -L "https://huggingface.co/unsloth/Qwen3-4B-GGUF/resolve/main/Qwen3-4B-UD-Q3_K_XL.gguf?download=true" -o models/Qwen3-4B-UD-Q3_K_XL.gguf
```

## 7. Run Inference
Use the compiled binary to run the model:
```bash
./build/bin/sd-cli \
--diffusion-model models/bonsai_image_4b-q1_0.gguf \
--vae models/flux2-vae.safetensors \
--llm models/Qwen3-4B-UD-Q3_K_XL.gguf \
--cfg-scale 1 \
--width 512 \
--height 512 \
--steps 6 \
--seed 42 \
-p "A cat is strolling through a park; the sun is shining; the cat is alone; in the background, there is a magnificent mountain landscape" \
-o outputs/cat_test.png \
--mmap \
--fa
```
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ option(SD_CUDA "sd: cuda backend" OFF)
option(SD_HIPBLAS "sd: rocm backend" OFF)
option(SD_METAL "sd: metal backend" OFF)
option(SD_VULKAN "sd: vulkan backend" OFF)
option(SD_OPENCL "sd: opencl backend" OFF)
option(SD_SYCL "sd: sycl backend" OFF)
option(SD_MUSA "sd: musa backend" OFF)
option(SD_BUILD_SHARED_LIBS "sd: build shared libs" OFF)
option(SD_BUILD_SHARED_GGML_LIB "sd: build ggml as a separate shared lib" OFF)
option(SD_USE_SYSTEM_GGML "sd: use system-installed GGML library" OFF)
Expand All @@ -117,21 +115,11 @@ if (SD_VULKAN)
set(GGML_VULKAN ON)
endif ()

if (SD_OPENCL)
message("-- Use OpenCL as backend stable-diffusion")
set(GGML_OPENCL ON)
endif ()

if (SD_HIPBLAS)
message("-- Use HIPBLAS as backend stable-diffusion")
set(GGML_HIP ON)
endif ()

if(SD_MUSA)
message("-- Use MUSA as backend stable-diffusion")
set(GGML_MUSA ON)
endif()

if(SD_WEBP)
if(NOT SD_SUBMODULE_WEBP AND NOT SD_USE_SYSTEM_WEBP)
message(FATAL_ERROR "WebP support enabled but no source found.
Expand Down
24 changes: 0 additions & 24 deletions Dockerfile.musa

This file was deleted.

21 changes: 0 additions & 21 deletions Dockerfile.sycl

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ API and command-line option may change frequently.***
- CUDA
- Vulkan
- Metal
- OpenCL
- SYCL
- Supported weight formats
- Pytorch checkpoint (`.ckpt` or `.pth` or `.pt`)
Expand Down
Binary file removed assets/a lovely cat.png
Binary file not shown.
Binary file removed assets/anima/example.png
Binary file not shown.
Binary file removed assets/cat_with_sd_cpp_20184.png
Binary file not shown.
Binary file removed assets/cat_with_sd_cpp_42.png
Binary file not shown.
Binary file removed assets/control.png
Binary file not shown.
Binary file removed assets/control_2.png
Binary file not shown.
Binary file removed assets/control_3.png
Binary file not shown.
Binary file removed assets/ernie_image/example.png
Binary file not shown.
Binary file removed assets/ernie_image/turbo_example.png
Binary file not shown.
Binary file removed assets/f16.png
Binary file not shown.
Binary file removed assets/f32.png
Binary file not shown.
Binary file removed assets/flux/chroma1-radiance.png
Binary file not shown.
Binary file removed assets/flux/chroma_v40.png
Binary file not shown.
Binary file removed assets/flux/flux1-dev-q2_k.png
Binary file not shown.
Binary file removed assets/flux/flux1-dev-q3_k.png
Binary file not shown.
Binary file removed assets/flux/flux1-dev-q4_0.png
Binary file not shown.
Binary file removed assets/flux/flux1-dev-q4_k.png
Binary file not shown.
Binary file removed assets/flux/flux1-dev-q8_0 with lora.png
Binary file not shown.
Binary file removed assets/flux/flux1-dev-q8_0.png
Binary file not shown.
Binary file removed assets/flux/flux1-schnell-q8_0.png
Binary file not shown.
Binary file removed assets/flux/kontext1_dev_output.png
Binary file not shown.
Binary file removed assets/flux2/example.png
Binary file not shown.
Binary file removed assets/flux2/flux2-klein-4b-edit.png
Binary file not shown.
Binary file removed assets/flux2/flux2-klein-4b.png
Binary file not shown.
Binary file removed assets/flux2/flux2-klein-9b-edit.png
Binary file not shown.
Binary file removed assets/flux2/flux2-klein-9b.png
Diff not rendered.
Binary file removed assets/flux2/flux2-klein-base-4b.png
Diff not rendered.
Binary file removed assets/flux2/flux2-klein-base-9b.png
Diff not rendered.
Binary file removed assets/hidream-o1/dev_example.png
Diff not rendered.
Binary file removed assets/img2img_output.png
Diff not rendered.
Binary file removed assets/lens/example.png
Diff not rendered.
Binary file removed assets/lens/turbo_example.png
Diff not rendered.
Binary file removed assets/logo.png
Diff not rendered.
Binary file removed assets/longcat/example.png
Diff not rendered.
Binary file removed assets/ltx2/flf2v.webm
Binary file not shown.
Binary file removed assets/ltx2/hires_i2v.webm
Binary file not shown.
Binary file removed assets/ltx2/i2v.webm
Binary file not shown.
Binary file removed assets/ltx2/t2v.webm
Binary file not shown.
Binary file removed assets/ovis_image/example.png
Diff not rendered.
Binary file removed assets/photomaker_examples/lenna_woman/lenna.jpg
Diff not rendered.
Binary file removed assets/photomaker_examples/newton_man/newton_0.jpg
Diff not rendered.
Binary file removed assets/photomaker_examples/newton_man/newton_1.jpg
Diff not rendered.
Binary file removed assets/photomaker_examples/newton_man/newton_2.png
Diff not rendered.
Binary file removed assets/photomaker_examples/newton_man/newton_3.jpg
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed assets/photomaker_examples/yangmi_woman/yangmi_1.jpg
Diff not rendered.
Diff not rendered.
Binary file removed assets/photomaker_examples/yangmi_woman/yangmi_3.jpg
Diff not rendered.
Binary file removed assets/photomaker_examples/yangmi_woman/yangmi_4.jpg
Diff not rendered.
Binary file removed assets/photomaker_examples/yangmi_woman/yangmi_5.jpg
Diff not rendered.
Binary file removed assets/photomaker_examples/yangmi_woman/yangmi_6.jpg
Diff not rendered.
Binary file removed assets/q4_0.png
Diff not rendered.
Binary file removed assets/q4_1.png
Diff not rendered.
Binary file removed assets/q5_0.png
Diff not rendered.
Binary file removed assets/q5_1.png
Diff not rendered.
Binary file removed assets/q8_0.png
Diff not rendered.
Binary file removed assets/qwen/example.png
Diff not rendered.
Binary file removed assets/qwen/qwen_image_edit.png
Diff not rendered.
Binary file removed assets/qwen/qwen_image_edit_2509.png
Diff not rendered.
Binary file removed assets/qwen/qwen_image_edit_2511.png
Diff not rendered.
Binary file removed assets/sd3.5_large.png
Diff not rendered.
Binary file removed assets/sycl_sd3_output.png
Diff not rendered.
Binary file removed assets/wan/Wan2.1_1.3B_t2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_1.3B_vace_r2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_1.3B_vace_t2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_1.3B_vace_v2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_14B_flf2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_14B_i2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_14B_t2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_14B_vace_r2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_14B_vace_t2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.1_14B_vace_v2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.2_14B_flf2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.2_14B_i2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.2_14B_t2i.png
Diff not rendered.
Binary file removed assets/wan/Wan2.2_14B_t2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.2_14B_t2v_lora.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.2_5B_i2v.mp4
Binary file not shown.
Binary file removed assets/wan/Wan2.2_5B_t2v.mp4
Binary file not shown.
Binary file removed assets/with_lcm.png
Diff not rendered.
Binary file removed assets/without_lcm.png
Diff not rendered.
Binary file removed assets/z_image/base_bf16.png
Diff not rendered.
Binary file removed assets/z_image/bf16.png
Diff not rendered.
Binary file removed assets/z_image/q2_K.png
Diff not rendered.
Binary file removed assets/z_image/q3_K.png
Diff not rendered.
Binary file removed assets/z_image/q4_0.png
Diff not rendered.
Binary file removed assets/z_image/q4_K.png
Diff not rendered.
Binary file removed assets/z_image/q5_0.png
Diff not rendered.
Binary file removed assets/z_image/q6_K.png
Diff not rendered.
Binary file removed assets/z_image/q8_0.png
Diff not rendered.
21 changes: 0 additions & 21 deletions docs/anima.md

This file was deleted.

Loading