Skip to content

Commit ca4e755

Browse files
committed
docs: reorganize documentation and improve README navigation
1 parent 85a0b90 commit ca4e755

82 files changed

Lines changed: 542 additions & 253 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ logs/
1616
*.exe
1717
*.gguf
1818
output*.png
19-
models*
19+
/models*
2020
*.log
2121
preview.png
2222
.claude/

‎AGENTS.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ documentation.
9191
### Documentation and Tooling
9292

9393
* `docs/` - documentation for supported models, build options, behavior, and
94-
workflows.
94+
workflows; start from `docs/README.md`.
95+
* `docs/models/` - model and component usage guides, including LoRAs, adapters,
96+
auxiliary models, and model-specific examples.
97+
* `docs/guides/` - shared usage workflows, configuration, and performance guides.
98+
* `docs/development/` - internal implementation and model integration conventions.
9599
* `scripts/` - development, model processing, build automation, formatting, and
96100
tooling scripts.
97101
* `cmake/` - CMake support modules.

‎CONTRIBUTING.md‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,28 @@ PRs should include:
3131

3232
## Documentation
3333

34-
Write model usage guides in `docs/` for users. Focus on supported weights,
35-
setup, runnable commands, parameter meanings, output behavior, and practical
36-
limits such as memory requirements. Include technical details only when they
37-
help users choose settings or troubleshoot a problem.
34+
Write model and component usage guides in `docs/models/` for users. Focus on
35+
supported weights, setup, runnable commands, parameter meanings, output behavior,
36+
and practical limits such as memory requirements. Include technical details only
37+
when they help users choose settings or troubleshoot a problem.
38+
39+
Put shared usage workflows and configuration in `docs/guides/`, and internal
40+
implementation details and development conventions in `docs/development/`.
41+
Keep build, Docker, and troubleshooting guides at the root of `docs/`.
42+
Link new documentation from [the documentation index](docs/README.md) or
43+
[the model index](docs/models/README.md), as appropriate. Keep supported model
44+
entries and their guide links in the project README.
3845

3946
Keep tensor layouts, internal class names, kernel implementation details,
4047
algorithm derivations, and development history out of usage guides. Keep task-specific
4148
profiling logs, numerical comparison procedures, and test artifacts local, and
4249
summarize relevant verification results in the PR description.
4350

44-
## README UI Listings
51+
## Application and UI Listings
4552

