nano-world-model
Minimalist batteries-included repository for training, evaluating, and deploying diffusion-forcing video world models for robot manipulation, gaming, and MPC planning.
What this skill does
# Nano World Model
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
Nano World Model is a minimalist, batteries-included repository for training video world models using diffusion-forcing transformers. It supports diverse domains (robot manipulation, gaming, simulation), long-horizon autoregressive rollouts, video-to-3D reconstruction, and MPC-style planning via CEM.
---
## Installation
```bash
git clone https://github.com/simchowitzlabpublic/nano-world-model.git
cd nano-world-model
conda env create -f environment.yml && conda activate nanowm
```
Download the I3D model used for FID/FVD evaluation:
```bash
mkdir -p pretrained_models/i3d && curl -L \
"https://www.dropbox.com/scl/fi/c5nfs6c422nlpj880jbmh/i3d_torchscript.pt?rlkey=x5xcjsrz0818i4qxyoglp5bb8&dl=1" \
-o pretrained_models/i3d/i3d_torchscript.pt
```
---
## Environment Variables / Path Configuration
Set these before running any command, or define them in `src/configs/local/paths.yaml`:
```bash
export DATASET_DIR=/path/to/dino_wm_data # DINO-WM envs (point_maze, pusht, ...)
export CSGO_DATA_DIR=/path/to/csgo # CSGO HDF5 files
export RT1_DATA_ROOT=/path/to/rt1_fractal # RT-1 LeRobot mirror (optional)
export RESULTS_DIR=/path/to/results # checkpoints + logs
```
Or create `src/configs/local/paths.yaml`:
```yaml
# src/configs/local/paths.yaml
dataset_dir: /path/to/dino_wm_data
csgo_data_dir: /path/to/csgo
rt1_data_root: /path/to/rt1_fractal
results_dir: /path/to/results
```
---
## Key CLI Commands
The main entry point is `src/main.py` with [Hydra](https://hydra.cc/) config composition.
### Training
```bash
# DINO-WM PushT, NanoWM-B/2 (default best config: pred-v, additive injection, cosine+ZTSNR)
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2
# DINO-WM Point Maze
python src/main.py experiment=dino_wm_point_maze dataset=dino_wm/point_maze model=nanowm_b2
# CSGO with L/2 model
python src/main.py experiment=csgo dataset=game/csgo model=nanowm_l2_csgo
# RT-1 (fractal)
python src/main.py experiment=rt1 dataset=rt1/rt1 model=nanowm_b2
# Override training steps and batch size inline
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
train.max_steps=50000 train.batch_size=16
```
### Evaluation
```bash
# Evaluate a checkpoint (256 samples, seed=42, 250 DDIM steps)
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
mode=eval checkpoint_path=/path/to/checkpoint.ckpt
# Evaluate with custom sample count
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
mode=eval checkpoint_path=/path/to/checkpoint.ckpt eval.num_samples=512
```
### Long-Horizon Rollout
```bash
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
mode=rollout checkpoint_path=/path/to/checkpoint.ckpt \
rollout.horizon=50
```
### MPC Planning (CEM)
```bash
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
mode=plan checkpoint_path=/path/to/checkpoint.ckpt \
planning.method=cem planning.horizon=10 planning.num_samples=128
```
### Video → 3D Point Cloud
```bash
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
mode=video_to_3d checkpoint_path=/path/to/checkpoint.ckpt
```
---
## Pretrained Checkpoints
Load from HuggingFace directly:
```python
from huggingface_hub import hf_hub_download
# Download checkpoint
ckpt_path = hf_hub_download(
repo_id="knightnemo/nanowm-b2-dino-wm-pusht-100k",
filename="checkpoint.ckpt"
)
```
Available checkpoints:
| Domain | HF Repo | Steps |
|--------|---------|-------|
| Point Maze | `knightnemo/nanowm-b2-dino-wm-point-maze-30k` | 30k |
| Wall | `knightnemo/nanowm-b2-dino-wm-wall-15k` | 15k |
| Rope | `knightnemo/nanowm-b2-dino-wm-rope-15k` | 15k |
| Granular | `knightnemo/nanowm-b2-dino-wm-granular-15k` | 15k |
| PushT | `knightnemo/nanowm-b2-dino-wm-pusht-100k` | 100k |
| RT-1 | `knightnemo/nanowm-b2-rt1-300k` | 300k |
| CSGO | `knightnemo/nanowm-l2-csgo-100k` | 100k |
Use with CLI:
```bash
python src/main.py experiment=dino_wm_pusht dataset=dino_wm/pusht model=nanowm_b2 \
mode=eval checkpoint_path=$ckpt_path
```
---
## Configuration System (Hydra)
Config is composed from `src/configs/`. Key axes:
```
src/configs/
├── experiment/ # e.g. dino_wm_pusht, csgo, rt1
├── dataset/ # e.g. dino_wm/pusht, game/csgo, rt1/rt1
├── model/ # e.g. nanowm_b2, nanowm_l2_csgo
├── local/
│ └── paths.yaml # your local paths (gitignored)
```
Override any config key on the command line:
```bash
# Change prediction target (pred-v vs pred-x0 vs pred-eps)
python src/main.py experiment=rt1 dataset=rt1/rt1 model=nanowm_b2 \
model.pred_target=pred_x0
# Change action injection strategy
python src/main.py experiment=rt1 dataset=rt1/rt1 model=nanowm_b2 \
model.action_injection=concat
# Change noise schedule
python src/main.py experiment=rt1 dataset=rt1/rt1 model=nanowm_b2 \
model.noise_schedule=linear model.zero_terminal_snr=false
```
---
## Code Examples
### Loading a Trained Model Programmatically
```python
import torch
from omegaconf import OmegaConf
from src.models import NanoWM # adjust import to actual module path
# Load config and checkpoint
cfg = OmegaConf.load("src/configs/model/nanowm_b2.yaml")
model = NanoWM(cfg)
checkpoint = torch.load("/path/to/checkpoint.ckpt", map_location="cpu")
model.load_state_dict(checkpoint["state_dict"])
model.eval()
```
### Custom Dataset with DataSource API
```python
# src/wm_datasets/my_dataset.py
from src.wm_datasets.base import DataSource
import torch
class MyRobotDataSource(DataSource):
"""Custom data source following the DataSource API."""
def __init__(self, data_root: str, split: str = "train"):
self.data_root = data_root
self.split = split
self._load_index()
def _load_index(self):
# Build list of (video_path, action_path) tuples
...
def __len__(self) -> int:
return len(self.index)
def __getitem__(self, idx: int) -> dict:
# Must return dict with keys: "video" (T, C, H, W) and "actions" (T, A)
video = torch.zeros(16, 3, 64, 64) # float32, [0, 1]
actions = torch.zeros(16, 7) # float32
return {"video": video, "actions": actions}
```
Register in dataset config:
```yaml
# src/configs/dataset/my_robot.yaml
_target_: src.wm_datasets.my_dataset.MyRobotDataSource
data_root: ${oc.env:DATASET_DIR}/my_robot
split: train
```
### Running Autoregressive Rollout in Python
```python
import torch
from src.models import NanoWM
from src.utils.rollout import autoregressive_rollout
model = NanoWM.load_from_checkpoint("/path/to/checkpoint.ckpt")
model.eval().cuda()
# context_frames: (B, T_ctx, C, H, W), actions: (B, T_rollout, A)
context_frames = torch.randn(1, 4, 3, 64, 64).cuda()
actions = torch.randn(1, 50, 7).cuda()
with torch.no_grad():
rollout_frames = autoregressive_rollout(
model=model,
context_frames=context_frames,
actions=actions,
num_ddim_steps=250,
horizon=50,
)
# rollout_frames: (B, 50, C, H, W)
```
### MPC / CEM Planning Loop
```python
from src.planning.cem import CEMPlanner
planner = CEMPlanner(
world_model=model,
horizon=10,
num_samples=128,
num_elites=10,
num_iterations=5,
action_dim=7,
)
obs = torch.randn(1, 4, 3, 64, 64).cuda() # current context
best_actions = planner.plan(obs) # (horizon, action_dim)
```
---
## Design Choices & Ablation Axes
The repo provides clean ablation across three axes (see `docs/training.md`):
| Axis | Options |
|------|---------|
| **Prediction target** | `pred_v` ✓ (best), `pred_x0`, `pred_eps` |
| **Action injection** | `additive` ✓ (best), `concat`, `cross_attn` |
| **Noise schedule** | `cosine + ZTSNR` ✓ (best), `linear`, `cRelated in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.