neonforestmist commited on
Commit
be06992
·
verified ·
1 Parent(s): 3e22009

Make model card visual, clear, and easier to explore

Browse files
README.md CHANGED
@@ -6,28 +6,65 @@ base_model:
6
  - stable-diffusion-v1-5/stable-diffusion-inpainting
7
  license: creativeml-openrail-m
8
  tags:
 
 
 
9
  - clover-image
10
  - inpainting
11
  - stable-diffusion
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
- companion to [Clover Image Tiny](https://huggingface.co/neonforestmist/Clover-Image-Tiny).
19
- It combines the complete Stable Diffusion 1.5 inpainting U-Net with Clover
20
- Image Tiny's tokenizer, text encoder, VAE, and scheduler.
21
- This preserves Clover compatibility while replacing the compact inpainting
22
- denoiser that frequently produced blurry or unrecognizable masked objects.
23
 
24
- The pipeline uses the standard nine-channel inpainting contract:
25
 
26
- ```text
27
- [noisy latent (4), mask (1), masked-image latent (4)]
28
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
- ## Diffusers example
 
 
 
 
 
 
 
 
31
 
32
  ```python
33
  import torch
@@ -52,91 +89,37 @@ image = pipe(
52
  image.save("clover-inpaint.png")
53
  ```
54
 
55
- Recommended interactive defaults are DPM-Solver++, 20 steps, CFG 6.0, and a
56
- 96-pixel context crop. Composite the generated result through the exact binary
57
- mask when unchanged source pixels must remain byte-for-byte untouched.
 
 
58
 
59
- ## Inpainting example
 
60
 
61
- This edit starts from the Clover Image Tiny artwork below and uses the prompt
62
- `add blue sunglasses`. The source and result are included so the masked edit
63
- can be compared directly.
64
 
65
- | Source image | Inpainted result |
66
- |:---:|:---:|
67
- | ![Cat source before adding sunglasses](examples/sunglasses-source.png) | ![Cat after adding blue sunglasses](examples/sunglasses-result.png) |
68
-
69
- ## Quality gate
70
-
71
- The release was evaluated on 24 deterministic, held-out, human-rated
72
- InpaintCOCO edits. Every output was also reviewed in three visual contact
73
- sheets before release.
74
-
75
- | Metric | Previous Clover inpaint | HQ release | SD 1.5 inpaint teacher |
76
- |---|---:|---:|---:|
77
- | Masked prompt CLIP similarity (higher) | 0.2642 | **0.2768** | 0.2820 |
78
- | Masked target MAE (lower) | 0.2510 | **0.2231** | 0.2156 |
79
- | Changed pixels outside the mask | 0 | **0** | 0 |
80
-
81
- The HQ release improves prompt alignment by 4.8% and reduces masked target
82
- error by 11.1% relative to the previous Clover inpainting release. The visual
83
- gate showed recognizable buses, dogs, trains, furniture, signs, and
84
- scene-consistent lighting where the compact candidates often collapsed into
85
- amorphous fills.
86
-
87
- ## Selection provenance
88
-
89
- The release process compared the existing checkpoint, a 30,000-step full-U-Net
90
- distillation run, two fused context-LoRA refinements, partial weight blends,
91
- the full Stable Diffusion inpainting reference, and this Clover-component
92
- hybrid. The 30,000-step and context-LoRA candidates were rejected because they
93
- did not beat the existing release across both visual and quantitative gates.
94
- The published HQ architecture was the only Clover-compatible candidate that
95
- materially improved both prompt alignment and reconstruction.
96
-
97
- - Inpainting U-Net revision:
98
- `stable-diffusion-v1-5/stable-diffusion-inpainting@8a4288a76071f7280aedbdb3253bdb9e9d5d84bb`
99
- - Clover components: `neonforestmist/Clover-Image-Tiny`
100
- - Evaluation dataset: `phiyodr/InpaintCOCO@1ffac84be2dfc5ad9afccad868522fad64457435`
101
- - Selection platform: Modal H100
102
- - Evaluation seed: `20260813`
103
-
104
- ## Core ML and style mixing
105
-
106
- The companion iOS resources are published at
107
- [`neonforestmist/Clover-Image-Tiny-Inpaint-CoreML`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
108
-
109
- In Diffusers, the published Clover style LoRAs are mechanically compatible
110
- with this nine-channel U-Net because they modify attention projections only;
111
- those tensor shapes are unchanged from the four-channel model. They were
112
- trained for text-to-image, however, so masked-edit quality should be evaluated
113
- per style. LoRAs that modify the four-channel input convolution are not
114
- compatible.
115
-
116
- Dynamic Core ML loading is a separate deployment capability. The shipping iOS
117
- inpainting screen currently selects a stateless or chunked U-Net and does not
118
- enable styles. An adapter-aware stateful nine-channel export can provide up to
119
- three independently weighted slots, but it must include the matching adapter
120
- schema and be validated on its target devices. For a stateless deployment,
121
- fuse a compatible LoRA before conversion.
122
-
123
- ## Limitations
124
-
125
- Small text, hands, faces, exact logos, and masks below latent resolution can
126
- still fail. Output quality depends on the source, mask, prompt, scheduler,
127
- guidance, seed, and step count. This release inherits the limitations and
128
- license obligations of Clover Image Tiny and Stable Diffusion 1.5 inpainting.
129
-
130
- ## Citation
131
-
132
- ```bibtex
133
- @software{lozadaperez2026cloverimagetinyinpaint,
134
- author = {Lukas Lozada Perez},
135
- title = {Clover Image Tiny Inpaint HQ: Local Context-Aware Image Inpainting},
136
- year = {2026},
137
- url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint}
138
- }
139
- ```
140
 
141
- Designed and developed independently by Lukas Lozada Perez. Open weights under
142
- the CreativeML Open RAIL-M license; complete local inference is supported.
 
6
  - stable-diffusion-v1-5/stable-diffusion-inpainting
7
  license: creativeml-openrail-m
8
  tags:
9
+ - image-editing
10
+ - local-ai
11
+ - diffusers
12
  - clover-image
13
  - inpainting
14
  - stable-diffusion
15
  - coreml
16
  ---
17
 
 
18
 
19
+ # 🍀 Clover Image Tiny Inpaint HQ
 
 
 
 
 
20
 
21
+ ### Keep the scene. Change the detail.
22
 
23
+ **Paint a mask, describe your edit, and give an existing image a new direction.**
24
+ Clover Inpaint HQ is an open-weight AI inpainting model for local image editing with
25
+ Python and Diffusers, with companion Core ML resources for Apple apps.
26
+
27
+ <p align="center">
28
+ <a href="https://huggingface.co/spaces/neonforestmist/Clover-Image-Tiny-Demo"><img alt="Try inpainting" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/main/assets/links/try-inpainting.svg" height="40"></a>
29
+ <a href="https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/tree/main"><img alt="Get the model" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/main/assets/links/get-model.svg" height="40"></a>
30
+ <a href="https://github.com/neonforestmist/Clover-Image-Tiny"><img alt="GitHub source" src="https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/main/assets/links/github-source.svg" height="40"></a>
31
+ </p>
32
+
33
+ ## Inpainting example
34
+
35
+ Want to change just one part of an image? Select that area with a mask and describe what
36
+ belongs there. This published Clover example uses the prompt **“add blue sunglasses.”**
37
+
38
+ | Original image | Masked edit |
39
+ |:---:|:---:|
40
+ | ![Cat artwork before the sunglasses edit](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/3e22009fb6e61944f28b0389f775fc47e2c48724/examples/sunglasses-source.png) | ![Clover inpainting result showing blue sunglasses on the cat](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/resolve/3e22009fb6e61944f28b0389f775fc47e2c48724/examples/sunglasses-result.png) |
41
+
42
+ ## What you can do
43
+
44
+ - **Explore a focused change.** Add or replace a detail while keeping the surrounding scene as context.
45
+ - **Control where the edit happens.** A white mask selects the area to regenerate; black selects the area to preserve.
46
+ - **Work locally.** After downloading the model and dependencies, your Python workflow can run offline.
47
+ - **Build an image editor.** Use the standard Diffusers pipeline or the [Core ML companion](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
48
+
49
+ For pixel-exact preservation, composite the generated result through the original binary
50
+ mask. The mask and compositing step—not the prompt alone—protect the unedited image.
51
+
52
+ ## A quality-focused companion to Clover
53
+
54
+ Inpaint HQ uses the **full Stable Diffusion 1.5 inpainting denoiser** with Clover's
55
+ text encoder, tokenizer, VAE, and scheduler. It is a larger model than the compact
56
+ [regular Clover text-to-image checkpoint](https://huggingface.co/neonforestmist/Clover-Image-Tiny). Choose regular Clover to create
57
+ from text, and Inpaint HQ when you already have an image to edit.
58
 
59
+ On the release's 24-edit held-out evaluation, HQ improved masked prompt alignment by
60
+ **4.8%** and reduced masked target error by **11.1%** versus the previous Clover inpainting
61
+ release. These are evaluation-set results; individual edits still depend on the image,
62
+ mask, and prompt. [See the full quality gate and selection record](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/blob/main/docs/MODEL_DETAILS.md).
63
+
64
+ ## Run an edit with Python
65
+
66
+ Install the [project's pinned Python dependencies](https://github.com/neonforestmist/Clover-Image-Tiny#run-clover-locally).
67
+ This example uses an NVIDIA CUDA GPU:
68
 
69
  ```python
70
  import torch
 
89
  image.save("clover-inpaint.png")
90
  ```
91
 
92
+ Start with **20 steps**, **guidance 6.0**, and **96 pixels of surrounding context**.
93
+ Use a source image and same-size grayscale mask. Small selections benefit from a
94
+ context crop so the model can see both the edited region and its surroundings.
95
+ To use an already downloaded model offline, pass `local_files_only=True` to
96
+ `from_pretrained`.
97
 
98
+ <details>
99
+ <summary>Apple silicon and CPU</summary>
100
 
101
+ For Apple silicon, change `.to("cuda")` to `.to("mps")`. For CPU, use
102
+ `torch_dtype=torch.float32` and `.to("cpu")`; generation is slower. Hardware,
103
+ precision, and dependencies can change the result even with the same seed.
104
 
105
+ </details>
106
+
107
+ ## Styles and Apple devices
108
+
109
+ The [Clover iOS app](https://github.com/neonforestmist/Clover-Image-Tiny-iOS) provides a native masking workflow.
110
+ Core ML resources are published [separately](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
111
+
112
+ Published Clover attention-only LoRAs are mechanically compatible in Diffusers,
113
+ but they were trained for text-to-image, so evaluate each style's editing quality.
114
+ The shipping iOS inpainting screen does not enable dynamic styles.
115
+ [Read the adapter and deployment details](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/blob/main/docs/MODEL_DETAILS.md#core-ml-and-style-mixing).
116
+
117
+ ## Limits and license
118
+
119
+ Small text, hands, faces, exact logos, and very small masks can be difficult.
120
+ Review generated edits before sharing. The model inherits the limitations and
121
+ **CreativeML Open RAIL-M** obligations of Clover and Stable Diffusion 1.5 inpainting.
122
+
123
+ [**Technical reference, evaluation, provenance, and citation →**](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint/blob/main/docs/MODEL_DETAILS.md)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
+ 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,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Clover Inpaint HQ — technical reference
2
+
3
+ [Back to the model card](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint).
4
+
5
+ ## Quality gate
6
+
7
+ The release was evaluated on 24 deterministic, held-out, human-rated
8
+ InpaintCOCO edits. Every output was also reviewed in three visual contact
9
+ sheets before release.
10
+
11
+ | Metric | Previous Clover inpaint | HQ release | SD 1.5 inpaint teacher |
12
+ |---|---:|---:|---:|
13
+ | Masked prompt CLIP similarity (higher) | 0.2642 | **0.2768** | 0.2820 |
14
+ | Masked target MAE (lower) | 0.2510 | **0.2231** | 0.2156 |
15
+ | Changed pixels outside the mask | 0 | **0** | 0 |
16
+
17
+ The HQ release improves prompt alignment by 4.8% and reduces masked target
18
+ error by 11.1% relative to the previous Clover inpainting release. The visual
19
+ gate showed recognizable buses, dogs, trains, furniture, signs, and
20
+ scene-consistent lighting where the compact candidates often collapsed into
21
+ amorphous fills.
22
+
23
+ ## Selection provenance
24
+
25
+ The release process compared the existing checkpoint, a 30,000-step full-U-Net
26
+ distillation run, two fused context-LoRA refinements, partial weight blends,
27
+ the full Stable Diffusion inpainting reference, and this Clover-component
28
+ hybrid. The 30,000-step and context-LoRA candidates were rejected because they
29
+ did not beat the existing release across both visual and quantitative gates.
30
+ The published HQ architecture was the only Clover-compatible candidate that
31
+ materially improved both prompt alignment and reconstruction.
32
+
33
+ - Inpainting U-Net revision:
34
+ `stable-diffusion-v1-5/stable-diffusion-inpainting@8a4288a76071f7280aedbdb3253bdb9e9d5d84bb`
35
+ - Clover components: `neonforestmist/Clover-Image-Tiny`
36
+ - Evaluation dataset: `phiyodr/InpaintCOCO@1ffac84be2dfc5ad9afccad868522fad64457435`
37
+ - Selection platform: Modal H100
38
+ - Evaluation seed: `20260813`
39
+
40
+ ## Core ML and style mixing
41
+
42
+ The companion iOS resources are published at
43
+ [`neonforestmist/Clover-Image-Tiny-Inpaint-CoreML`](https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint-CoreML).
44
+
45
+ In Diffusers, the published Clover style LoRAs are mechanically compatible
46
+ with this nine-channel U-Net because they modify attention projections only;
47
+ those tensor shapes are unchanged from the four-channel model. They were
48
+ trained for text-to-image, however, so masked-edit quality should be evaluated
49
+ per style. LoRAs that modify the four-channel input convolution are not
50
+ compatible.
51
+
52
+ Dynamic Core ML loading is a separate deployment capability. The shipping iOS
53
+ inpainting screen currently selects a stateless or chunked U-Net and does not
54
+ enable styles. An adapter-aware stateful nine-channel export can provide up to
55
+ three independently weighted slots, but it must include the matching adapter
56
+ schema and be validated on its target devices. For a stateless deployment,
57
+ fuse a compatible LoRA before conversion.
58
+
59
+ ## Limitations
60
+
61
+ Small text, hands, faces, exact logos, and masks below latent resolution can
62
+ still fail. Output quality depends on the source, mask, prompt, scheduler,
63
+ guidance, seed, and step count. This release inherits the limitations and
64
+ license obligations of Clover Image Tiny and Stable Diffusion 1.5 inpainting.
65
+
66
+ ## Citation
67
+
68
+ ```bibtex
69
+ @software{lozadaperez2026cloverimagetinyinpaint,
70
+ author = {Lukas Lozada Perez},
71
+ title = {Clover Image Tiny Inpaint HQ: Local Context-Aware Image Inpainting},
72
+ year = {2026},
73
+ url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint}
74
+ }
75
+ ```
76
+
77
+ Designed and developed independently by Lukas Lozada Perez. Open weights under
78
+ the CreativeML Open RAIL-M license; complete local inference is supported.