Image-to-Image
Diffusers
Safetensors
Core ML
StableDiffusionInpaintPipeline
image-editing
local-ai
clover-image
inpainting
stable-diffusion
Run this model with HF Jobs
Run neonforestmist/Clover-Image-Tiny-Inpaint on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/neonforestmist/Clover-Image-Tiny-Inpaint on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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 AutoPipelineForInpainting from diffusers.utils import load_image # switch to "mps" for apple devices pipe = AutoPipelineForInpainting.from_pretrained("neonforestmist/Clover-Image-Tiny-Inpaint", dtype=torch.float16, device_map="cuda") img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png" mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png" image = load_image(img_url).resize((1024, 1024)) mask_image = load_image(mask_url).resize((1024, 1024)) prompt = "a tiger sitting on a park bench" generator = torch.Generator(device="cuda").manual_seed(0) image = pipe( prompt=prompt, image=image, mask_image=mask_image, guidance_scale=8.0, num_inference_steps=20, # steps between 15 and 30 work well for us strength=0.99, # make sure to use `strength` below 1.0 generator=generator, ).images[0] - Notebooks
- Google Colab
- Kaggle
Clarify inpainting model card
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768---library_name: diffuserspipeline_tag: image-to-imagebase_model: neonforestmist/Clover-Image-Tinylicense: creativeml-openrail-mtags: - clover-image - inpainting - stable-diffusion - coreml - iphone---
# Clover Image Tiny Inpaint 🍀
An inpainting adaptation of Clover Image Tiny for 512×512 local generation andon-device Core ML deployment. White mask pixels are regenerated; black pixelsare preserved.
The model uses a 9-channel U-Net input:
```text[noisy latent (4), mask (1), masked-image latent (4)]```
The base text encoder, VAE, scheduler, safety checker, and tokenizer remaincompatible with Clover Image Tiny. The inpainting export additionally includesthe VAE encoder needed to prepare the masked-image latent on iPhone.
## Diffusers
```pythonfrom diffusers import AutoPipelineForInpaintingfrom diffusers.utils import load_image
pipe = AutoPipelineForInpainting.from_pretrained( "neonforestmist/Clover-Image-Tiny-Inpaint", torch_dtype="auto",)image = pipe( prompt="a tiny glass greenhouse glowing in a moonlit garden", image=load_image("input.png"), mask_image=load_image("mask.png"), num_inference_steps=30,).images[0]image.save("clover-inpaint.png")```
## Core ML and iPhone 15
The companion Core ML resource bundle is converted for iOS 18 with abatch-one U-Net and chunked U-Net resources. The Swift runtime performsclassifier-free guidance as two serial passes to reduce peak memory. Thebundled `VAEEncoder.mlmodelc` creates the masked-image latent locally, so theinput image and mask do not leave the device.
Conversion and the native iOS integration live in the source Clover repo:
- [`coreml-tools/convert_inpaint.sh`](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/coreml-tools/convert_inpaint.sh)- [`Clover-iOS`](https://huggingface.co/neonforestmist/Clover-Image-Tiny/tree/main/Clover-iOS)- [`training/README-INPAINTING.md`](https://huggingface.co/neonforestmist/Clover-Image-Tiny/blob/main/training/README-INPAINTING.md)
## Training provenance
Training uses synthetic rectangle, ellipse, and brush masks over the pinnedApache-2.0 `prithivMLmods/Caption3o-Opt` image-caption dataset. The full job islaunched by Modal under the `guccichungus69` workspace and stores its output inthe `clover-image-tiny-inpaint-output` Volume before Core ML conversion.README.mdAdded+68