Instructions to use Padakovec/nano-catana-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Padakovec/nano-catana-v2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Padakovec/nano-catana-v2", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
nano catana v2
An unconditional diffusion model that generates photographs of cats at 512 × 512 px. It takes no prompt: you ask for a cat and it decides which one.
nano catana v2 is trained by the Nano Catana Research Lab, which trains generative models on photographs of cats and studies what they produce. The lab was founded on the observation that the number of cats in the world is finite. Our long-term goal is to do something about that. You can try this model, and the lab's text-to-cat model, without installing anything at research.kocicividea.cz.
Training progress
Each frame samples the same nine seeds from a different checkpoint, from epoch 20 to epoch 460. The released weights are from epoch 480.
Quick start
The repo includes generate.py, a single-file uv
script. uv installs the dependencies; the script downloads the weights (about 760 MB) and makes
a cat.
curl -LO https://huggingface.co/Padakovec/nano-catana-v2/resolve/main/generate.py
uv run generate.py # one cat -> cat.png
uv run generate.py --grid 5 # 5x5 grid of 25 cats -> cat-grid-5x5.png
uv run generate.py --seed 2033 --steps 100 --out persian.png
On an AMD GPU (Linux), use generate-amd.py instead. It is the same script,
but uv installs the ROCm build of PyTorch:
curl -LO https://huggingface.co/Padakovec/nano-catana-v2/resolve/main/generate-amd.py
uv run generate-amd.py --grid 5
ROCm officially supports Instinct cards and recent high-end Radeons (RX 7900 and RX 9000 series).
Other Radeons often work if you tell ROCm which supported architecture to treat them as, e.g.
HSA_OVERRIDE_GFX_VERSION=10.3.0 for an RX 6000 or 11.0.0 for a smaller RX 7000. If the script says it
found no AMD GPU, it falls back to the CPU.
The script checks the machine it runs on and picks the settings to match:
| Machine | Device | Precision | Batch size |
|---|---|---|---|
| NVIDIA GPU | CUDA | float16 | from free VRAM, about 1 GB per cat; halves itself on out-of-memory |
AMD GPU (generate-amd.py, Linux) |
ROCm | float16 | same as NVIDIA |
| Apple Silicon | MPS | float16 | from unified memory |
| Anything else | CPU, one thread per physical core | float32 | from RAM, up to 4 |
Options: --grid N (N = 1–5), --seed, --steps (default 50; 100 is a little sharper), --out,
--device, --batch-size. The starting noise is drawn on the CPU, so a seed gives the same cat
on any hardware, and tile k of a grid is the cat for seed + k. The persian above, for example,
is tile 7 of --grid 5 --seed 2026:
Approximate speed at 50 steps: 10 cat-steps per second on an RTX 3070, so one cat takes about
5 s and a 5×5 grid about 2 minutes. A 12-core desktop CPU takes about 5 minutes per cat. On
Windows, uv installs the CPU-only PyTorch build from PyPI; for an NVIDIA GPU, install a CUDA
build of PyTorch instead. generate-amd.py is Linux-only, because PyTorch publishes ROCm wheels
only for Linux.
Using it with Diffusers directly
The weights are a standard Diffusers UNet2DModel with a DDPMScheduler config. Sample with
DDIM:
import torch
from diffusers import DDIMScheduler, DDPMPipeline
pipe = DDPMPipeline.from_pretrained("Padakovec/nano-catana-v2", torch_dtype=torch.float16).to("cuda")
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
images = pipe(batch_size=4, num_inference_steps=50, generator=torch.manual_seed(0)).images
for i, image in enumerate(images):
image.save(f"cat-{i}.png")
Model details
| Architecture | U-Net (Diffusers UNet2DModel), 190.5 M parameters, self-attention with 64-dim heads at 32 and 16 px |
| Output | One cat, 512 × 512 px RGB |
| Objective | v-prediction with min-SNR weighting (γ = 5) |
| Noise schedule | Cosine, log-SNR shifted by 2·log(64/512) for 512 px, stored as trained_betas |
| Sampler | DDIM, η = 0, trailing timesteps; 50–100 steps |
| Weights | EMA (decay 0.9999) |
| Training | 480 epochs, 693,587 steps, AdamW at lr 1e-4 with one warm restart |
| Data | About 47,000 curated cat photographs, random square crops and horizontal flips |
| Compute | Roughly 300 GPU-hours on the Czech academic grid (MetaCentrum / e-INFRA CZ): A100, H100, L40S, A40 and RTX PRO 6000 |
This is the lab's second unconditional model. The first one drew plausible fur on implausible anatomy, which we traced to an unshifted noise schedule at 512 px and an uncurated training set. v2 fixes both.
Data
The photographs come from the Cat Picture Collection compiled by Smelly of vx-underground. A vision-language model described every image and flagged problems such as blur, watermarks or a second cat in frame; watermarked images and non-cats were left out of training. The whole corpus, including rejected images and why they were rejected, is public in the dataset browser.
All images are ethically sourced: no cat was posed or woken up for a photograph.
Limitations
- No prompt and no control over the cat beyond the seed.
- Anatomy is much better than in v1 but not solved: expect the occasional extra paw, a melted face in an extreme close-up, or blankets that turn into cat.
- Like its training photos, the model favours indoor phone snapshots of domestic cats.
License
The training images were collected by third parties and their copyright status is mixed, so the
weights are released under license: other for research and personal use. Generated cats do not
exist and cannot be adopted.
- Downloads last month
- 6


