Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clover Image Tiny

Clover Image Tiny original mosaic

SD 1.4-class image generation in a compact model for local apps and offline use.
512 × 512 output · 323.4M-parameter denoiser · LoRA styles · Diffusers and separate Core ML releases.

HF MODEL INPAINTING LIVE DEMO IPHONE / CORE ML
LORA TRAINER GITHUB SOURCE QUALITY CHECKS CODE LICENSE

Models · Examples · Styles · Run it · Evaluation · Documentation


Models

Use the regular model to generate an image from text. Use Inpaint HQ to edit a masked region of an existing image. Both run locally after the model and dependencies are downloaded.

Clover Image Tiny Clover Inpaint HQ
Regular Clover output: a bouquet of blue flowers Published Clover inpainting example: blue sunglasses added to a cat
Text → image. Compact SD 1.4-class generation with a 323.4M-parameter denoiser. Image + mask + text → edit. SD 1.5-class inpainting with Clover's shared components. A larger, separate checkpoint.

The regular Diffusers package is about 1.67 GB, including its text encoder, VAE, and safety checker. The 323.4M count describes the denoiser, not the complete pipeline. Inpainting uses a separate checkpoint; neither download includes the Python environment. The hosted demo runs remotely; local Python and Core ML workflows run on your hardware after setup.

Examples

Selected outputs from the regular model, with their original prompts.

Moonlit greenhouse Blue flowers Stained-glass night
Clover text-to-image output: a tiny greenhouse in a moonlit garden Clover text-to-image output: a bouquet of blue flowers Clover text-to-image output: a stained-glass starry night
“a tiny glass greenhouse glowing in a moonlit garden” “A bouquet of blue flowers” “A stain glass window of a starry night”

Inpainting example

Inpainting regenerates the white area of a mask. Black marks the area to preserve. This published before-and-after example uses the prompt “add blue sunglasses.”

Before After the masked edit
Original cat artwork before the masked sunglasses edit Clover inpainting example: the cat with blue sunglasses added

Inpaint HQ provides SD 1.5-class masked editing. For exact preservation outside the edited region, composite the result through the original binary mask. Its full-size inpainting denoiser and shared components are documented in the inpainting model card.

Styles

Optional LoRA adapters change the model's visual style. Below is the same greenhouse prompt with the base model, Monet, Pointillism, and Watercolor Anime.

Clover Monet Pointillism Watercolor Anime
Base Clover greenhouse example Monet style greenhouse with painterly brushwork Pointillism style greenhouse made from colored dots Watercolor Anime style greenhouse illustration
Base model Get Monet Get Pointillism Get Watercolor Anime

Run Clover locally

Use Python 3.11 or 3.12. On macOS or Linux:

git clone https://github.com/neonforestmist/Clover-Image-Tiny.git
cd Clover-Image-Tiny
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python app.py --device auto

Open http://127.0.0.1:7860 and enter a prompt. The local web app supports regular generation and optional styles. For masked editing, use the hosted demo or native app linked above, or the Inpaint HQ Python example.

The first generation downloads about 1.67 GB of model files. Later runs reuse the Hugging Face cache. Allow extra room for the Python environment and caches. Use --local-files-only after setup to work offline.

Windows setup
git clone https://github.com/neonforestmist/Clover-Image-Tiny.git
cd Clover-Image-Tiny
py -3.11 -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python app.py --device auto
Prefer the command line?
python generate.py \
  --prompt "a tiny glass greenhouse glowing in a moonlit garden" \
  --negative-prompt "blurry, distorted, low detail" \
  --device auto --steps 50 --guidance-scale 7.5 \
  --scheduler pndm --seed 1337 --output clover.png

The runner saves a PNG and a JSON record of settings, seed, and safety results. Existing planned outputs are never overwritten.

Full setup, controls, and offline instructions →

Model facts

Regular Clover model What it means
323.4M denoiser parameters BK-SDM-Tiny architecture; denoiser count only
About 1.67 GB of model files Includes the text encoder, VAE, and packaged safety checker; allow extra space for dependencies and caches
512 × 512 native output Native output resolution
Diffusers + separate Core ML exports Python integration and a path to on-device Apple apps

Evaluation

Compact model, practical generation speed

Clover combines a 323.4M-parameter denoiser with 1.024-second mean generation in the published NVIDIA A10G test. It retains the compact architecture while adding Clover's distillation pass, style adapters, and separate Core ML deployment options.

Measured on NVIDIA A10G Clover Image Tiny
Mean generation time ↓ 1.024 s/image
Peak CUDA memory ↓ 2,233 MB
Denoiser parameters ↓ 323.4M

Test settings: 16 prompts, 512 × 512, 30 DDIM steps, guidance 7.5, after warm-up. Lower values mean less time, memory, or denoiser storage—not automatically better images. These are GPU results, not older-device or iPhone timings.

Clover runs in the same approximate one-second range as BK-SDM-Tiny-2M and Segmind Tiny-SD in this test. Other references lead individual latency, memory, and CLIP metrics; the comparison does not establish an overall quality or speed lead.

Full four-model comparison: latency, memory, and prompt alignment
Model U-Net parameters ↓ Loaded pipeline parameters ↓ Mean latency ↓ Peak CUDA memory ↓ Mean CLIP cosine ↑
Clover Image Tiny 323.4M 834.1M 1.024 s 2,233 MB 0.3195
BK-SDM-Tiny-2M 323.4M 834.1M 1.027 s 2,230 MB 0.3246
Segmind Tiny-SD 323.4M 530.1M 1.028 s 1,649 MB 0.3345
BK-SDM-v2-Tiny 326.8M 750.9M 0.957 s 2,067 MB 0.3303

