neonforestmist commited on
Commit
7bb7fb2
·
verified ·
1 Parent(s): 3f2a698

Make model card visual, clear, and easier to explore

Browse files
README.md CHANGED
@@ -5,6 +5,11 @@ inference: false
5
  base_model: nota-ai/bk-sdm-tiny-2m
6
  license: creativeml-openrail-m
7
  tags:
 
 
 
 
 
8
  - clover-image
9
  - text-to-image
10
  - diffusion
@@ -57,545 +62,122 @@ widget:
57
  url: examples/prompt-gallery/original/image_81.png
58
  ---
59
 
60
- # Clover Image Tiny 🍀🤗
61
 
62
- ![Clover Image Tiny mosaic banner](assets/clover-image-tiny-banner.png)
 
 
 
 
 
 
 
63
 
64
  <p align="center">
65
- <a href="https://huggingface.co/neonforestmist/Clover-Image-Tiny"><img src="https://img.shields.io/badge/Hugging%20Face-Model-FFD21E?logo=huggingface&logoColor=black" alt="Hugging Face model" /></a>
66
- <a href="https://github.com/neonforestmist/Clover-Image-Tiny"><img src="https://img.shields.io/badge/GitHub-Source-181717?logo=github&logoColor=white" alt="GitHub source" /></a>
67
- <a href="https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint"><img src="https://img.shields.io/badge/Hugging%20Face-Inpainting-FFB000?logo=huggingface&logoColor=black" alt="Clover Image Tiny Inpaint model" /></a>
68
- <a href="https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo"><img src="https://img.shields.io/badge/Hugging%20Face-Live-FFD21E?logo=huggingface&logoColor=black" alt="Live Hugging Face demo" /></a>
69
- <a href="https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo"><img src="https://img.shields.io/badge/ZeroGPU-Demo-20BEFF?logo=huggingface&logoColor=white" alt="ZeroGPU demo" /></a>
70
- <a href="https://github.com/neonforestmist/Clover-Image-Tiny-iOS"><img src="https://img.shields.io/badge/iPhone-Core%20ML-111111?logo=apple&logoColor=white" alt="iPhone Core ML" /></a>
71
- <a href="https://github.com/neonforestmist/clover-image-tiny-lora-trainer"><img src="https://img.shields.io/badge/Visual%20Trainer-LoRA-7C3AED?logo=python&logoColor=white" alt="LoRA visual trainer" /></a>
72
- <a href="https://github.com/neonforestmist/Clover-Image-Tiny/actions"><img src="https://img.shields.io/badge/Quality%20checks-passing-22C55E?logo=github&logoColor=white" alt="Quality checks passing" /></a>
73
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-CreativeML%20Open%20RAIL--M-D32F2F" alt="CreativeML Open RAIL-M license" /></a>
74
  </p>
75
 
