A local-first virtual world sandbox composing AI capabilities
This is a work in progress. Contributions welcome!
tomb-2-cmp.mp4
So far, this has been tested on Apple Silicon (M2 Max) but should work just as well (better even) with CUDA. At present, it requires around 20 GB VRAM at peak.
git submodule update --init
python3 -m virtualenv venv
venv/bin/pip install torch==2.1.2 setuptools==69.5.1
venv/bin/pip install -r requirements.txt
Download the models (~5GB?)
venv/bin/python scripts/preload.py
venv/bin/python -m latentclay.server
On a Mac:
PYTORCH_ENABLE_MPS_FALLBACK=1 venv/bin/python -m latentclay.server
To set a preferred GPU device (by default it will guess CUDA or Metal as available):
venv/bin/python -m latentclay.server --device ...
See the video at the top and follow along with these guides.
- Open the web app in your browser (http://localhost:8000 by default)
- Pick a spot on the floor grid and click to start defining a polygonal selection
- Click a few more points to define a simple polygon (don't cross lines)
- Step inside the shape
- Type / to open the console. Enter "room " and then whatever style of room you'd like (e.g., "/room drawing room")
- Hit Enter
- Let the room generate; rooms (currently) take a minute or so
- In the meantime, hit C to clear your selection
- Once the room generates, click a point on the floor
- Type / to open the console again; now it should prefill with "/create"
- Describe your object, e.g. "lamp", and hit Enter
- Type C to clear your selection
- Wait for the object to generate
- From the inside of a room, spot an area of wall that will be a bit wider than it is high to place a door
- Click on the wall to start a wall-aligned selection and set the left edge of this region
- Click to set the right edge of this region
- Type / to open the console. Enter "door " and then whatever style of doorway you'd like, for instance, "/door doorway". Currently only open doorways/arches are supported (i.e., no hinged/sliding doors yet)
- Type C to clear selection
- Wait for the door to generate. This is the quickest of all generations.
- If all went well, you should be able to see through the doorway to the exterior and walk through it.
- After creating a room with a doorway, as described above, exit to the exterior
- Turn around and define a polygonal shape selection, as above, with one edge very nearly lining up to the previous room
- Create the new room as described above ("/room ...")
- Once the room generates, type I to toggle door indicators. This will highlight a section of floor red corresponding to the doorway from the previous room (which is now covered by new wall)
- Use the red door indicator as a guide to draw a corresponding doorway in the new room as described above
- If all goes well, after generation, you should be able to move back and forth between the two rooms
- W A S D - movement
- / Open Console - to create an object, room, or door, typically after defining a selection with clicks
- C Clear Selection
- I Toggle Door Indicators
/room <desc> --xz <coords>
/create <desc> --x <x> --z <z> --ry [rotY] [--scale <scale>]
/door <desc> --xz <coords>
/undo
- removes the most recently created entity
- improve inference performance - keep models in memory
- handle errors in UI
- removing objects
- tagging objects for reuse/defining classes
- hook up a VLM to autonomously create environments
- hook up an LLM for storytelling
- variable height rooms
- create stairs/ramps and define rooms/surfaces at current/arbitrary height
- exterior environments/terrain
- controllable weather and lighting
- load humanoids with animations
- create, define and launch projectiles
- VR client
Copyright © 2024 Evan Jones