neonforestmist commited on
Commit
c970403
·
verified ·
1 Parent(s): c93742e

Document HQ architecture and held-out quality gate

Browse files
Files changed (1) hide show
  1. README.md +57 -93
README.md CHANGED
@@ -1,7 +1,9 @@
1
  ---
2
  library_name: diffusers
3
  pipeline_tag: image-to-image
4
- base_model: neonforestmist/Clover-Image-Tiny
 
 
5
  license: creativeml-openrail-m
6
  tags:
7
  - clover-image
@@ -10,24 +12,20 @@ tags:
10
  - coreml
11
  ---
12
 
13
- # Clover Image Tiny Inpaint 🍀
14
 
15
- Clover Image Tiny Inpaint is a compact, context-aware inpainting model for the
16
- SD 1.4-class 512×512 architecture. Paint the region to replace in white; black
17
- pixels are preserved. This v2 checkpoint was selected from bounded
18
- teacher-distillation sweeps for semantic prompt following, reconstruction, and
19
- clean mask-edge blending.
20
 
21
- The model uses the standard nine-channel inpainting contract:
22
 
23
  ```text
24
  [noisy latent (4), mask (1), masked-image latent (4)]
25
  ```
26
 
27
- The text encoder, VAE, scheduler, safety checker, and tokenizer remain
28
- compatible with Clover Image Tiny. A VAE encoder is additionally required to
29
- prepare the masked-image latent.
30
-
31
  ## Diffusers example
32
 
33
  ```python
@@ -41,7 +39,7 @@ pipe = AutoPipelineForInpainting.from_pretrained(
41
  ).to("cuda")
42
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
43
 
44
- result = pipe(
45
  prompt="a glossy red enamel kettle resting naturally on the countertop",
46
  negative_prompt="blurry, distorted, low detail",
47
  image=load_image("source.png"),
@@ -50,108 +48,74 @@ result = pipe(
50
  guidance_scale=6.0,
51
  padding_mask_crop=96,
52
  ).images[0]
53
- result.save("clover-inpaint.png")
54
  ```
55
 
56
- Recommended interactive defaults are DPM-Solver++, 20 steps, CFG 6.0, and
57
- `padding_mask_crop=96`. Keep runs at or below 50 steps. For production UI,
58
- composite the generated image through the exact binary mask so that every
59
- unmasked source pixel remains unchanged.
60
-
61
- ## Inpainting examples
62
-
63
- All examples below use the selected v2 checkpoint, CFG 6.0, 30 evaluation
64
- steps, and a 96-pixel context crop. White is the region regenerated by Clover.
65
-
66
- ### Context-aware object insertion
67
-
68
- Prompt: `a tabby cat sitting naturally on the wooden park bench`
69
-
70
- | Source | White mask | Result |
71
- |:---:|:---:|:---:|
72
- | ![Park bench source](examples/cat-source.png) | ![Cat edit mask](examples/cat-mask.png) | ![Cat inpaint result](examples/cat-result.png) |
73
-
74
- Prompt: `a glossy red enamel kettle resting naturally on the countertop`
75
 
76
- | Source | White mask | Result |
77
- |:---:|:---:|:---:|
78
- | ![Kitchen source](examples/kettle-source.png) | ![Kettle edit mask](examples/kettle-mask.png) | ![Kettle inpaint result](examples/kettle-result.png) |
79
 
80
- ### Irregular mask replacement
 
 
81
 
82
- Prompt: `a bright red bicycle standing naturally on the city street`
 
 
 
 
83
 
84
- | Source | White mask | Result |
85
- |:---:|:---:|:---:|
86
- | ![Street source](examples/bicycle-source.png) | ![Bicycle edit mask](examples/bicycle-mask.png) | ![Bicycle inpaint result](examples/bicycle-result.png) |
 
 
87
 
88
- ## Evaluation
89
 
90
- The release gate used a deterministic 12-image held-out reconstruction set and
91
- six context-rich semantic edits with ellipse, rounded-rectangle, polygon, and
92
- brush masks.
 
 
 
 
93
 