76
- Clover Image Tiny 🤗 is a compact 512×512 diffusion model built for
77
- **low-latency, consumer-grade generation**: local creative tools, edge
78
- applications, and private on-device workflows such as phone inference through
79
- Core ML. It starts from BK-SDM-Tiny's proven compressed Stable Diffusion v1.4
80
- U-Net and gives it a second, fully recorded distillation pass against the full
81
- frozen SD v1.4 teacher. Clover preserves the tiny 323.4M-parameter denoiser and
82
- standard Diffusers compatibility while adding its own refreshed weights,
83
- creator-selected visual character, reproducibility record, adapters,
84
- inpainting, and local/on-device product stack.
85
-
86
- The goal is straightforward: bring useful text-to-image generation closer to
87
- the consumer device instead of assuming a large cloud model for every request.
88
- That local-first design is built with even lower end-to-end product latency in
89
- mind—especially where on-device execution can remove a cloud round trip.
90
- Results vary with the prompt, seed, scheduler, and number of denoising steps.
91
-
92
- For masked image editing, use the dedicated
93
- [Clover Image Tiny Inpaint model →](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint).
94
- It is a separate 9-channel adaptation with its own recommended pipeline and
95
- Core ML resources.
96
-
97
- [**Try Clover Image Tiny & Inpainting in the demo space →**](https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo)
98
-
99
- [**Native Core ML implementation →**](https://github.com/neonforestmist/Clover-Image-Tiny-iOS)
100
-
101
- The demo exposes prompt, negative prompt, seed, guidance, dimensions,
102
- scheduler, and 4–100 conventional Diffusers inference steps. It creates one
103
- image per request and keeps the packaged safety checker enabled.
104
-
105
- ## Contents
106
-
107
- 1. [Overview](#1-overview)
108
- 2. [Examples](#2-examples)
109
- 3. [Small-model benchmark](#3-small-model-benchmark)
110
- 4. [iPhone and Core ML](#4-iphone-and-core-ml)
111
- 5. [Run locally](#5-run-locally)
112
- 6. [Generation controls](#6-generation-controls)
113
- 7. [Hardware and operating systems](#7-hardware-and-operating-systems)
114
- 8. [Python API](#8-python-api)
115
- 9. [About this release](#9-about-this-release)
116
- 10. [Quality and known behavior](#10-quality-and-known-behavior)
117
- 11. [Safety](#11-safety)
118
- 12. [Training lineage and data](#12-training-lineage-and-data)
119
- 13. [Citation](#13-citation)
120
- 14. [Licenses](#14-licenses)
121
- 15. [Reproducibility and artifact identity](#15-reproducibility-and-artifact-identity)
122
-
123
- ## 1. Overview
124
-
125
- ### 1.1 Model profile
126
-
127
- | Profile | Value |
128
- |---|---:|
129
- | Published PyTorch/Diffusers package | **~1.67 GB** |
130
- | Denoiser / U-Net | **323,384,964 parameters** · ~646.8 MB |
131
- | Text encoder | ~246.1 MB |
132
- | VAE | ~167.3 MB |
133
- | Safety checker | ~608.0 MB |
134
- | Native output | 512×512 |
135
- | Inference range | 4–100 steps |
136
- | Published formats | PyTorch/Diffusers + Core ML adapters |
137
-
138
- The package figure includes the text encoder, VAE, tokenizer/configuration, and
139
- the enabled upstream safety checker; it is therefore larger than the denoiser
140
- alone. Component sizes are approximate runtime-footprint context, not a claim
141
- that every byte is active in every backend.
142
-
143
- ### 1.2 What Clover adds to BK-SDM-Tiny-2M
144
-
145
- Clover is a downstream, materially modified checkpoint of
146
- [`nota-ai/bk-sdm-tiny-2m`](https://huggingface.co/nota-ai/bk-sdm-tiny-2m),
147
- not a new or further-compressed architecture. It retains the same block-removed
148
- Stable Diffusion 1.x U-Net topology and parameter count. The tokenizer, text
149
- encoder, and VAE are byte-identical to the pinned upstream components; the
150
- meaningful model-level change is the additionally distilled Clover U-Net
151
- weights.
152
-
153
- | Aspect | BK-SDM-Tiny-2M | Clover Image Tiny |
154
- |---|---|---|
155
- | Training lineage | Its model card reports 50,000 distillation-pretraining iterations on 2,256,472 LAION-Aesthetics pairs | Inherits the pinned `aad3e0e8` checkpoint, then adds a separately audited 500-step Clover distillation run |
156
- | Teacher and objectives | SD v1.4 compression lineage with output and feature KD | Re-distilled against the exact pinned SD v1.4 teacher using equal-weight diffusion-target, teacher-output, and six-point normalized feature losses |
157
- | Clover calibration data | — | Deterministically selected 1,000-pair PD3M set; license-filtered to CC0/Public Domain Mark items with a checksummed deletion audit and manifest |
158
- | Trainable scope | Upstream release | U-Net only; teacher, text encoder, and VAE remained frozen |
159
- | U-Net architecture | Block-removed U-Net, ~323.4M parameters | Same topology and ~323.4M parameters; weights are modified |
160
- | Product target | Efficient compressed Stable Diffusion baseline | Low-latency consumer products: desktop-local generation, edge deployment, and Core ML phone inference |
161
- | Runtime envelope | Original compact baseline | Same parameter count and effectively the same measured latency/memory class—no denoiser-size penalty for the Clover refresh |
162
- | Release additions | Upstream BK-SDM model | Reproducible checkpoint identity, local runner, benchmark evidence, Core ML resources, style LoRAs, inpainting companion, and iOS integration |
163
-
164
- That makes Clover a **quality-refreshed, product-oriented evolution in the same
165
- compact runtime envelope**, rather than merely a rename or a larger model. Its
166
- advantage is the complete path from a small conventional checkpoint to
167
- consumer-facing use: reproducible PyTorch inference, Core ML conversion,
168
- native iPhone integration, style adapters, inpainting, and a hosted demo. The
169
- exact checkpoint was selected after paired visual evaluation because its output
170
- character was preferred for Clover's gallery and product direction.
171
-
172
- The small shared-runtime benchmark below reinforces the efficiency story:
173
- Clover averaged `1.024 s` versus `1.027 s` for BK-SDM-Tiny-2M on the same A10G
174
- recipe, while peak allocation differed by only about 3 MB. Clover scored higher
175
- on the CLIP prompt proxy for 6 of the 16 fixed prompts. BK-SDM-Tiny-2M retained
176
- the higher overall mean (`0.3246` versus `0.3195`), so this small benchmark is
177
- best read as evidence that Clover preserves the base model's efficiency and
178
- competitive small-model behavior while delivering a distinct checkpoint and a
179
- broader consumer-ready ecosystem—not as a universal ranking of image quality.
180
-
181
- ## 2. Examples
182
-
183
- ### 2.1 Prompt gallery
184
-
185
- These nine examples are paired with the exact prompts used for generation. The
186
- portable prompt list is also available at
187
- [`examples/prompt-gallery/original/prompts.txt`](examples/prompt-gallery/original/prompts.txt).
188
-
189
- <Gallery />
190
-
191
- ### 2.2 Base model → style LoRA
192
-
193
- The same tiny-glass-greenhouse prompt shows the base output alongside the three
194
- style adapters. These are visual references for the corresponding LoRA cards.
195
-
196
- | [Base model](https://huggingface.co/neonforestmist/Clover-Image-Tiny) | [Monet](https://huggingface.co/neonforestmist/clover-image-tiny-monet-lora) | [Pointillism](https://huggingface.co/neonforestmist/clover-image-tiny-pointillism-lora) | [Watercolor Anime](https://huggingface.co/neonforestmist/clover-image-tiny-watercolor-anime-lora) |
197
- |---|---|---|---|
198
- | [![Base model greenhouse](examples/normal-to-lora/normal.png)](https://huggingface.co/neonforestmist/Clover-Image-Tiny) | [![Monet greenhouse](examples/normal-to-lora/monet.png)](https://huggingface.co/neonforestmist/clover-image-tiny-monet-lora) | [![Pointillism greenhouse](examples/normal-to-lora/pointillism.png)](https://huggingface.co/neonforestmist/clover-image-tiny-pointillism-lora) | [![Watercolor Anime greenhouse](examples/normal-to-lora/watercolor_anime.png)](https://huggingface.co/neonforestmist/clover-image-tiny-watercolor-anime-lora) |
199
-
200
- ## 3. Small-model benchmark
201
-
202
- Clover is compared with its pinned BK-SDM-Tiny-2M base and two public
203
- same-family references using 16 prompts, identical seeds, 512×512 output, 30
204
- DDIM steps, guidance 7.5, and a shared NVIDIA A10G runtime. The measurement is
205
- an engineering comparison, not a human-preference leaderboard.
206
-
207
- | Model | U-Net parameters | Loaded pipeline parameters | Mean latency | Peak CUDA | Mean CLIP cosine |
208
- |---|---:|---:|---:|---:|---:|
209
- | [Clover Image Tiny](https://huggingface.co/neonforestmist/Clover-Image-Tiny) | 323.4M | 834.1M | 1.024 s | 2,233 MB | 0.3195 |
210
- | [BK-SDM-Tiny-2M](https://huggingface.co/nota-ai/bk-sdm-tiny-2m) | 323.4M | 834.1M | 1.027 s | 2,230 MB | 0.3246 |
211
- | [Segmind Tiny-SD](https://huggingface.co/segmind/tiny-sd) | 323.4M | 530.1M | 1.028 s | 1,649 MB | 0.3345 |
212
- | [BK-SDM-v2-Tiny](https://huggingface.co/nota-ai/bk-sdm-v2-tiny) | 326.8M | 750.9M | 0.957 s | 2,067 MB | 0.3303 |
213
-
214
- The table keeps denoiser size and loaded pipeline size separate. The former is
215
- the most useful apples-to-apples model comparison; the latter includes the
216
- text encoder, VAE, and other loaded components and is runtime context rather
217
- than a download-size metric.
218
-
219
- CLIP cosine is only a prompt-adherence proxy. It is not a human-quality score,
220
- FID, safety evaluation, or evidence that these models are interchangeable.
221
- The complete protocol, machine-readable results, and generated examples are in
222
- [`benchmarks/text-to-image/`](benchmarks/text-to-image/) and the
223
- [full benchmark report](benchmarks/text-to-image/results/clover-small-model-comparison-20260825/REPORT.md).
224
-
225
- ![Four-prompt small-model comparison](benchmarks/text-to-image/results/clover-small-model-comparison-20260825/contact-sheet.png)
226
-
227
- ## 4. iPhone and Core ML
228
-
229
- The companion [Clover Image Tiny iOS project](https://github.com/neonforestmist/Clover-Image-Tiny-iOS)
230
- follows Apple platform conventions and exposes prompt, negative prompt, steps,
231
- guidance, seed, image count, scheduler, random generator, and compute target.
232
- Its model picker downloads SHA-256-verified, immutable Core ML resources from
233
- Hugging Face; the large weights are not committed to the Xcode project or
234
- bundled into the app.
235
-
236
- The base catalog stores the shared text encoder, VAE decoder, safety checker,
237
- and tokenizer once:
238
-
239
- - [`neonforestmist/Clover-Image-Tiny-CoreML`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-CoreML)
240
-
241
- Each trained style is available both as a standard Diffusers LoRA and as its
242
- own Core ML picker download:
243
-
244
- | Style | Diffusers LoRA | Core ML LoRA model |
245
- |---|---|---|
246
- | Monet | [`clover-image-tiny-monet-lora`](https://huggingface.co/neonforestmist/clover-image-tiny-monet-lora) | [`clover-image-tiny-monet-lora-coreml`](https://huggingface.co/neonforestmist/clover-image-tiny-monet-lora-coreml) |
247
- | Pointillism | [`clover-image-tiny-pointillism-lora`](https://huggingface.co/neonforestmist/clover-image-tiny-pointillism-lora) | [`clover-image-tiny-pointillism-lora-coreml`](https://huggingface.co/neonforestmist/clover-image-tiny-pointillism-lora-coreml) |
248
- | Watercolor Anime | [`clover-image-tiny-watercolor-anime-lora`](https://huggingface.co/neonforestmist/clover-image-tiny-watercolor-anime-lora) | [`clover-image-tiny-watercolor-anime-lora-coreml`](https://huggingface.co/neonforestmist/clover-image-tiny-watercolor-anime-lora-coreml) |
249
-
250
- See [`COREML.md`](COREML.md) for conversion details and
251
- [`training/README.md`](training/README.md) for the pinned LoRA jobs.
252
-
253
- ### 4.1 Inpainting track
254
-
255
- The 9-channel SD 1.4-class inpainting adaptation is trained and packaged separately:
256
- [`neonforestmist/Clover-Image-Tiny-Inpaint`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint).
257
- The companion Core ML resource bundle is published at
258
- [`neonforestmist/Clover-Image-Tiny-Inpaint-CoreML`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
259
- Its Modal trainer, Core ML export, and native runtime integration are in
260
- [`inpainting/`](inpainting/), [`modal_inpaint.py`](modal_inpaint.py), and
261
- [`training/README-INPAINTING.md`](training/README-INPAINTING.md).
262
-
263
- The context-aware v2 release distills a pinned SD inpainting teacher with
264
- diverse free-form and object-like masks. It improved held-out masked MAE by
265
- 19.3% over v1. Recommended settings are DPM-Solver++, 20 steps, CFG 6.0, and a
266
- 96-pixel mask-context crop; the runtime composites through the exact mask so
267
- unmasked pixels remain unchanged.
268
- A worked `add blue sunglasses` edit is shown in the
269
- [inpainting model card](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint#inpainting-example).
270
-
271
- In Diffusers, Clover's published attention-only style LoRAs can also be loaded
272
- on the inpainting pipeline because their target layers retain the same shapes.
273
- Adapters that modify the four-channel input convolution are incompatible with
274
- the nine-channel U-Net. Dynamic LoRA loading is a separate deployment feature:
275
- the currently shipped stateless Core ML inpainting path does not expose it.
276
-
277
- ## 5. Run locally
278
-
279
- Download once, then generate offline with the bundled runner. Python 3.11 and
280
- 3.12 are supported.
281
-
282
- ### 5.1 macOS — Apple silicon
283
-
284
- ~~~bash
285
- mkdir clover-image-tiny-local
286
- cd clover-image-tiny-local
287
-
288
- python3.12 -m venv .venv
289
- source .venv/bin/activate
290
- python -m pip install --upgrade pip
291
- python -m pip install "huggingface-hub==0.36.2"
292
-
293
- hf download "neonforestmist/Clover-Image-Tiny" --local-dir model
294
- python -m pip install -r model/requirements.txt
295
-
296
- python model/examples/generate.py \
297
- --model model \
298
- --device mps \
299
- --local-files-only \
300
- --prompt "a tiny glass greenhouse glowing in a moonlit garden, detailed photography" \
301
- --negative-prompt "blurry, distorted, low detail" \
302
- --steps 50 \
303
- --guidance-scale 7.5 \
304
- --scheduler pndm \
305
- --seed 1337 \
306
- --output clover-image-tiny.png
307
-
308
- open clover-image-tiny.png
309
- ~~~
310
-
311
- Use `python3.11` instead if that is the installed supported Python.
312
-
313
- ### 5.2 Windows — PowerShell
314
-
315
- ~~~powershell
316
- mkdir clover-image-tiny-local
317
- cd clover-image-tiny-local
318
-
319
- py -3.12 -m venv .venv
320
- .venv\Scripts\Activate.ps1
321
- python -m pip install --upgrade pip
322
- python -m pip install "huggingface-hub==0.36.2"
323
-
324
- hf download "neonforestmist/Clover-Image-Tiny" --local-dir model
325
- python -m pip install -r model\requirements.txt
326
-
327
- python model\examples\generate.py `
328
- --model model `
329
- --device auto `
330
- --local-files-only `
331
- --prompt "a tiny glass greenhouse glowing in a moonlit garden, detailed photography" `
332
- --negative-prompt "blurry, distorted, low detail" `
333
- --steps 50 `
334
- --guidance-scale 7.5 `
335
- --scheduler pndm `
336
- --seed 1337 `
337
- --output clover-image-tiny.png
338
-
339
- Invoke-Item .\clover-image-tiny.png
340
- ~~~
341
-
342
- Use `py -3.11` if needed. With `--device auto`, the runner selects an
343
- available NVIDIA CUDA GPU and otherwise uses CPU.
344
-
345
- ### 5.3 Linux
346
-
347
- ~~~bash
348
- mkdir clover-image-tiny-local
349
- cd clover-image-tiny-local
350
-
351
- python3.12 -m venv .venv
352
- source .venv/bin/activate
353
- python -m pip install --upgrade pip
354
- python -m pip install "huggingface-hub==0.36.2"
355
-
356
- hf download "neonforestmist/Clover-Image-Tiny" --local-dir model
357
- python -m pip install -r model/requirements.txt
358
-
359
- python model/examples/generate.py \
360
- --model model \
361
- --device auto \
362
- --local-files-only \
363
- --prompt "a tiny glass greenhouse glowing in a moonlit garden, detailed photography" \
364
- --negative-prompt "blurry, distorted, low detail" \
365
- --steps 50 \
366
- --seed 1337 \
367
- --output clover-image-tiny.png
368
- ~~~
369
-
370
- `--device auto` selects CUDA when PyTorch can see an NVIDIA GPU and otherwise
371
- uses CPU. After the first download, `--local-files-only` prevents network
372
- access during generation.
373
-
374
- ## 6. Generation controls
375
-
376
- The command above is ready to copy. Change these flags to explore the model:
377
-
378
- | Flag | Accepted values | Default | What it controls |
379
- |---|---|---|---|
380
- | `--prompt` | Non-empty text | Required | What to generate |
381
- | `--negative-prompt` | Text, or empty | Empty | Details to discourage; the starter commands and live demo use `blurry, distorted, low detail` |
382
- | `--steps` | 4–100 | `50` | Diffusion iterations; more steps take longer and do not guarantee a better image |
383
- | `--guidance-scale` | 0.0–20.0 | `7.5` | How strongly the image follows the prompt |
384
- | `--scheduler` | `pndm`, `ddim`, `euler`, `euler-a`, `dpmpp-2m` | `pndm` | Sampling method |
385
- | `--width` | 256–768, divisible by 64 | `512` | Output width |
386
- | `--height` | 256–768, divisible by 64 | `512` | Output height |
387
- | `--num-images` | 1–4 | `1` | Images generated in one run |
388
- | `--seed` | 0–(2⁶³−1) | `1337` | Repeatable starting seed |
389
- | `--device` | `auto`, `cuda`, `mps`, `cpu` | `auto` | Compute backend |
390
- | `--local-files-only` | Flag | Off | Require an already-downloaded local model |
391
-
392
- The reference configuration is 50-step PNDM, guidance 7.5, 512×512, one
393
- image, seed 1337, and an empty negative prompt. The live demo pre-fills
394
- `blurry, distorted, low detail`; the local runner leaves the field empty unless
395
- you pass the flag.
396
-
397
- For multiple images, the first uses the requested filename and later images use
398
- numbered names such as `clover-image-tiny-02.png`. Seeds advance from the
399
- requested seed. A JSON sidecar beside the first PNG records every resolved
400
- setting, output filename, seed, checksum, and safety result. Existing planned
401
- outputs are never overwritten.
402
-
403
- Run `python model/examples/generate.py --help` for the complete CLI reference.
404
-
405
- ## 7. Hardware and operating systems
406
-
407
- | System | Automatic backend | Precision | Current evidence |
408
- |---|---|---|---|
409
- | iPhone (iOS 17+) | Core ML | mixed/compiled | GitHub project and chunked download path linked above |
410
- | Apple-silicon Mac | MPS | fp16 | Measured locally on an M4 Pro |
411
- | Windows/Linux with NVIDIA | CUDA | fp16 | Supported code path; performance not measured |
412
- | CPU-only macOS/Windows/Linux | CPU | fp32 | Supported code path; performance not measured |
413
- | Windows AMD/DirectML | — | — | No packaged DirectML path |
414
-
415
- Keep at least 2 GB free for the model alone and additional room for the Python
416
- environment and caches; no formal total-install minimum has been measured.
417
- Larger images and batches need more memory; lower `--width`, `--height`, or
418
- `--num-images` if necessary.
419
-
420
- The measured Mac reference used a 24 GB Apple M4 Pro and completed one 512×512
421
- image in 18.21 seconds with fp16 MPS. Its process-lifetime maximum RSS was
422
- 631,341,056 bytes. This is a measured point, not a minimum-RAM claim. No Core
423
- ML package is required for the Python path.
424
-
425
- ## 8. Python API
426
-
427
- ~~~python
428
- import torch
429
- from diffusers import DiffusionPipeline, PNDMScheduler
430
-
431
- model_id = "neonforestmist/Clover-Image-Tiny"
432
- if torch.cuda.is_available():
433
- device = "cuda"
434
- elif torch.backends.mps.is_available():
435
- device = "mps"
436
- else:
437
- device = "cpu"
438
-
439
- dtype = torch.float16 if device in {"cuda", "mps"} else torch.float32
440
- pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=dtype)
441
- pipe.scheduler = PNDMScheduler.from_config(pipe.scheduler.config)
442
- pipe = pipe.to(device)
443
-
444
- generator_device = "cuda" if device == "cuda" else "cpu"
445
- generator = torch.Generator(device=generator_device).manual_seed(1337)
446
- image = pipe(
447
- prompt="a tiny greenhouse glowing in a moonlit garden",
448
- negative_prompt="blurry, distorted, low detail",
449
- num_inference_steps=50,
450
- guidance_scale=7.5,
451
- height=512,
452
- width=512,
453
- generator=generator,
454
- ).images[0]
455
- image.save("clover-image-tiny.png")
456
- ~~~
457
-
458
- Seeded generation is repeatable within the selected runtime. Different
459
- devices, dtypes, kernels, and dependency builds can produce different pixels.
460
-
461
- ## 9. About this release
462
-
463
- Clover Image Tiny is a conventional knowledge-distillation checkpoint trained
464
- for 500 optimizer steps on an exact licensed 1,000-pair calibration set. This
465
- was a real U-Net optimization run—not a repackaging operation. Its final cursor
466
- records 4,000 microsteps and 4,000 sample presentations, with finite training
467
- rows and nonzero gradients throughout.
468
-
469
- The model was initialized from
470
- `nota-ai/bk-sdm-tiny-2m@aad3e0e8ba61b7cb9f64869dc4e586f8ad9d3665`
471
- and distilled with a frozen
472
- `CompVis/stable-diffusion-v1-4@133a221b8aa7292a167afc5127cb63fb5005638b`
473
- teacher. It is a genuinely modified checkpoint, but it was not trained from
474
- random initialization.
475
-
476
- ### 9.1 Clover distillation recipe
477
-
478
- | Training field | Recorded value |
479
  |---|---|
480
- | Student initialization | `nota-ai/bk-sdm-tiny-2m@aad3e0e8ba61b7cb9f64869dc4e586f8ad9d3665` |
481
- | Frozen teacher | `CompVis/stable-diffusion-v1-4@133a221b8aa7292a167afc5127cb63fb5005638b` |
482
- | Trainable parameters | Clover U-Net only; text encoder, VAE, and teacher frozen |
483
- | Resolution | 512×512 |
484
- | Optimization | 500 AdamW steps · effective batch 8 · learning rate `1e-5` |
485
- | Precision | bfloat16 autocast with float32 master weights |
486
- | Objective | `1.0 × diffusion + 1.0 × teacher output + 1.0 × normalized feature KD` |
487
- | Feature transfer | Six source-audited BK-Tiny ↔ SD v1.4 internal feature mappings |
488
- | Reproducibility | Seed 1337 · atomic checkpoints every 50 steps · exact resume proven at step 100 |
489
- | Training hardware | One NVIDIA A100-SXM4-80GB |
490
-
491
- Each objective contributed something complementary: the diffusion term retained
492
- the standard epsilon-prediction task, output KD pulled the compact student
493
- toward the full teacher's denoising prediction, and feature KD aligned internal
494
- representations at six explicitly mapped points across the down, attention, and
495
- up paths. Teacher execution used `no_grad`; no teacher, CLIP text-encoder, or
496
- VAE gradients were accumulated. This gives Clover a targeted weight refresh
497
- without increasing its U-Net parameter count or abandoning standard Stable
498
- Diffusion/Diffusers compatibility.
499
-
500
- This repository contains the PyTorch/Diffusers checkpoint. Core ML artifacts,
501
- style adapters, and the companion iOS project are versioned separately and
502
- linked above.
503
-
504
- ## 10. Quality and known behavior
505
-
506
- - The included gallery demonstrates recognizable subjects across colorful
507
- scenes, products, food, an animal, a landscape, and an interior.
508
- - Individual results vary by prompt, seed, scheduler, and step count. More
509
- steps increase runtime but do not guarantee a better result.
510
- - Hands, anatomy, exact counts and relationships, and readable text can be
511
- difficult.
512
- - The small-model comparison is an engineering benchmark with a CLIP
513
- prompt-adherence proxy, not a controlled human-preference study.
514
- - Resolution and batch size multiply memory use.
515
-
516
- ## 11. Safety
517
-
518
- The upstream safety checker is packaged and enabled in both the supported
519
- runner and hosted demo. A flagged output may be returned as a black placeholder;
520
- the JSON sidecar records `nsfw_content_detected` so the result is not silent.
521
- The checker is useful but not a complete moderation system and can miss harmful
522
- content or over-filter benign content.
523
-
524
- Applications should add controls appropriate to their audience and review
525
- outputs before sharing them. Do not use the model for consequential decisions,
526
- identity claims, medical or legal conclusions, harassment, exploitation,
527
- illegal activity, or uses prohibited by CreativeML OpenRAIL-M.
528
-
529
- ## 12. Training lineage and data
530
-
531
- - Clover fine-tuning data: exactly 1,000 accepted image-caption pairs from
532
- `Spawning/PD3M@2a5eb24a8dccf245acd8e56341761aee06da0bdf`
533
- - Split: 973 train, 17 validation, and 10 test records
534
- - Data gate: `CDLA-Permissive-2.0`; accepted items retain CC0-1.0 or Public
535
- Domain Mark 1.0 provenance
536
- - Preprocessing: deterministic center crop and 512×512 JPEG conversion,
537
- version `clover-pd3m-center-crop-512-jpeg95-v1`
538
- - Dataset-manifest SHA-256:
539
- `50c1249f1cb0d8d690a9acc451ca10c9432eb5a7f4e26f34acb5462096e72322`
540
-
541
- The set was chosen by a deterministic hash ordering from the pinned PD3M
542
- revision, then validated for license, dimensions, MIME type, source
543
- organization, payload integrity, and deletion-list status. The resulting shard,
544
- manifest, rejection log, selection statistics, and preprocessing recipe were
545
- all checksummed. This is a deliberately small calibration pass layered on top
546
- of BK-SDM-Tiny-2M's much larger inherited pretraining—not a claim that Clover
547
- learned general image generation from only 1,000 examples.
548
-
549
- The 1,000 records describe the Clover fine-tuning run. The student and teacher
550
- already contain knowledge from larger upstream corpora. Their pinned model
551
- cards and weight licenses are disclosed, while complete item-level provenance
552
- for all foundational pretraining is not available to this project.
553
-
554
- See `DATA_PROVENANCE.md` for the portable manifest identity and
555
- `MODEL_DATA_LICENSES.md` for the complete component ledger.
556
-
557
- ## 13. Citation
558
-
559
- If Clover Image Tiny is useful in your work, please cite the model release:
560
-
561
- ```bibtex
562
- @software{lozadaperez2026cloverimagetiny,
563
- author = {Lukas Lozada Perez},
564
- title = {Clover Image Tiny: Compact Local Text-to-Image Diffusion},
565
- year = {2026},
566
- url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny}
567
- }
568
- ```
569
-
570
- ## 14. Licenses
571
-
572
- The model weights are a derivative under **CreativeML OpenRAIL-M**. The example
573
- runner and packaging code are under **Apache-2.0**. Dataset and item-level terms
574
- remain separate. Read `LICENSE`, `LICENSE-MODEL-CREATIVEML-OPENRAIL-M.txt`,
575
- `LICENSE-CODE`, and `MODEL_DATA_LICENSES.md` before redistribution or use.
576
-
577
- The hero mosaic is user-supplied presentation artwork included by explicit
578
- request for display in this public model repository. It is not benchmark
579
- evidence, its panel-generation provenance is not claimed, and this package
580
- does not grant a downstream reuse license for it.
581
-
582
- ## 15. Reproducibility and artifact identity
583
-
584
- | Field | Value |
585
  |---|---|
586
- | Repository | `neonforestmist/Clover-Image-Tiny` |
587
- | Release status | **PUBLIC PYTORCH/DIFFUSERS CHECKPOINT RELEASE** |
588
- | Training experiment | `clover-kd-20260712T050925Z-01KXABNHP0` |
589
- | Optimizer step | 500 |
590
- | Checkpoint SHA-256 | `4a5b99ff18478742528a0d31c97dcee939b166a51be858721d40ad5984110893` |
591
- | Checkpoint-bundle SHA-256 | `384b6515f5f26838aea33ec9a941e06610a20764f0b8637c8b7b0667bfc0d447` |
592
- | Resolved-config SHA-256 | `80cf9395d1f587dc0c1d440d9f5b55c55c20703187998509bb306d19d463f597` |
593
- | Denoiser parameters | `323,384,964` |
594
- | Package bytes | `1676086612` |
595
- | Package files | `31` |
596
- | Validated Stage B source-package checksums SHA-256 | `d9a28d5fe6f5b675ee1b9db52e6d0493c8d3d357bb824eac590911acbd5c3ebc` |
597
- | Builder source commit | `9f5ce495fcb88238ec7fdc33204fa42ec9690c37` |
598
-
599
- `checksums.json` covers every file in the immutable validated release package
600
- at the recorded builder commit. Later model-card-only revisions are additionally
601
- preserved by the Hugging Face Git history.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  base_model: nota-ai/bk-sdm-tiny-2m
6
  license: creativeml-openrail-m
7
  tags:
8
+ - local-ai
9
+ - image-generation
10
+ - diffusers
11
+ - lora
12
+ - apple-silicon
13
  - clover-image
14
  - text-to-image
15
  - diffusion
 
62
  url: examples/prompt-gallery/original/image_81.png
63
  ---
64
 
 
65
 
66
+ # 🍀 Clover Image Tiny
67
+
68
+ ### Small model. Room for big ideas.
69
+
70
+ **Turn a few words into an image. Explore a different style. Make a focused edit.**
71
+ Clover Image Tiny is a compact, open-weight AI image generator for local text-to-image
72
+ workflows on Mac, Windows, and Linux, with Core ML releases for Apple devices.
73
+ Download the model once, then create offline on your own hardware.
74
 
75
  <p align="center">
76
+ <a href="https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo"><img alt="Try the demo" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/main/assets/links/try-demo.svg" height="40"></a>
77
+ <a href="https://huggingface.co/neonforestmist/Clover-Image-Tiny"><img alt="Get the model" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/main/assets/links/get-model.svg" height="40"></a>
78
+ <a href="https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint"><img alt="Inpainting" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/main/assets/links/inpainting.svg" height="40"></a>
79
+ <a href="https://github.com/neonforestmist/Clover-Image-Tiny"><img alt="GitHub source" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/main/assets/links/github-source.svg" height="40"></a>
 
 
 
 
 
80
  </p>
81
 
82
+ ## Why create with Clover?
83
+
84
+ - **Keep your ideas local.** Run generation on your own computer after downloading the weights.
85
+ - **Start small.** The regular model has a 323.4M-parameter denoiser and generates at a native 512 × 512 resolution.
86
+ - **Find your look.** Explore Monet, Pointillism, and Watercolor Anime with optional style adapters.
87
+ - **Make it part of your workflow.** Use a visual demo, Python, a command-line runner, or the native Core ML app.
88
+
89
+ Clover is a good fit for visual brainstorming, illustration experiments, and developers
90
+ building local creative tools. You control the prompt, seed, style, and generation settings.
91
+
92
+ ## Create from a prompt
93
+
94
+ Describe the scene you want to explore. The regular Clover model can turn simple prompts
95
+ into landscapes, still lifes, and stylized artwork. These are existing model examples,
96
+ with the original prompts shown below.
97
+
98
+ | Moonlit greenhouse | Blue flowers | Stained-glass night |
99
+ |:---:|:---:|:---:|
100
+ | ![Clover text-to-image output: a tiny greenhouse in a moonlit garden](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/prompt-gallery/original/image_74.png) | ![Clover text-to-image output: a bouquet of blue flowers](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/prompt-gallery/original/image_79.png) | ![Clover text-to-image output: a stained-glass starry night](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/prompt-gallery/original/image_78.png) |
101
+ | “a tiny glass greenhouse glowing in a moonlit garden” | “A bouquet of blue flowers” | “A stain glass window of a starry night” |
102
+
103
+ ## Change a detail with inpainting
104
+
105
+ Keep the image you started with and describe an edit to a selected area. Inpainting means
106
+ painting a mask over the part you want to regenerate—white marks the edit, black marks what
107
+ to keep. The published example below uses the prompt **“add blue sunglasses.”**
108
+
109
+ | Before | After the masked edit |
110
+ |:---:|:---:|
111
+ | ![Original cat artwork before the masked sunglasses edit](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/3e22009fb6e61944f28b0389f775fc47e2c48724/examples/sunglasses-source.png) | ![Clover inpainting example: the cat with blue sunglasses added](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/3e22009fb6e61944f28b0389f775fc47e2c48724/examples/sunglasses-result.png) |
112
+
113
+ [**Explore Clover Inpaint HQ →**](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint) · [**Try generation and inpainting →**](https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo)
114
+
115
+ Inpaint HQ pairs the full Stable Diffusion 1.5 inpainting denoiser with Clover's shared
116
+ components. It is a larger, separate model focused on editing quality. For exact preservation,
117
+ composite the result through the original binary mask.
118
+
119
+ ## One prompt, different styles
120
+
121
+ Style adapters—also called LoRAs—let you change the visual character of your images.
122
+ Here is the same greenhouse prompt with the base model and three published Clover styles.
123
+
124
+ | Clover | Monet | Pointillism | Watercolor Anime |
125
+ |:---:|:---:|:---:|:---:|
126
+ | ![Base Clover greenhouse example](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/normal-to-lora/normal.png) | ![Monet style greenhouse with painterly brushwork](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/normal-to-lora/monet.png) | ![Pointillism style greenhouse made from colored dots](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/normal-to-lora/pointillism.png) | ![Watercolor Anime style greenhouse illustration](https://huggingface.co/neonforestmist/Clover-Image-Tiny/resolve/3f2a698bc3cbad617970a73d623e0732bb5f87f5/examples/normal-to-lora/watercolor_anime.png) |
127
+ | [Base model](https://huggingface.co/neonforestmist/Clover-Image-Tiny) | [Get Monet](https://huggingface.co/neonforestmist/clover-image-tiny-monet-lora) | [Get Pointillism](https://huggingface.co/neonforestmist/clover-image-tiny-pointillism-lora) | [Get Watercolor Anime](https://huggingface.co/neonforestmist/clover-image-tiny-watercolor-anime-lora) |
128
+
129
+ ## Choose your way to create
130
+
131
+ | Your workflow | Start here |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  |---|---|
133
+ | Try it in your browser | [Hosted demo: generation and inpainting](https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo) |
134
+ | Generate locally with a visual interface | [GitHub setup and Gradio app](https://github.com/neonforestmist/Clover-Image-Tiny#run-clover-locally) |
135
+ | Build with Python and Diffusers | [Model weights](https://huggingface.co/neonforestmist/Clover-Image-Tiny) · [Local runner](https://github.com/neonforestmist/Clover-Image-Tiny/blob/main/generate.py) |
136
+ | Create on iPhone or iPad | [Native Clover app](https://github.com/neonforestmist/Clover-Image-Tiny-iOS) · [Core ML resources](https://huggingface.co/neonforestmist/Clover-Image-Tiny-CoreML) |
137
+ | Train a personal style | [Visual LoRA trainer](https://github.com/neonforestmist/clover-image-tiny-lora-trainer) |
138
+
139
+ The hosted demo runs remotely. Local Python and Core ML workflows run on your hardware
140
+ after setup; model downloads require a network connection.
141
+
142
+ ## Small enough to build around
143
+
144
+ | Regular Clover model | What it means |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  |---|---|
146
+ | **323.4M denoiser parameters** | A compact Stable Diffusion 1.4-class image model |
147
+ | **About 1.67 GB of model files** | Includes the text encoder, VAE, and packaged safety checker; allow extra space for dependencies and caches |
148
+ | **512 × 512 native output** | A practical starting point for visual experiments |
149
+ | **Diffusers + separate Core ML exports** | Python integration and a path to on-device Apple apps |
150
+
151
+ On one NVIDIA A10G benchmark, Clover averaged **1.024 seconds per image** across
152
+ 16 prompts at 512 × 512, 30 DDIM steps, and guidance 7.5. That is a specific measured
153
+ GPU result, not an iPhone timing or a speed guarantee. [See the comparison and protocol](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/benchmarks/text-to-image/results/clover-small-model-comparison-20260825/REPORT.md).
154
+
155
+ ## A few things to know
156
+
157
+ **Can I use Clover offline?** Yes. Download the model and dependencies first, then use
158
+ `--local-files-only` with the local runner. No hosted generation service is required.
159
+
160
+ **Does it work on a Mac?** The Python path supports Apple silicon through PyTorch MPS.
161
+ NVIDIA systems use CUDA; CPU inference is also supported, but slower.
162
+
163
+ **Is normal Clover the same as Inpaint HQ?** They are separate checkpoints. Normal Clover
164
+ creates images from text. Inpaint HQ takes an image, a mask, and a prompt, and uses a larger denoiser.
165
+
166
+ **What are its limits?** Hands, faces, readable text, precise counts, and complex relationships
167
+ can be unreliable. Examples are selected outputs; results vary with prompts and settings.
168
+ The packaged safety checker in the Python runner and hosted demo is imperfect.
169
+
170
+ ## Model lineage, license, and research details
171
+
172
+ Clover starts from [BK-SDM-Tiny-2M](https://huggingface.co/nota-ai/bk-sdm-tiny-2m)
173
+ and adds a recorded 500-step distillation pass against Stable Diffusion 1.4.
174
+ It retains the compact architecture; its U-Net weights are refreshed.
175
+
176
+ Model weights use **CreativeML Open RAIL-M** and the example code uses **Apache-2.0**.
177
+ See the [component license ledger](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/MODEL_DATA_LICENSES.md) for the full terms and inherited obligations.
178
+
179
+ [**Technical reference: setup, benchmarks, training, and citation**](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/docs/MODEL_DETAILS.md) ·
180
+ [Data provenance](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/DATA_PROVENANCE.md) ·
181
+ [All nine prompt examples](https://huggingface.co/neonforestmist/Clover-Image-Tiny/tree/main/examples/prompt-gallery/original)
182
+
183
+ Created by **Lukas Lozada Perez**.
assets/links/get-model.svg ADDED
assets/links/github-source.svg ADDED
assets/links/inpainting.svg ADDED
assets/links/try-demo.svg ADDED
assets/links/try-inpainting.svg ADDED
docs/MODEL_DETAILS.md ADDED
@@ -0,0 +1,357 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Clover Image Tiny — technical reference
2
+
3
+ Detailed setup, evaluation, training provenance, and release identity for the regular model.
4
+ [Back to the visual model card](https://huggingface.co/neonforestmist/Clover-Image-Tiny).
5
+
6
+ ## 3. Small-model benchmark
7
+
8
+ Clover is compared with its pinned BK-SDM-Tiny-2M base and two public
9
+ same-family references using 16 prompts, identical seeds, 512×512 output, 30
10
+ DDIM steps, guidance 7.5, and a shared NVIDIA A10G runtime. The measurement is
11
+ an engineering comparison, not a human-preference leaderboard.
12
+
13
+ | Model | U-Net parameters | Loaded pipeline parameters | Mean latency | Peak CUDA | Mean CLIP cosine |
14
+ |---|---:|---:|---:|---:|---:|
15
+ | [Clover Image Tiny](https://huggingface.co/neonforestmist/Clover-Image-Tiny) | 323.4M | 834.1M | 1.024 s | 2,233 MB | 0.3195 |
16
+ | [BK-SDM-Tiny-2M](https://huggingface.co/nota-ai/bk-sdm-tiny-2m) | 323.4M | 834.1M | 1.027 s | 2,230 MB | 0.3246 |
17
+ | [Segmind Tiny-SD](https://huggingface.co/segmind/tiny-sd) | 323.4M | 530.1M | 1.028 s | 1,649 MB | 0.3345 |
18
+ | [BK-SDM-v2-Tiny](https://huggingface.co/nota-ai/bk-sdm-v2-tiny) | 326.8M | 750.9M | 0.957 s | 2,067 MB | 0.3303 |
19
+
20
+ The table keeps denoiser size and loaded pipeline size separate. The former is
21
+ the most useful apples-to-apples model comparison; the latter includes the
22
+ text encoder, VAE, and other loaded components and is runtime context rather
23
+ than a download-size metric.
24
+
25
+ CLIP cosine is only a prompt-adherence proxy. It is not a human-quality score,
26
+ FID, safety evaluation, or evidence that these models are interchangeable.
27
+ The complete protocol, machine-readable results, and generated examples are in
28
+ [`benchmarks/text-to-image/`](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/benchmarks/text-to-image/) and the
29
+ [full benchmark report](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/benchmarks/text-to-image/results/clover-small-model-comparison-20260825/REPORT.md).
30
+
31
+ ![Four-prompt small-model comparison](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/benchmarks/text-to-image/results/clover-small-model-comparison-20260825/contact-sheet.png)
32
+
33
+ ## 5. Run locally
34
+
35
+ Download once, then generate offline with the bundled runner. Python 3.11 and
36
+ 3.12 are supported.
37
+
38
+ ### 5.1 macOS — Apple silicon
39
+
40
+ ~~~bash
41
+ mkdir clover-image-tiny-local
42
+ cd clover-image-tiny-local
43
+
44
+ python3.12 -m venv .venv
45
+ source .venv/bin/activate
46
+ python -m pip install --upgrade pip
47
+ python -m pip install "huggingface-hub==0.36.2"
48
+
49
+ hf download "neonforestmist/Clover-Image-Tiny" --local-dir model
50
+ python -m pip install -r model/requirements.txt
51
+
52
+ python model/examples/generate.py \
53
+ --model model \
54
+ --device mps \
55
+ --local-files-only \
56
+ --prompt "a tiny glass greenhouse glowing in a moonlit garden, detailed photography" \
57
+ --negative-prompt "blurry, distorted, low detail" \
58
+ --steps 50 \
59
+ --guidance-scale 7.5 \
60
+ --scheduler pndm \
61
+ --seed 1337 \
62
+ --output clover-image-tiny.png
63
+
64
+ open clover-image-tiny.png
65
+ ~~~
66
+
67
+ Use `python3.11` instead if that is the installed supported Python.
68
+
69
+ ### 5.2 Windows — PowerShell
70
+
71
+ ~~~powershell
72
+ mkdir clover-image-tiny-local
73
+ cd clover-image-tiny-local
74
+
75
+ py -3.12 -m venv .venv
76
+ .venv\Scripts\Activate.ps1
77
+ python -m pip install --upgrade pip
78
+ python -m pip install "huggingface-hub==0.36.2"
79
+
80
+ hf download "neonforestmist/Clover-Image-Tiny" --local-dir model
81
+ python -m pip install -r model\requirements.txt
82
+
83
+ python model\examples\generate.py `
84
+ --model model `
85
+ --device auto `
86
+ --local-files-only `
87
+ --prompt "a tiny glass greenhouse glowing in a moonlit garden, detailed photography" `
88
+ --negative-prompt "blurry, distorted, low detail" `
89
+ --steps 50 `
90
+ --guidance-scale 7.5 `
91
+ --scheduler pndm `
92
+ --seed 1337 `
93
+ --output clover-image-tiny.png
94
+
95
+ Invoke-Item .\clover-image-tiny.png
96
+ ~~~
97
+
98
+ Use `py -3.11` if needed. With `--device auto`, the runner selects an
99
+ available NVIDIA CUDA GPU and otherwise uses CPU.
100
+
101
+ ### 5.3 Linux
102
+
103
+ ~~~bash
104
+ mkdir clover-image-tiny-local
105
+ cd clover-image-tiny-local
106
+
107
+ python3.12 -m venv .venv
108
+ source .venv/bin/activate
109
+ python -m pip install --upgrade pip
110
+ python -m pip install "huggingface-hub==0.36.2"
111
+
112
+ hf download "neonforestmist/Clover-Image-Tiny" --local-dir model
113
+ python -m pip install -r model/requirements.txt
114
+
115
+ python model/examples/generate.py \
116
+ --model model \
117
+ --device auto \
118
+ --local-files-only \
119
+ --prompt "a tiny glass greenhouse glowing in a moonlit garden, detailed photography" \
120
+ --negative-prompt "blurry, distorted, low detail" \
121
+ --steps 50 \
122
+ --seed 1337 \
123
+ --output clover-image-tiny.png
124
+ ~~~
125
+
126
+ `--device auto` selects CUDA when PyTorch can see an NVIDIA GPU and otherwise
127
+ uses CPU. After the first download, `--local-files-only` prevents network
128
+ access during generation.
129
+
130
+ ## 6. Generation controls
131
+
132
+ The command above is ready to copy. Change these flags to explore the model:
133
+
134
+ | Flag | Accepted values | Default | What it controls |
135
+ |---|---|---|---|
136
+ | `--prompt` | Non-empty text | Required | What to generate |
137
+ | `--negative-prompt` | Text, or empty | Empty | Details to discourage; the starter commands and live demo use `blurry, distorted, low detail` |
138
+ | `--steps` | 4–100 | `50` | Diffusion iterations; more steps take longer and do not guarantee a better image |
139
+ | `--guidance-scale` | 0.0–20.0 | `7.5` | How strongly the image follows the prompt |
140
+ | `--scheduler` | `pndm`, `ddim`, `euler`, `euler-a`, `dpmpp-2m` | `pndm` | Sampling method |
141
+ | `--width` | 256–768, divisible by 64 | `512` | Output width |
142
+ | `--height` | 256–768, divisible by 64 | `512` | Output height |
143
+ | `--num-images` | 1–4 | `1` | Images generated in one run |
144
+ | `--seed` | 0–(2⁶³−1) | `1337` | Repeatable starting seed |
145
+ | `--device` | `auto`, `cuda`, `mps`, `cpu` | `auto` | Compute backend |
146
+ | `--local-files-only` | Flag | Off | Require an already-downloaded local model |
147
+
148
+ The reference configuration is 50-step PNDM, guidance 7.5, 512×512, one
149
+ image, seed 1337, and an empty negative prompt. The live demo pre-fills
150
+ `blurry, distorted, low detail`; the local runner leaves the field empty unless
151
+ you pass the flag.
152
+
153
+ For multiple images, the first uses the requested filename and later images use
154
+ numbered names such as `clover-image-tiny-02.png`. Seeds advance from the
155
+ requested seed. A JSON sidecar beside the first PNG records every resolved
156
+ setting, output filename, seed, checksum, and safety result. Existing planned
157
+ outputs are never overwritten.
158
+
159
+ Run `python model/examples/generate.py --help` for the complete CLI reference.
160
+
161
+ ## 7. Hardware and operating systems
162
+
163
+ | System | Automatic backend | Precision | Current evidence |
164
+ |---|---|---|---|
165
+ | iPhone (see current app requirements) | Core ML | mixed/compiled | GitHub project and chunked download path linked above |
166
+ | Apple-silicon Mac | MPS | fp16 | Measured locally on an M4 Pro |
167
+ | Windows/Linux with NVIDIA | CUDA | fp16 | Supported code path; performance not measured |
168
+ | CPU-only macOS/Windows/Linux | CPU | fp32 | Supported code path; performance not measured |
169
+ | Windows AMD/DirectML | — | — | No packaged DirectML path |
170
+
171
+ Keep at least 2 GB free for the model alone and additional room for the Python
172
+ environment and caches; no formal total-install minimum has been measured.
173
+ Larger images and batches need more memory; lower `--width`, `--height`, or
174
+ `--num-images` if necessary.
175
+
176
+ The measured Mac reference used a 24 GB Apple M4 Pro and completed one 512×512
177
+ image in 18.21 seconds with fp16 MPS. Its process-lifetime maximum RSS was
178
+ 631,341,056 bytes. This is a measured point, not a minimum-RAM claim. No Core
179
+ ML package is required for the Python path.
180
+
181
+ ## 8. Python API
182
+
183
+ ~~~python
184
+ import torch
185
+ from diffusers import DiffusionPipeline, PNDMScheduler
186
+
187
+ model_id = "neonforestmist/Clover-Image-Tiny"
188
+ if torch.cuda.is_available():
189
+ device = "cuda"
190
+ elif torch.backends.mps.is_available():
191
+ device = "mps"
192
+ else:
193
+ device = "cpu"
194
+
195
+ dtype = torch.float16 if device in {"cuda", "mps"} else torch.float32
196
+ pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=dtype)
197
+ pipe.scheduler = PNDMScheduler.from_config(pipe.scheduler.config)
198
+ pipe = pipe.to(device)
199
+
200
+ generator_device = "cuda" if device == "cuda" else "cpu"
201
+ generator = torch.Generator(device=generator_device).manual_seed(1337)
202
+ image = pipe(
203
+ prompt="a tiny greenhouse glowing in a moonlit garden",
204
+ negative_prompt="blurry, distorted, low detail",
205
+ num_inference_steps=50,
206
+ guidance_scale=7.5,
207
+ height=512,
208
+ width=512,
209
+ generator=generator,
210
+ ).images[0]
211
+ image.save("clover-image-tiny.png")
212
+ ~~~
213
+
214
+ Seeded generation is repeatable within the selected runtime. Different
215
+ devices, dtypes, kernels, and dependency builds can produce different pixels.
216
+
217
+ ## 9. About this release
218
+
219
+ Clover Image Tiny is a conventional knowledge-distillation checkpoint trained
220
+ for 500 optimizer steps on an exact licensed 1,000-pair calibration set. This
221
+ was a real U-Net optimization run—not a repackaging operation. Its final cursor
222
+ records 4,000 microsteps and 4,000 sample presentations, with finite training
223
+ rows and nonzero gradients throughout.
224
+
225
+ The model was initialized from
226
+ `nota-ai/bk-sdm-tiny-2m@aad3e0e8ba61b7cb9f64869dc4e586f8ad9d3665`
227
+ and distilled with a frozen
228
+ `CompVis/stable-diffusion-v1-4@133a221b8aa7292a167afc5127cb63fb5005638b`
229
+ teacher. It is a genuinely modified checkpoint, but it was not trained from
230
+ random initialization.
231
+
232
+ ### 9.1 Clover distillation recipe
233
+
234
+ | Training field | Recorded value |
235
+ |---|---|
236
+ | Student initialization | `nota-ai/bk-sdm-tiny-2m@aad3e0e8ba61b7cb9f64869dc4e586f8ad9d3665` |
237
+ | Frozen teacher | `CompVis/stable-diffusion-v1-4@133a221b8aa7292a167afc5127cb63fb5005638b` |
238
+ | Trainable parameters | Clover U-Net only; text encoder, VAE, and teacher frozen |
239
+ | Resolution | 512×512 |
240
+ | Optimization | 500 AdamW steps · effective batch 8 · learning rate `1e-5` |
241
+ | Precision | bfloat16 autocast with float32 master weights |
242
+ | Objective | `1.0 × diffusion + 1.0 × teacher output + 1.0 × normalized feature KD` |
243
+ | Feature transfer | Six source-audited BK-Tiny ↔ SD v1.4 internal feature mappings |
244
+ | Reproducibility | Seed 1337 · atomic checkpoints every 50 steps · exact resume proven at step 100 |
245
+ | Training hardware | One NVIDIA A100-SXM4-80GB |
246
+
247
+ Each objective contributed something complementary: the diffusion term retained
248
+ the standard epsilon-prediction task, output KD pulled the compact student
249
+ toward the full teacher's denoising prediction, and feature KD aligned internal
250
+ representations at six explicitly mapped points across the down, attention, and
251
+ up paths. Teacher execution used `no_grad`; no teacher, CLIP text-encoder, or
252
+ VAE gradients were accumulated. This gives Clover a targeted weight refresh
253
+ without increasing its U-Net parameter count or abandoning standard Stable
254
+ Diffusion/Diffusers compatibility.
255
+
256
+ This repository contains the PyTorch/Diffusers checkpoint. Core ML artifacts,
257
+ style adapters, and the companion iOS project are versioned separately and
258
+ linked above.
259
+
260
+ ## 10. Quality and known behavior
261
+
262
+ - The included gallery demonstrates recognizable subjects across colorful
263
+ scenes, products, food, an animal, a landscape, and an interior.
264
+ - Individual results vary by prompt, seed, scheduler, and step count. More
265
+ steps increase runtime but do not guarantee a better result.
266
+ - Hands, anatomy, exact counts and relationships, and readable text can be
267
+ difficult.
268
+ - The small-model comparison is an engineering benchmark with a CLIP
269
+ prompt-adherence proxy, not a controlled human-preference study.
270
+ - Resolution and batch size multiply memory use.
271
+
272
+ ## 11. Safety
273
+
274
+ The upstream safety checker is packaged and enabled in both the supported
275
+ runner and hosted demo. A flagged output may be returned as a black placeholder;
276
+ the JSON sidecar records `nsfw_content_detected` so the result is not silent.
277
+ The checker is useful but not a complete moderation system and can miss harmful
278
+ content or over-filter benign content.
279
+
280
+ Applications should add controls appropriate to their audience and review
281
+ outputs before sharing them. Do not use the model for consequential decisions,
282
+ identity claims, medical or legal conclusions, harassment, exploitation,
283
+ illegal activity, or uses prohibited by CreativeML OpenRAIL-M.
284
+
285
+ ## 12. Training lineage and data
286
+
287
+ - Clover fine-tuning data: exactly 1,000 accepted image-caption pairs from
288
+ `Spawning/PD3M@2a5eb24a8dccf245acd8e56341761aee06da0bdf`
289
+ - Split: 973 train, 17 validation, and 10 test records
290
+ - Data gate: `CDLA-Permissive-2.0`; accepted items retain CC0-1.0 or Public
291
+ Domain Mark 1.0 provenance
292
+ - Preprocessing: deterministic center crop and 512×512 JPEG conversion,
293
+ version `clover-pd3m-center-crop-512-jpeg95-v1`
294
+ - Dataset-manifest SHA-256:
295
+ `50c1249f1cb0d8d690a9acc451ca10c9432eb5a7f4e26f34acb5462096e72322`
296
+
297
+ The set was chosen by a deterministic hash ordering from the pinned PD3M
298
+ revision, then validated for license, dimensions, MIME type, source
299
+ organization, payload integrity, and deletion-list status. The resulting shard,
300
+ manifest, rejection log, selection statistics, and preprocessing recipe were
301
+ all checksummed. This is a deliberately small calibration pass layered on top
302
+ of BK-SDM-Tiny-2M's much larger inherited pretraining—not a claim that Clover
303
+ learned general image generation from only 1,000 examples.
304
+
305
+ The 1,000 records describe the Clover fine-tuning run. The student and teacher
306
+ already contain knowledge from larger upstream corpora. Their pinned model
307
+ cards and weight licenses are disclosed, while complete item-level provenance
308
+ for all foundational pretraining is not available to this project.
309
+
310
+ See `DATA_PROVENANCE.md` for the portable manifest identity and
311
+ `MODEL_DATA_LICENSES.md` for the complete component ledger.
312
+
313
+ ## 13. Citation
314
+
315
+ If Clover Image Tiny is useful in your work, please cite the model release:
316
+
317
+ ```bibtex
318
+ @software{lozadaperez2026cloverimagetiny,
319
+ author = {Lukas Lozada Perez},
320
+ title = {Clover Image Tiny: Compact Local Text-to-Image Diffusion},
321
+ year = {2026},
322
+ url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny}
323
+ }
324
+ ```
325
+
326
+ ## 14. Licenses
327
+
328
+ The model weights are a derivative under **CreativeML OpenRAIL-M**. The example
329
+ runner and packaging code are under **Apache-2.0**. Dataset and item-level terms
330
+ remain separate. Read `LICENSE`, `LICENSE-MODEL-CREATIVEML-OPENRAIL-M.txt`,
331
+ `LICENSE-CODE`, and `MODEL_DATA_LICENSES.md` before redistribution or use.
332
+
333
+ The legacy hero mosaic is user-supplied presentation artwork included by explicit
334
+ request for display in this public model repository. It is not benchmark
335
+ evidence, its panel-generation provenance is not claimed, and this package
336
+ does not grant a downstream reuse license for it.
337
+
338
+ ## 15. Reproducibility and artifact identity
339
+
340
+ | Field | Value |
341
+ |---|---|
342
+ | Repository | `neonforestmist/Clover-Image-Tiny` |
343
+ | Release status | **PUBLIC PYTORCH/DIFFUSERS CHECKPOINT RELEASE** |
344
+ | Training experiment | `clover-kd-20260712T050925Z-01KXABNHP0` |
345
+ | Optimizer step | 500 |
346
+ | Checkpoint SHA-256 | `4a5b99ff18478742528a0d31c97dcee939b166a51be858721d40ad5984110893` |
347
+ | Checkpoint-bundle SHA-256 | `384b6515f5f26838aea33ec9a941e06610a20764f0b8637c8b7b0667bfc0d447` |
348
+ | Resolved-config SHA-256 | `80cf9395d1f587dc0c1d440d9f5b55c55c20703187998509bb306d19d463f597` |
349
+ | Denoiser parameters | `323,384,964` |
350
+ | Package bytes | `1676086612` |
351
+ | Package files | `31` |
352
+ | Validated Stage B source-package checksums SHA-256 | `d9a28d5fe6f5b675ee1b9db52e6d0493c8d3d357bb824eac590911acbd5c3ebc` |
353
+ | Builder source commit | `9f5ce495fcb88238ec7fdc33204fa42ec9690c37` |
354
+
355
+ `checksums.json` covers every file in the immutable validated release package
356
+ at the recorded builder commit. Later model-card-only revisions are additionally
357
+ preserved by the Hugging Face Git history.