Commit 9d2e331 for stable-diffusion.cpp

commit 9d2e3311182836063d00aff485ce6e54dfe795ae
Author: Pento <pentolo@outlook.com>
Date:   Thu Dec 3 16:03:25 2026 +0100

    docs: clarify component and LoRA handling in -M convert (#2504)

diff --git a/docs/guides/quantization_and_gguf.md b/docs/guides/quantization_and_gguf.md
index 5d91535..c76a5ce 100644
--- a/docs/guides/quantization_and_gguf.md
+++ b/docs/guides/quantization_and_gguf.md
@@ -28,8 +28,9 @@ For quantization guided by an importance matrix, see [imatrix](imatrix.md).

 `-M convert` writes converted weights to a file, so they do not need to be
 quantized on every load. It reads `ckpt`, `safetensors`, diffusers, and GGUF
-files. The output is GGUF, or safetensors when the output name ends in
-`.safetensors`; safetensors output supports only unquantized types.
+files. The output (`-o`, default `output.gguf`) is GGUF, or safetensors when
+its name ends in `.safetensors`; safetensors output supports only `f32`, `f16`,
+and `bf16` weights. `--type` and `--tensor-type-rules` work as described above.

 ```sh
 ./bin/sd-cli -M convert \
@@ -38,14 +39,20 @@ files. The output is GGUF, or safetensors when the output name ends in
   --type q8_0 -v
 ```

-To convert a single component, pass it with its usual option instead of `-m`:
-`--diffusion-model`, `--vae`, `--clip_l`, `--clip_g`, or `--t5xxl`. A converted
-diffusion model keeps the `model.diffusion_model.` prefix; load it again with
-`--diffusion-model`.
+### Components

-`--tensor-type-rules` also applies to conversion. For example, this keeps the
-LLM adapter of an Anima model in BF16 and its adaLN modulation in Q6_K, and
-quantizes the remaining weights to Q5_K:
+Pass a full checkpoint, or any single file, with `-m`: tensor names are kept as
+they are. Load the result with the option the original file used, for example
+`--llm`, `--vae`, `--clip_l`, `--clip_g`, or `--t5xxl`.
+
+The component options `--diffusion-model`, `--vae`, `--clip_l`, `--clip_g`, and
+`--t5xxl` add the component prefix to the tensor names. Use them to merge
+components into one checkpoint that loads with `-m`. A diffusion model converted
+alone with `--diffusion-model` keeps the `model.diffusion_model.` prefix and
+loads again with `--diffusion-model`.
+
+For example, this converts an Anima diffusion model to Q5_K while keeping its
+LLM adapter in BF16 and its adaLN modulation in Q6_K:

 ```sh
 ./bin/sd-cli -M convert \
@@ -54,3 +61,26 @@ quantizes the remaining weights to Q5_K:
   --type q5_K \
   --tensor-type-rules "llm_adapter\.=bf16,adaln_modulation=q6_K"
 ```
+
+### LoRAs
+
+LoRAs given as `<lora:name:multiplier>` in `-p` are merged into the converted
+weights. Names resolve against `--lora-model-dir`, with or without the file
+extension. Merging loads the whole model into memory.
+
+```sh
+./bin/sd-cli -M convert \
+  -m ../models/checkpoints/v1-5-pruned-emaonly.safetensors \
+  -o ../models/checkpoints/v1-5-style.q8_0.gguf \
+  --type q8_0 \
+  --lora-model-dir ../models/loras \
+  -p "<lora:style:0.8>"
+```
+
+### Other options
+
+- `-t` sets the number of conversion threads.
+- `--convert-name` renames tensors to sd.cpp's internal names instead of keeping
+  the source names.
+- `--imat-in` applies an importance matrix while quantizing, as it does at load
+  time.