Image-to-Image
Diffusers
Safetensors
Core ML
StableDiffusionInpaintPipeline
clover-image
inpainting
stable-diffusion
Instructions to use neonforestmist/Clover-Image-Tiny-Inpaint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use neonforestmist/Clover-Image-Tiny-Inpaint with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("neonforestmist/Clover-Image-Tiny-Inpaint", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Document HQ architecture and held-out quality gate
Browse files
README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
---
|
| 2 |
library_name: diffusers
|
| 3 |
pipeline_tag: image-to-image
|
| 4 |
-
base_model:
|
|
|
|
|
|
|
| 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
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
-
The
|
| 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 |
-
|
| 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 |
-
|
| 54 |
```
|
| 55 |
|
| 56 |
-
Recommended interactive defaults are DPM-Solver++, 20 steps, CFG 6.0, and
|
| 57 |
-
|
| 58 |
-
|
| 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 |
-
|  |  |  |
|
| 73 |
-
|
| 74 |
-
Prompt: `a glossy red enamel kettle resting naturally on the countertop`
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|:---:|:---:|:---:|
|
| 78 |
-
|  |  |  |
|
| 79 |
|
| 80 |
-
|
|
|
|
|
|
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
##
|
| 89 |
|
| 90 |
-
The release
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
| Changed pixels outside the mask | 0 | **0** |
|
| 101 |
|
| 102 |
-
|
| 103 |
-
signals, not guarantees of photorealism; the visual contact sheet and per-case
|
| 104 |
-
outputs were also reviewed before selection.
|
| 105 |
|
| 106 |
-
|
| 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 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 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 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 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:
|
| 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.
|