46-
The [UIs list in the README](README.md#uis) only includes open-source projects that use `stable-diffusion.cpp` as a backend. Do not submit PRs to add closed-source UIs.
53+
The [applications and UIs list](docs/ecosystem.md#applications-and-uis) only
54+
includes open-source projects that use `stable-diffusion.cpp` as a backend.
55+
Do not submit PRs to add closed-source applications or UIs.
4756

4857
## Server Recipes
4958

@@ -76,7 +85,8 @@ Naming conventions:
7685

7786
Some older code in the project may not fully follow the current conventions. Please do not submit PRs that only rewrite existing code to match style rules.
7887

79-
When adding or modifying model implementations, follow the model config and weight detection conventions in [docs/model_config.md](docs/model_config.md).
88+
When adding or modifying model implementations, follow the
89+
[model config and weight detection conventions](docs/development/model_config.md).
8090

8191
## Tokenizer Data
8292

‎README.md‎

Lines changed: 101 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -39,68 +39,69 @@ API and command-line option may change frequently.***
3939

4040
- Plain C/C++ implementation based on [ggml](https://github.com/ggml-org/ggml), working in the same way as [llama.cpp](https://github.com/ggml-org/llama.cpp)
4141
- Super lightweight and without external dependencies
42+
- Built-in [Web UI](./examples/server/README.md) for image and video generation
4243
- Supported models
4344
- Image Models
44-
- [SD1.x, SD2.x, SD-Turbo](./docs/sd.md)
45-
- [SDXL, SDXL-Turbo](./docs/sd.md)
46-
- [Some SD1.x and SDXL distilled models](./docs/distilled_sd.md)
47-
- [SD3/SD3.5](./docs/sd3.md)
48-
- [FLUX.1-dev/FLUX.1-schnell](./docs/flux.md)
49-
- [FLUX.2-dev/FLUX.2-klein](./docs/flux2.md)
50-
- [FLUX.3 Image Klein / Klein Base](./docs/flux3.md)
51-
- [MOSS-Image-Base / MOSS-Image-SFT](./docs/moss_image.md)
52-
- [Fibo 2.0 Dev](./docs/fibo2.md)
53-
- [Lens](./docs/lens.md)
54-
- [Chroma](./docs/chroma.md)
55-
- [Chroma1-Radiance](./docs/chroma_radiance.md)
56-
- [Qwen Image](./docs/qwen_image.md)
57-
- [Qwen Image 2.1](./docs/qwen_image_2.1.md)
58-
- [PiD](./docs/pid.md)
59-
- [LongCat Image](./docs/longcat_image.md)
60-
- [Z-Image](./docs/z_image.md)
61-
- [Z-Image L2P](./docs/z_image_l2p.md)
62-
- [MiniT2I](./docs/minit2i.md)
63-
- [P-H3-Image](./docs/p_h3_image.md)
64-
- [MiniMax-H3-Image](./docs/minimax_h3_image.md)
65-
- [SenseNova U1.5](./docs/sensenova_u1.md)
66-
- [Ovis-Image](./docs/ovis_image.md)
67-
- [Anima](./docs/anima.md)
68-
- [ERNIE-Image](./docs/ernie_image.md)
69-
- [Boogu Image](./docs/boogu_image.md)
70-
- [Krea2](./docs/krea2.md)
71-
- [Mage-Flow](./docs/mage_flow.md)
72-
- [SeFi-Image](./docs/sefi_image.md)
73-
- [HiDream-O1-Image](./docs/hidream_o1_image.md)
74-
- [Ideogram4](./docs/ideogram4.md)
75-
- [LLaDA-Image](./docs/llada_image.md)
76-
- [Ming-Image Design](./docs/ming_image.md)
77-
- [PixArt](./docs/pixart.md)
78-
- [Iris-3B](./docs/iris.md)
79-
- [Image Edit Models](./docs/edit.md)
80-
- [FLUX.1-Kontext-dev](./docs/kontext.md)
81-
- [Qwen Image Edit series](./docs/qwen_image_edit.md)
82-
- [LongCat Image Edit](./docs/longcat_image.md)
83-
- [Boogu Image Edit](./docs/boogu_image.md)
84-
- [Mage-Flow-Edit](./docs/mage_flow.md#image-editing)
85-
- [LLaDA-Image Edit](./docs/llada_image.md#image-editing)
86-
- [Fibo 2.0 Dev / Edit Turbo](./docs/fibo2.md#editing-and-turbo)
45+
- [SD1.x, SD2.x, SD-Turbo](./docs/models/sd.md)
46+
- [SDXL, SDXL-Turbo](./docs/models/sd.md)
47+
- [Some SD1.x and SDXL distilled models](./docs/models/distilled_sd.md)
48+
- [SD3/SD3.5](./docs/models/sd3.md)
49+
- [FLUX.1-dev/FLUX.1-schnell](./docs/models/flux.md)
50+
- [FLUX.2-dev/FLUX.2-klein](./docs/models/flux2.md)
51+
- [FLUX.3 Image Klein / Klein Base](./docs/models/flux3.md)
52+
- [MOSS-Image-Base / MOSS-Image-SFT](./docs/models/moss_image.md)
53+
- [Fibo 2.0 Dev](./docs/models/fibo2.md)
54+
- [Lens](./docs/models/lens.md)
55+
- [Chroma](./docs/models/chroma.md)
56+
- [Chroma1-Radiance](./docs/models/chroma_radiance.md)
57+
- [Qwen Image](./docs/models/qwen_image.md)
58+
- [Qwen Image 2.1](./docs/models/qwen_image_2.1.md)
59+
- [PiD](./docs/models/pid.md)
60+
- [LongCat Image](./docs/models/longcat_image.md)
61+
- [Z-Image](./docs/models/z_image.md)
62+
- [Z-Image L2P](./docs/models/z_image_l2p.md)
63+
- [MiniT2I](./docs/models/minit2i.md)
64+
- [P-H3-Image](./docs/models/p_h3_image.md)
65+
- [MiniMax-H3-Image](./docs/models/minimax_h3_image.md)
66+
- [SenseNova U1.5](./docs/models/sensenova_u1.md)
67+
- [Ovis-Image](./docs/models/ovis_image.md)
68+
- [Anima](./docs/models/anima.md)
69+
- [ERNIE-Image](./docs/models/ernie_image.md)
70+
- [Boogu Image](./docs/models/boogu_image.md)
71+
- [Krea2](./docs/models/krea2.md)
72+
- [Mage-Flow](./docs/models/mage_flow.md)
73+
- [SeFi-Image](./docs/models/sefi_image.md)
74+
- [HiDream-O1-Image](./docs/models/hidream_o1_image.md)
75+
- [Ideogram4](./docs/models/ideogram4.md)
76+
- [LLaDA-Image](./docs/models/llada_image.md)
77+
- [Ming-Image Design](./docs/models/ming_image.md)
78+
- [PixArt](./docs/models/pixart.md)
79+
- [Iris-3B](./docs/models/iris.md)
80+
- [Image Edit Models](./docs/guides/edit.md)
81+
- [FLUX.1-Kontext-dev](./docs/models/kontext.md)
82+
- [Qwen Image Edit series](./docs/models/qwen_image_edit.md)
83+
- [LongCat Image Edit](./docs/models/longcat_image.md)
84+
- [Boogu Image Edit](./docs/models/boogu_image.md)
85+
- [Mage-Flow-Edit](./docs/models/mage_flow.md#image-editing)
86+
- [LLaDA-Image Edit](./docs/models/llada_image.md#image-editing)
87+
- [Fibo 2.0 Dev / Edit Turbo](./docs/models/fibo2.md#examples)
8788
- Video Models
88-
- [Wan2.1/Wan2.2](./docs/wan.md)
89-
- [MiniMax-H3](./docs/minimax_h3.md)
90-
- [LTX-2.3/LTX-2.5](./docs/ltx2.md)
91-
- [HunyuanVideo 1.5](./docs/hunyuan_video.md)
92-
- [LingBot-Video](./docs/lingbot_video.md)
89+
- [Wan2.1/Wan2.2](./docs/models/wan.md)
90+
- [MiniMax-H3](./docs/models/minimax_h3.md)
91+
- [LTX-2.3/LTX-2.5](./docs/models/ltx2.md)
92+
- [HunyuanVideo 1.5](./docs/models/hunyuan_video.md)
93+
- [LingBot-Video](./docs/models/lingbot_video.md)
9394
- Video Upscale Models
94-
- [RelayVSR](./docs/relay_vsr.md)
95-
- [SeedVR2](./docs/seedvr2.md)
96-
- [PhotoMaker](./docs/photo_maker.md) support.
97-
- [IP-Adapter](./docs/ip_adapter.md) support (SD 1.5 and SDXL, including Plus)
95+
- [RelayVSR](./docs/models/relay_vsr.md)
96+
- [SeedVR2](./docs/models/seedvr2.md)
97+
- [PhotoMaker](./docs/models/photo_maker.md) support.
98+
- [IP-Adapter](./docs/models/ip_adapter.md) support (SD 1.5 and SDXL, including Plus)
9899
- Control Net support with SD 1.5
99-
- [ADetailer](./docs/adetailer.md)
100+
- [ADetailer](./docs/models/adetailer.md)
100101
- LoRA support, same as [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#lora)
101102
- Latent Consistency Models support (LCM/LCM-LoRA)
102-
- Faster and memory efficient latent decoding with [TAESD](./docs/taesd.md)
103-
- Upscale images generated with [ESRGAN](./docs/esrgan.md)
103+
- Faster and memory efficient latent decoding with [TAESD](./docs/models/taesd.md)
104+
- Upscale images generated with [ESRGAN](./docs/models/esrgan.md)
104105
- Supported backends
105106
- CPU (AVX, AVX2 and AVX512 support for x86 architectures)
106107
- CUDA
@@ -122,90 +123,75 @@ API and command-line option may change frequently.***
122123
- Negative prompt
123124
- [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) style tokenizer (not all the features, only token weighting for now)
124125
- VAE tiling processing for reduce memory usage
125-
- Sampling method
126-
- `Euler A`
127-
- `Euler`
128-
- `Heun`
129-
- `DPM2`
130-
- `DPM++ 2M`
131-
- [`DPM++ 2M v2`](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8457)
132-
- `DPM++ 2S a`
133-
- `ER-SDE`
134-
- [`LCM`](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13952)
126+
- Support for a wide range of [sampling methods and schedulers](./docs/guides/sampling.md)
135127
- Cross-platform reproducibility
136128
- `--rng cuda`, default, consistent with the `stable-diffusion-webui GPU RNG`
137129
- `--rng cpu`, consistent with the `comfyui RNG`
138130
- Embedds generation parameters into png output as webui-compatible text string
139131

140132
## Quick Start
141133

142-
### Get the sd executable
134+
### Get the executables
143135

144-
- Download pre-built binaries from the [releases page](https://github.com/leejet/stable-diffusion.cpp/releases)
136+
- Download and extract pre-built binaries from the [releases page](https://github.com/leejet/stable-diffusion.cpp/releases)
145137
- Or build from source by following the [build guide](./docs/build.md)
146138

139+
Run the commands below from the directory containing `sd-server` and `sd-cli`
140+
(typically `build/bin/` or `build/bin/Release/` for source builds). On Windows,
141+
use `.\sd-server.exe` and `.\sd-cli.exe` in place of `./sd-server` and `./sd-cli`.
142+
147143
### Download model weights
148144

149-
- download weights(.ckpt or .safetensors or .gguf). For example
150-
- Stable Diffusion v1.5 from https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5
145+
Choose a model from the [model guides](./docs/models/README.md) and download its
146+
weights and required components into a `models/` directory. For a simple example,
147+
download Stable Diffusion v1.5:
148+
149+
```sh
150+
mkdir models
151+
curl -L -o models/v1-5-pruned-emaonly.safetensors https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
152+
```
153+
154+
### Option 1: Web UI
155+
156+
Start the server:
151157

152-
```sh
153-
curl -L -O https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors
154-
```
158+
```sh
159+
./sd-server --model-dir ./models
160+
```
161+
162+
Open <http://127.0.0.1:1234/>, choose the matching model recipe and downloaded
163+
component files, then click **Load models**. Enter a prompt and generate an image.
155164

156-
### Generate an image with just one command
165+
For startup scripts, frontend build requirements, and server options, see the
166+
[server guide](./examples/server/README.md).
167+
168+
### Option 2: CLI
169+
170+
Generate an image with one command:
157171

158172
```sh
159-
./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"
173+
./sd-cli -m ./models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"
160174
```
161175

162-
***For detailed command-line arguments, check out [cli doc](./examples/cli/README.md).***
176+
Run `./sd-cli --help` for the full list of command-line options. See the
177+
[CLI guide](./examples/cli/README.md) for additional usage notes.
163178

164179
## Performance
165180

166-
If you want to improve performance or reduce VRAM/RAM usage, please refer to [performance guide](./docs/performance.md).
167-
For runtime and parameter backend placement, see the [backend selection guide](./docs/backend.md).
181+
If you want to improve performance or reduce VRAM/RAM usage, please refer to [performance guide](./docs/guides/performance.md).
182+
For runtime and parameter backend placement, see the [backend selection guide](./docs/guides/backend.md).
183+
184+
## Documentation
168185

169-
## More Guides
186+
Browse the [documentation index](./docs/README.md) or jump to a topic:
170187

188+
- [Getting started: build, Docker, CLI, and server](./docs/README.md#get-started)
189+
- [Models and components](./docs/models/README.md)
190+
- [Generation and inputs](./docs/README.md#generation-and-inputs)
191+
- [Devices and performance](./docs/README.md#devices-and-performance)
192+
- [Weights and quantization](./docs/README.md#weights-and-quantization)
171193
- [Troubleshooting](./docs/troubleshooting.md)
172-
- [Backend selection](./docs/backend.md)
173-
- [RPC](./docs/rpc.md)
174-
- [LoRA](./docs/lora.md)
175-
- [LCM/LCM-LoRA](./docs/lcm.md)
176-
- [Docker](./docs/docker.md)
177-
- [Quantization and GGUF](./docs/quantization_and_gguf.md)
178-
- [INT8 convrot safetensors](./docs/int8_convrot.md)
179-
- [Inference acceleration via caching](./docs/caching.md)
180-
181-
## Bindings
182-
183-
These projects wrap `stable-diffusion.cpp` for easier use in other languages/frameworks.
184-
185-
* Golang (non-cgo): [seasonjs/stable-diffusion](https://github.com/seasonjs/stable-diffusion)
186-
* Golang (cgo): [Binozo/GoStableDiffusion](https://github.com/Binozo/GoStableDiffusion)
187-
* Golang (non-cgo): [l8bloom/gosd](https://github.com/l8bloom/gosd)
188-
* C#: [DarthAffe/StableDiffusion.NET](https://github.com/DarthAffe/StableDiffusion.NET)
189-
* Python: [william-murray1204/stable-diffusion-cpp-python](https://github.com/william-murray1204/stable-diffusion-cpp-python)
190-
* Rust: [newfla/diffusion-rs](https://github.com/newfla/diffusion-rs)
191-
* Flutter/Dart: [rmatif/Local-Diffusion](https://github.com/rmatif/Local-Diffusion)
192-
193-
## UIs
194-
195-
These projects use `stable-diffusion.cpp` as a backend for their image generation.
196-
197-
- [GIMP Plugins](https://github.com/themanyone/gimp-plugins)
198-
- [Stable Diffusion GUI](https://github.com/fszontagh/sd.cpp.gui.wx)
199-
- [Stable Diffusion CLI-GUI](https://github.com/piallai/stable-diffusion.cpp)
200-
- [Local Diffusion](https://github.com/rmatif/Local-Diffusion)
201-
- [sd.cpp-webui](https://github.com/daniandtheweb/sd.cpp-webui)
202-
- [LocalAI](https://github.com/mudler/LocalAI)
203-
- [Neural-Pixel](https://github.com/Luiz-Alcantara/Neural-Pixel)
204-
- [KoboldCpp](https://github.com/LostRuins/koboldcpp)
205-
- [Kokon](https://github.com/GabrieleLozupone/kokon)
206-
- [NodeTool](https://github.com/nodetool-ai/nodetool)
207-
- [Quo](https://github.com/quo-ai/quo)
208-
- [Prisme](https://github.com/d3Ita/prisme)
194+
- [Development and contributing](./docs/README.md#development)
209195

210196
## Contributors
211197

‎docs/README.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Documentation
2+
3+
For the project overview and supported models, see the [project README](../README.md).
4+
5+
## Get started
6+
7+
- [Model and component guides](models/README.md): download weights and run model-specific examples.
8+
- [Build from source](build.md)
9+
- [Docker](docker.md)
10+
- [CLI usage guide](../examples/cli/README.md)
11+
- [Server setup](../examples/server/README.md)
12+
- [Server API reference](../examples/server/api.md)
13+
- [Community bindings, applications, and UIs](ecosystem.md)
14+
- [Troubleshooting](troubleshooting.md)
15+
16+
## Generation and inputs
17+
18+
- [Sampling methods and schedulers](guides/sampling.md)
19+
- [Image editing](guides/edit.md)
20+
- [Images in prompts](guides/prompt_images.md)
21+
- [Image preprocessing](guides/image_preprocessing.md)
22+
- [Generation results and metadata](guides/generation_metadata.md)
23+
- [JSON tokenizers](guides/tokenizers.md)
24+
25+
## Devices and performance
26+
27+
- [Backend selection and device placement](guides/backend.md)
28+
- [Performance and memory usage](guides/performance.md)
29+
- [Inference caching](guides/caching.md)
30+
- [RPC](guides/rpc.md)
31+
- [SageAttention](guides/sage_attention.md)
32+
33+
## Weights and quantization
34+
35+
- [Quantization and GGUF conversion](guides/quantization_and_gguf.md)
36+
- [Importance matrix quantization](guides/imatrix.md)
37+
- [INT8 and INT4 convrot weights](guides/int8_convrot.md)
38+
39+
## Development
40+
41+
- [Model configuration and integration conventions](development/model_config.md)
42+
- [ggml operator extensions](development/ggml_extensions.md)
43+
- [Backend performance probes](development/backend_probe.md)
44+
- [Position embedding cache](development/pe_cache.md)
45+
- [Contribution guidelines](../CONTRIBUTING.md)

‎docs/build.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cmake --build . --config Release
101101

102102
The sd.cpp SageAttention extension is included when using CUDA with patched
103103
GGML (`SD_USE_UPSTREAM_GGML=OFF`).
104-
See [SageAttention](sage_attention.md) for GPU requirements and `--sage-attn` usage.
104+
See [SageAttention](guides/sage_attention.md) for GPU requirements and `--sage-attn` usage.
105105

106106
This provides GPU acceleration using NVIDIA GPU. Make sure to have the CUDA toolkit installed. You can download it from your Linux distro's package manager (e.g. `apt install nvidia-cuda-toolkit`) or from here: [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads). Recommended to have at least 4 GB of VRAM.
107107

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)