94
- | Metric | Previous release | v2 |
95
- |---|---:|---:|
96
- | Held-out masked-region MAE (lower is better) | 0.3120 | **0.2517** |
97
- | Mean object-text CLIP similarity | 0.2726 | **0.2890** |
98
- | Mean CLIP image similarity to the SD inpainting teacher | 0.7651 | **0.8183** |
99
- | Black-collapse outputs | 0/6 | **0/6** |
100
- | Changed pixels outside the mask | 0 | **0** |
101
 
102
- Masked reconstruction MAE improved by 19.3%. Metrics are useful regression
103
- signals, not guarantees of photorealism; the visual contact sheet and per-case
104
- outputs were also reviewed before selection.
105
 
106
- ## Training provenance
107
-
108
- - Warm start: `neonforestmist/Clover-Image-Tiny-Inpaint` at revision
109
- `1b6f8ae3db51900520369d5522c7dc7c2a97e21e`
110
- - Teacher: `stable-diffusion-v1-5/stable-diffusion-inpainting` at revision
111
- `8a4288a76071f7280aedbdb3253bdb9e9d5d84bb`
112
- - Dataset: `prithivMLmods/Caption3o-Opt` at revision
113
- `17e893f785fcd3f5d6fc4a5d65a914b9f7b1ff5b`
114
- - Optimizer steps: 500, with cosine decay after warmup
115
- - Objective: teacher noise prediction plus ground-truth denoising, Min-SNR
116
- weighting, and extra masked-region/boundary weighting
117
- - Masks: brush, multi-brush, rectangle, ellipse, polygon, multi-region, and
118
- outpainting distributions
119
- - Caption dropout: 0.1
120
- - Training platform: Modal A10 in the `guccichungus69` workspace
121
-
122
- The longer run was rejected after its held-out and semantic gates regressed;
123
- the published checkpoint is the best-performing bounded sweep, not simply the
124
- last checkpoint.
125
-
126
- ## Core ML
127
-
128
- The companion SD 1.4-class Core ML resources are published at
129
  [`neonforestmist/Clover-Image-Tiny-Inpaint-CoreML`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
130
- The batch-one U-Net accepts `[1, 9, 64, 64]`; classifier-free guidance is run as
131
- two serial U-Net passes to reduce peak memory.
132
-
133
- ## LoRA compatibility
134
-
135
- Diffusers can load a LoRA trained against this nine-channel inpainting U-Net.
136
- Regular Clover Image Tiny LoRAs target a four-channel U-Net and are not
137
- interchangeable. The Core ML package does not dynamically load inpainting
138
- LoRAs; fuse an inpainting-specific adapter before conversion if needed.
139
 
140
  ## Limitations
141
 
142
- The model can still distort small, highly structured objects, text, hands, and
143
- faces. Very small masks may not provide enough latent resolution without the
144
- recommended context crop. Results depend on the source, mask, prompt, seed,
145
- and scheduler. This release inherits the limitations and license obligations
146
- of its base and teacher models.
147
 
148
  ## Citation
149
 
150
  ```bibtex
151
  @software{lozadaperez2026cloverimagetinyinpaint,
152
  author = {Lukas Lozada Perez},
153
- title = {Clover Image Tiny Inpaint: Compact SD 1.4-Class Image Inpainting},
154
  year = {2026},
155
  url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint}
156
  }
157
  ```
 
 
 
 
1
  ---
2
  library_name: diffusers
3
  pipeline_tag: image-to-image
4
+ base_model:
5
+ - neonforestmist/Clover-Image-Tiny
6
+ - stable-diffusion-v1-5/stable-diffusion-inpainting
7
  license: creativeml-openrail-m
8
  tags:
9
  - clover-image
 
12
  - coreml
13
  ---
14
 
15
+ # Clover Image Tiny Inpaint HQ
16
 
17
+ Clover Image Tiny Inpaint HQ is the high-quality, context-aware inpainting
18
+ pipeline for Clover. It combines the complete Stable Diffusion 1.5 inpainting
19
+ U-Net with Clover Image Tiny's tokenizer, text encoder, VAE, and scheduler.
20
+ This preserves Clover compatibility while replacing the compact inpainting
21
+ denoiser that frequently produced blurry or unrecognizable masked objects.
22
 
23
+ The pipeline uses the standard nine-channel inpainting contract:
24
 
25
  ```text
26
  [noisy latent (4), mask (1), masked-image latent (4)]
27
  ```
28
 
 
 
 
 
29
  ## Diffusers example
30
 
31
  ```python
 
39
  ).to("cuda")
40
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
41
 
42
+ image = pipe(
43
  prompt="a glossy red enamel kettle resting naturally on the countertop",
44
  negative_prompt="blurry, distorted, low detail",
45
  image=load_image("source.png"),
 
48
  guidance_scale=6.0,
49
  padding_mask_crop=96,
50
  ).images[0]
51
+ image.save("clover-inpaint.png")
52
  ```
53
 
54
+ Recommended interactive defaults are DPM-Solver++, 20 steps, CFG 6.0, and a
55
+ 96-pixel context crop. Composite the generated result through the exact binary
56
+ mask when unchanged source pixels must remain byte-for-byte untouched.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ ## Quality gate
 
 
59
 
60
+ The release was evaluated on 24 deterministic, held-out, human-rated
61
+ InpaintCOCO edits. Every output was also reviewed in three visual contact
62
+ sheets before release.
63
 
64
+ | Metric | Previous Clover inpaint | HQ release | SD 1.5 inpaint teacher |
65
+ |---|---:|---:|---:|
66
+ | Masked prompt CLIP similarity (higher) | 0.2642 | **0.2768** | 0.2820 |
67
+ | Masked target MAE (lower) | 0.2510 | **0.2231** | 0.2156 |
68
+ | Changed pixels outside the mask | 0 | **0** | 0 |
69
 
70
+ The HQ release improves prompt alignment by 4.8% and reduces masked target
71
+ error by 11.1% relative to the previous Clover inpainting release. The visual
72
+ gate showed recognizable buses, dogs, trains, furniture, signs, and
73
+ scene-consistent lighting where the compact candidates often collapsed into
74
+ amorphous fills.
75
 
76
+ ## Selection provenance
77
 
78
+ The release process compared the existing checkpoint, a 30,000-step full-U-Net
79
+ distillation run, two fused context-LoRA refinements, partial weight blends,
80
+ the full Stable Diffusion inpainting reference, and this Clover-component
81
+ hybrid. The 30,000-step and context-LoRA candidates were rejected because they
82
+ did not beat the existing release across both visual and quantitative gates.
83
+ The published HQ architecture was the only Clover-compatible candidate that
84
+ materially improved both prompt alignment and reconstruction.
85
 
86
+ - Inpainting U-Net revision:
87
+ `stable-diffusion-v1-5/stable-diffusion-inpainting@8a4288a76071f7280aedbdb3253bdb9e9d5d84bb`
88
+ - Clover components: `neonforestmist/Clover-Image-Tiny`
89
+ - Evaluation dataset: `phiyodr/InpaintCOCO@1ffac84be2dfc5ad9afccad868522fad64457435`
90
+ - Selection platform: Modal H100
91
+ - Evaluation seed: `20260813`
 
92
 
93
+ ## Core ML and style mixing
 
 
94
 
95
+ The companion iOS resources are published at
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  [`neonforestmist/Clover-Image-Tiny-Inpaint-CoreML`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
97
+ Its batch-one stateful U-Net supports up to three Clover styles simultaneously
98
+ with independent strengths. The style tensors remain separate downloads and
99
+ are composed exactly at runtime; they are not fused into three full 1.6 GB
100
+ models.
 
 
 
 
 
101
 
102
  ## Limitations
103
 
104
+ Small text, hands, faces, exact logos, and masks below latent resolution can
105
+ still fail. Output quality depends on the source, mask, prompt, scheduler,
106
+ guidance, seed, and step count. This release inherits the limitations and
107
+ license obligations of Clover Image Tiny and Stable Diffusion 1.5 inpainting.
 
108
 
109
  ## Citation
110
 
111
  ```bibtex
112
  @software{lozadaperez2026cloverimagetinyinpaint,
113
  author = {Lukas Lozada Perez},
114
+ title = {Clover Image Tiny Inpaint HQ: Local Context-Aware Image Inpainting},
115
  year = {2026},
116
  url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint}
117
  }
118
  ```
119
+
120
+ Designed and developed independently by Lukas Lozada Perez. Open weights under
121
+ the CreativeML Open RAIL-M license; complete local inference is supported.