gantrain trains a FastGAN on your own photographs, on one GPU, up to 3072×2048, and checks that it makes new images rather than copies. It trained the models that ganlive plays in its live demo.
git clone https://github.com/gustavecortal/gantrain.git
cd gantrain
uv venv --python 3.12Install PyTorch and torchvision for your hardware with uv pip install, then install gantrain:
uv pip install -e .uv run --no-sync gantrain curate path/to/photos --out data/curated
This drops near-identical shots and holds out 15% for evaluation. A few hundred photographs are enough to start.
uv run --no-sync gantrain train --data data/curated --out runs/mine --resolution 512 --width 768
Samples appear in runs/mine/samples as training goes. Resume a run with --resume runs/mine/checkpoints/<step>.pt.
Convert a checkpoint with ganlive to play it in the browser, by hand or from drums.
FastGAN is a GAN designed for small image sets. Its discriminator also learns to reconstruct the real images it judges, and DiffAugment keeps it from memorising them. gantrain evaluate scores generated images against the held-out photographs and looks for copies. gantrain --help lists the other commands.
The published models were trained on one $350 Intel Arc A770. amber's settings are a good start for your own run:
uv run --no-sync gantrain train --data data/curated --out runs/amber --resolution 1024 --width 1536 --batch-size 16 --iterations 80000 --lr 3e-4 --lr-warmup 2000 --jacobian-weight 1.5 --compile
MIT.