↓ Lower is better for size, latency, and memory; ↑ higher is better for CLIP prompt alignment. Bold marks the best result in each column, including ties. Parameter counts describe footprint, not image quality.

CLIP cosine measures prompt alignment, not overall visual quality. The latency gaps between Clover, BK-SDM-Tiny-2M, and Segmind Tiny-SD are below 0.4% and should be read as near parity, not an established speed advantage.

Benchmark protocol, all outputs, and raw results.

Usage notes

Can I use Clover offline? Yes. Download the model and dependencies first, then use --local-files-only with the local runner. No hosted generation service is required.

Does it work on a Mac? The Python path supports Apple silicon through PyTorch MPS. NVIDIA systems use CUDA; CPU inference is also supported, but slower.

Is normal Clover the same as Inpaint HQ? They are separate checkpoints. Normal Clover creates images from text. Inpaint HQ takes an image, a mask, and a prompt, and uses a larger denoiser.

What are its limits? Hands, faces, readable text, precise counts, and complex relationships can be unreliable. Examples are selected outputs; results vary with prompts and settings. The packaged safety checker in the Python runner and hosted demo is imperfect.

About this repository

This repository contains the local Gradio app, Diffusers command-line runner, pinned dependencies, and documentation. Model weights download from Hugging Face.

Source code: Apache-2.0. Model and style weights: CreativeML Open RAIL-M; see the model's license ledger. The code license does not replace the terms for downloaded weights.

Full example gallery

Nine original Clover Image Tiny prompt examples

Related projects

The ecosystem directory lists the apps, model downloads, Core ML bundles, style adapters, and training datasets in one place.

Detailed documentation

Complete installation instructions and generation controls

2. Install

Python 3.11 or 3.12 is recommended. Install the PyTorch build suited to your platform, then install the pinned application dependencies.

2.1 macOS or Linux

git clone https://github.com/neonforestmist/Clover-Image-Tiny.git
cd Clover-Image-Tiny

python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

2.2 Windows PowerShell

git clone https://github.com/neonforestmist/Clover-Image-Tiny.git
cd Clover-Image-Tiny

py -3.11 -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Keep room for the 1.67 GB model, the Python environment, and the Hugging Face cache. CUDA uses an NVIDIA GPU, MPS uses Apple Silicon, and CPU works more slowly in float32.

3. Local web app

python app.py --device auto

Open http://127.0.0.1:7860. The app exposes:

  • prompt and negative prompt;
  • Clover, Monet, Pointillism, and Watercolor Anime styles;
  • 4–100 inference steps and guidance from 0–20;
  • seed, width, height, and five schedulers;
  • CUDA, Apple MPS, or CPU selection;
  • generation metadata and packaged safety-checker results.

The model loads only when the first image is requested. A selected style LoRA also downloads only when it is first used. To require previously cached files and prevent network access, launch with --local-files-only.

4. Command-line example

python generate.py \
  --prompt "a tiny glass greenhouse glowing in a moonlit garden" \
  --negative-prompt "blurry, distorted, low detail" \
  --device auto \
  --steps 50 \
  --guidance-scale 7.5 \
  --scheduler pndm \
  --seed 1337 \
  --output clover-image-tiny.png

The runner defaults to neonforestmist/Clover-Image-Tiny; pass --model only to use another Hub ID or a downloaded local folder. Every run writes a PNG and a JSON sidecar containing resolved settings, seeds, checksums, runtime details, and the safety result. Existing planned outputs are never overwritten.

4.1 Offline after the first download

python generate.py \
  --local-files-only \
  --prompt "a quiet library with arched windows" \
  --output library.png

5. Generation controls

Flag Range or choices Default
--steps 4–100 50
--guidance-scale 0–20 7.5
--scheduler pndm, ddim, euler, euler-a, dpmpp-2m pndm
--width, --height 256–768, multiples of 64 512
--num-images 1–4 1
--seed 0–2⁶³−1 1337
--device auto, cuda, mps, cpu auto

The validated reference recipe is 50-step PNDM, guidance 7.5, 512×512, and one image. More steps take longer and do not guarantee a better result.

Repository contents and safety information

Repository contents

Clover-Image-Tiny/
├── app.py                    # local Gradio interface
├── generate.py               # reproducible Diffusers command-line runner
├── requirements.txt          # pinned Python dependencies
├── docs/ECOSYSTEM.md         # every model, app, style, and dataset link
├── assets/                   # documentation images only
└── .github/workflows/        # lightweight source checks

Model checkpoints, LoRAs, compiled Core ML packages, generated outputs, and local caches are excluded by .gitignore.

Safety and limitations

The packaged Stable Diffusion safety checker remains enabled in both runnable examples. It can miss harmful material or over-filter benign content, so applications still need controls appropriate to their audience.

Hands, anatomy, exact counts and relationships, and readable text can be difficult. Results vary by prompt, seed, scheduler, device, and precision. Do not use outputs for consequential decisions or identity claims.

Citation

If you use Clover Image Tiny in your work, please cite the model release:

@software{lozadaperez2026cloverimagetiny,
  author = {Lukas Lozada Perez},
  title = {Clover Image Tiny: Compact Local Text-to-Image Diffusion},
  year = {2026},
  url = {https://huggingface.co/neonforestmist/Clover-Image-Tiny}
}

Created by Lukas Lozada Perez.

About

Compact local AI image generation with Clover Image Tiny, Inpaint HQ image editing, LoRA styles, Diffusers, and Core ML for Apple devices.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages