A Tkinter-based Lenia sandbox for building multi-channel cellular automata, tracking organisms, and recording results.
1-channel cells (full board)![]() |
3-channel cells (full board)![]() |
3-channel split views![]() |
|
- Python 3.10+ with Tkinter available
- Packages:
torch,numpy,pillow,matplotlib,scikit-image,imageio,pandas - GPU is optional; PyTorch will use CUDA if available
Install (example):
python -m venv .venv
.venv\Scripts\activate
pip install torch numpy pillow matplotlib scikit-image imageio pandas
# For the best PyTorch wheel, see https://pytorch.org/get-started/locally/
python app.py
presets/- bundled presets shipped with the appsaved_settings/- your saved simulation settings (*.json)saved_settings/organisms/- saved organisms/presets you capture from the board (*.json)gifs/- recordings written by the recorder (GIFs, stats, and snapshots)
The preset list shows everything together with prefixes:
[Preset]built-in items frompresets/[Saved Organism]your captured organisms fromsaved_settings/organisms/[Saved Settings]full simulation configs fromsaved_settings/
- Spacebar toggles pause/play.
- Left-drag draws mass on the selected channel; right-drag erases; Shift+Click selects an organism (when tracking is enabled).
- Add and configure channels in the "Channels & Kernels" tab; adjust interactions via the matrix.
- Use the visualization dropdowns to switch between final board, potential, growth, and flow fields; toggle split-screen or zoom view as needed.
- Save Settings stores the entire simulation configuration to
saved_settings/<name>.json. - Load Settings restores a saved configuration from that folder.
- Save Selected (in the presets panel) saves the currently selected organism to
saved_settings/organisms/<name>.json. - The list allows loading any entry; built-in presets are read-only, while saved organisms/settings can be renamed or deleted.
- Record Full GIF captures the rendered board to a GIF under
gifs/. - Record Organism Stats logs per-frame metrics and writes cropped GIFs for multiple view modes into a timestamped folder under
gifs/. - Recording resolution is set via
RECORDING_RESOLUTIONinconfig.py(set toNoneto keep native size).
- Some scripting and refactors were produced with help from Google's Gemini 2.5 Pro.
- The first run creates needed folders automatically.
- If PyTorch cannot find CUDA, it falls back to CPU automatically.


