Installation
MaxDiffusion can be installed on Cloud TPUs, GPUs, or local machines. We recommend starting with a single TPU host for development before scaling to multi-host configurations.System requirements
- Operating System: Ubuntu 22.04 or later
- Python: 3.12 or later
- TensorFlow: 2.12.0 or later
- Hardware: Cloud TPU v4/v5p/v6e or NVIDIA GPU with CUDA support
Quick install
- Cloud TPU
- GPU
- Local (CPU)
Create a TPU VM
Create and SSH into a single-host TPU VM:
For TPU v6e (Trillium), use the
v2-alpha-tpuv6e VM image which includes Ubuntu 22.04, Python 3.12, and TensorFlow 2.12+.Run setup script
Install MaxDiffusion and dependencies:
If using Python 3.12+ for the first time, you may need to run the setup script three times to complete the installation.
TPU VM images
For different TPU generations, use the appropriate VM image:| TPU Type | Recommended VM Image | Zones |
|---|---|---|
| v6e-8 (Trillium) | v2-alpha-tpuv6e | us-central2-b, us-south1-a |
| v5p-8 | v2-alpha-tpuv5-lite | us-east5-a, us-west4-a |
| v4-8 | tpu-ubuntu2204-base | us-central2-b, europe-west4-a |
See the Cloud TPU regions and zones documentation for the full list of available zones.
Development installation
For contributing to MaxDiffusion or modifying the source code:Optional dependencies
For training
For video models
For testing
Troubleshooting
ImportError: cannot import JAX
ImportError: cannot import JAX
Make sure JAX is installed for your target device:
Python version mismatch
Python version mismatch
MaxDiffusion requires Python 3.12+. Check your version:If using an older version, create a new virtual environment with Python 3.12.
Out of disk space during installation
Out of disk space during installation
MaxDiffusion models can be large. Consider attaching an external disk:
Setup script fails on first run
Setup script fails on first run
For Python 3.12+ virtual environments, you may need to run the setup script multiple times:
Next steps
Quickstart
Generate your first image
Single host deployment
Set up local development
Multi-host deployment
Scale to TPU Pods
Training guide
Start training models