Text-to-Image
Diffusers
Safetensors
Swedish
moss-image
handwriting
historical-documents
archives
htr
synthetic-data
Instructions to use Gabriel/diffu-moss-above with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Gabriel/diffu-moss-above with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Gabriel/diffu-moss-above", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Card: guidance 2 over the first half is diffu's default; faster drawing on Blackwell GPUs (measured 21 Nov); settings that did not change the ink
Browse files
README.md
CHANGED
|
@@ -81,8 +81,28 @@ of ink):
|
|
| 81 |
|
| 82 |
At guidance 3 brown ink drifts toward black and the pen is about a fifth too heavy. The words stayed the same at 3.0,
|
| 83 |
2.0 and 1.5 in the 11 lines read (three pages); at 1.5 a few capitals and one number changed shape. `--guidance 2`
|
| 84 |
-
is the suggested setting
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
## Training
|
| 88 |
|
|
@@ -123,8 +143,9 @@ Letter size and line spacing stay with the layout, as they should: the line boxe
|
|
| 123 |
|
| 124 |
- **The hand follows the sample's pen more than its letter forms.** In most pages the drawn hand moves toward the
|
| 125 |
sample's but keeps much of a generic hand for the period.
|
| 126 |
-
- **At
|
| 127 |
-
|
|
|
|
| 128 |
- **The placement is fixed:** the sample has to be placed above the page (see above). Older diffu code and other
|
| 129 |
MOSS-Image pipelines place it over the page.
|
| 130 |
- **New layouts** (the template test: 18 templates of letters, certificates, forms, lists, tables and registers, each
|
|
|
|
| 81 |
|
| 82 |
At guidance 3 brown ink drifts toward black and the pen is about a fifth too heavy. The words stayed the same at 3.0,
|
| 83 |
2.0 and 1.5 in the 11 lines read (three pages); at 1.5 a few capitals and one number changed shape. `--guidance 2`
|
| 84 |
+
is the suggested setting, and diffu's default since 21 Nov 2026 (with guidance over the first half of the steps only,
|
| 85 |
+
`--guidance-stop 0.5`: the same page a quarter sooner). Not yet checked at a lower guidance: pages drawn with another
|
| 86 |
+
scribe's sample (the swap test below was drawn at 3).
|
| 87 |
+
|
| 88 |
+
Settings that did not change the ink, tested 21 Nov 2026 at guidance 2: the unconditional pass with or without block 22
|
| 89 |
+
skipped, a tag or an empty negative prompt, the sample's ink and paper colours as a `palette` on each text item.
|
| 90 |
+
|
| 91 |
+
### Faster drawing on Blackwell GPUs
|
| 92 |
+
|
| 93 |
+
Measured with diffu at 2 MP with a sample on the page (diffu's `docs/INFERENCE.md`, section 12):
|
| 94 |
+
|
| 95 |
+
| Setting | Gain | The page |
|
| 96 |
+
|---|---|---|
|
| 97 |
+
| Guidance over the first half of the steps (`--guidance-stop 0.5`, the default) | 26-27 % less time a guided page | the same |
|
| 98 |
+
| The joint blocks compiled ahead of time (`diffu-moss-aoti`, then `aoti_package` in the draw settings), bfloat16 | 1.5x a pass on a DGX Spark (a guided page 231 to 160 s); 14-15 s for an 8-step page on ZeroGPU | the same |
|
| 99 |
+
| The joint blocks compiled at load (`--compile-blocks`) | 1.74x a step (measured without a sample) | the same words, strokes a little moved |
|
| 100 |
+
| MXFP8 projections (`precision: mxfp8`, compute capability 10.0 or later) | 2.41x a step compiled | **lighter ink and changed letters: not recommended yet** |
|
| 101 |
+
|
| 102 |
+
A package is built once per GPU kind and torch version on that GPU, holds no weights and serves every joint block. For
|
| 103 |
+
many pages, draw one page a GPU (one process each) rather than splitting a page over GPUs. Distilled 8-step students
|
| 104 |
+
of this model exist but their pages smear and misspell words; they are not published. SGLang Diffusion draws with this
|
| 105 |
+
model through diffu's plugin (`packages/sglang_moss`); vLLM and TensorRT-LLM have no MOSS-Image model.
|
| 106 |
|
| 107 |
## Training
|
| 108 |
|
|
|
|
| 143 |
|
| 144 |
- **The hand follows the sample's pen more than its letter forms.** In most pages the drawn hand moves toward the
|
| 145 |
sample's but keeps much of a generic hand for the period.
|
| 146 |
+
- **At MOSS-Image's default guidance (3) the ink is darker and the pen heavier than the sample's** (see Use): draw at
|
| 147 |
+
2 (diffu's default). A sample with much fainter ink than the training pages' (lightness about 49 against the usual
|
| 148 |
+
30-38) is drawn far too dark at any guidance.
|
| 149 |
- **The placement is fixed:** the sample has to be placed above the page (see above). Older diffu code and other
|
| 150 |
MOSS-Image pipelines place it over the page.
|
| 151 |
- **New layouts** (the template test: 18 templates of letters, certificates, forms, lists, tables and registers, each
|