ImageWAM with FLUX.2 [klein] base 9B on RoboTwin 2.0
An ImageWAM world-action model with the FLUX.2 [klein] base 9B image-editing backbone, trained on the 50 RoboTwin 2.0 dual-arm tasks. The recipe is that of the released FLUX.2-4B RoboTwin model (yuyangalin/ImageWAM-FLUX.2-4B-RoboTwin); the backbone is the 9B variant of the same model family, with its Qwen3-8B text features.
On the RoboTwin 2.0 benchmark (50 tasks, 100 episodes per task and setting) it succeeds in 94.58% of the clean and 94.34% of the randomized episodes, against 93.46% and 93.36% for the released FLUX.2-4B model in the same evaluation pipeline.
Training length. The run was scheduled for 69,900 optimizer steps (5 epochs) and was stopped at step 66,590. These are the weights of step 65,000, a saved checkpoint at 93% of the schedule; the cosine learning rate at step 65,000 is 2.32e-6, against 1e-4 at its peak and a floor of 1e-6.
Repository Layout
checkpoints/weights/step_065000.pt # model weights
config.yaml # the full resolved training config (Hydra); `model` builds the network, `data` holds the preprocessing
dataset_stats.json # z-score statistics of the 14-dim state and action
LICENSE.md, NOTICE # FLUX Non-Commercial License v2.1 and its attribution notice
- The layout is that of the training run directory.
dataset_stats.jsonsits three levels above the weight file, where the ImageWAM RoboTwin evaluation looks for it. It is byte-identical to the statistics file of the released FLUX.2-4B model. - The weight file (38.9 GB, SHA-256
f3f7366e1561299091e453b467b6f78f9de698e80c205c768f7ad753958380e1) is atorch.savedict:mot: the mixture-of-transformers state dict, 545 bfloat16 tensors.- Video expert:
mixtures.video.transformer.*, 9.08 B parameters, the fine-tuned FLUX.2 [klein] base 9B transformer. - The 192 tensors of its double- and single-stream blocks appear a second time under
mixtures.video.double_blocks.*andmixtures.video.single_blocks.*. The model registers these blocks under both names, and the copies are bitwise identical. They account for 17.4 GB of the file. - Action expert:
mixtures.action.*, 0.95 B parameters.
- Video expert:
proprio_encoder: the state-token encoder (184,320 parameters);step(65000),torch_dtype,checkpoint_formatandsave_trainable_only. LoRA is disabled in this run (flux2_lora_config.enabled: false); all weights are fully fine-tuned.
config.yamlkeeps the absolute paths of the training machine (dataset, base weights, text cache, action-expert initialization). Point them to local copies before use. It is the config of the last training segment (4 GPUs; see Training), sobatch_size,gradient_accumulation_stepsandresumeare that segment's.- Training logs, optimizer states, text features and data are not included.
Inputs and Outputs
Image (one frame, time t). The three RoboTwin cameras, each 480 × 640, are tiled into one 288 × 256 image (compact_288x256 layout):
| Camera | Tile (height × width) | Position |
|---|---|---|
cam_high (head) |
192 × 256 | top |
cam_left_wrist |
96 × 128 | bottom left |
cam_right_wrist |
96 × 128 | bottom right |
Each view is resized to its tile (bilinear), and the tiled image is scaled to [-1, 1]. It is encoded by the FLUX.2 autoencoder (ae.safetensors of FLUX.2 [dev]).
State (proprio), 14 values in raw units, z-scored with dataset_stats.json → state. The aloha-agilex arm joints in the order of the dataset:
| Index | Meaning |
|---|---|
| 0–5 | left arm: waist, shoulder, elbow, forearm roll, wrist angle, wrist rotate |
| 6 | left gripper |
| 7–12 | right arm, same order |
| 13 | right gripper |
The proprio encoder maps the normalized state to one token, placed right after the valid text tokens.
Text. The instruction is wrapped as
A video recorded from a robot's point of view executing the following instruction: {task}
and encoded by Qwen3-8B, as in FLUX.2 [klein]: the wrapped instruction is the user message of the chat template (generation prompt added, thinking disabled), and the hidden states of layers 9, 18 and 27 are concatenated per token into 12,288 dimensions, padded with a validity mask. Training used 128 positions from a feature cache; the evaluation below encodes each instruction online with 512 positions. The extra positions are masked padding.
Output.
- Action chunk [16, 14]: 16 future actions starting at t, with the same 14-dim layout as the state. The values are absolute joint and gripper targets, z-scored; de-normalize them with
dataset_stats.json→action. - Video branch (optional): the predicted 288 × 256 frame at t + 16.
Training
| Setting | Value |
|---|---|
| Data | yuanty/robotwin2.0-fastwam, the FastWAM LeRobot release of RoboTwin 2.0: 50 tasks × 550 episodes (50 clean and 500 randomized scenes per task), 27,500 episodes, 6,075,103 frames at 50 fps |
| Samples | every frame inside the non-idle ranges (89.29% of the frames) is one sample; episode-level 1% validation split |
| Instructions | the per-frame task strings of the dataset (921,032 distinct strings, RoboTwin seen templates) |
| Architecture | ImageWAM mixture of transformers: the FLUX.2 [klein] base 9B transformer (8 double-stream and 24 single-stream blocks) as video expert, an action DiT (hidden size 1,024) paired with it block by block as action expert |
| Objective | flow matching; λ_video 0.5, λ_action 1.0; train and inference shift 5.0 for both experts |
| Video | 17 frames (16 actions): reference frame t and the frame at t + 16 |
| Augmentation | with p = 0.5: color jitter 0.2/0.2/0.2/0.03, gamma 0.9–1.1, Gaussian noise 0.01, random resized crop (scale 0.95–1.0), rotation ±5° |
| Optimizer | AdamW, betas (0.9, 0.95), learning rate 1e-4, weight decay 0.01; 3,495 warmup steps (5%), then cosine to 1e-6 |
| Batch | global 384: 4 per GPU × 12 accumulation × 8 GPUs up to step 40,000, then 4 per GPU × 24 accumulation × 4 GPUs |
| Precision and parallelism | bf16; DeepSpeed ZeRO-1 up to step 40,000, then ZeRO-2; gradient clipping 1.0 |
| Hardware | NVIDIA H100 NVL: 8 GPUs (76.6 GB peak memory per GPU), then 4 GPUs (88.2 GB used per GPU) |
| Steps | 65,000 of the scheduled 69,900 |
| Trainable | the whole FLUX.2 transformer, the action expert and the proprio encoder. The text encoder and the autoencoder are frozen. |
| Initialization | video expert from FLUX.2 [klein] base 9B; action expert copied from the backbone's blocks and interpolated to its width (scripts/flux2/preprocess_action_dit_flux2.py, no embodied-data pretraining) |
The run moved from 8 to 4 GPUs at step 40,000: the 8-GPU optimizer state of step 40,000 was resharded for 4 GPUs, and training continued from it with the same global batch and the same sample order.
Differences to the released FLUX.2-4B recipe besides the backbone:
- The per-GPU split of the global batch of 384 (released: 12 per GPU × 4 accumulation × 8 GPUs).
- Gradient clipping 1.0 is applied, as in the paper's Table 8. The released model was most likely trained without effective clipping, because the upstream DeepSpeed configs set none.
- The weights are those of step 65,000.
Training-time validation (4 held-out samples per evaluation, every 500 steps; mean ± standard error of the 20 evaluations at steps 55,500–65,000, the step-65,000 evaluation in parentheses):
val_loss |
action_l1 (normalized) |
PSNR, predicted vs. true frame t + 16 | SSIM |
|---|---|---|---|
| 0.109 ± 0.010 (0.152) | 0.0098 ± 0.0011 (0.0043) | 28.73 ± 0.83 dB (32.39) | 0.915 ± 0.007 (0.936) |
Training loss over steps 64,001–65,000: 0.0737 (action 0.0015, video 0.0723).
Evaluation
RoboTwin 2.0 simulation, 50 tasks, each in clean (demo_clean) and randomized (demo_randomized) scenes, 100 episodes per task and setting:
- seed 42 (the expert-checked seeds from 4,300,000), unseen instructions;
- 10 denoising steps, action horizon 16, a new action chunk every 16 actions, text CFG scale 1.0;
- a failed episode runs to its task's step limit (400–1,700 actions);
- mean: the mean of the 50 per-task success rates; standard error: sqrt(Σ p(1 − p) / 100) / 50 over the tasks.
| Model | Clean | Randomized |
|---|---|---|
| FLUX.2-4B, paper Table 12 | 93.20 | 93.56 |
| Released FLUX.2-4B, same pipeline | 93.46 ± 0.33 | 93.36 ± 0.33 |
| This model (FLUX.2-9B, step 65,000) | 94.58 ± 0.30 | 94.34 ± 0.31 |
- Against the released FLUX.2-4B in the same pipeline: +1.12 ± 0.45 points clean and +0.98 ± 0.45 randomized as a difference of means; paired over the seeds both runs kept, +1.44 ± 0.40 and +1.22 ± 0.39.
- The evaluation process does not seed Python
random, which draws the instructions and is used by the cuRobo planner of the expert check. Two runs of the same protocol therefore differ in some seeds and instructions per task.
Success per task, in percent:
| Task | Clean | Randomized |
|---|---|---|
adjust_bottle |
100 | 99 |
beat_block_hammer |
98 | 99 |
blocks_ranking_rgb |
100 | 100 |
blocks_ranking_size |
93 | 96 |
click_alarmclock |
99 | 100 |
click_bell |
100 | 100 |
dump_bin_bigbin |
99 | 97 |
grab_roller |
100 | 100 |
handover_block |
96 | 92 |
handover_mic |
100 | 100 |
hanging_mug |
66 | 66 |
lift_pot |
100 | 100 |
move_can_pot |
96 | 98 |
move_pillbottle_pad |
98 | 100 |
move_playingcard_away |
100 | 100 |
move_stapler_pad |
86 | 69 |
open_laptop |
97 | 96 |
open_microwave |
98 | 89 |
pick_diverse_bottles |
91 | 86 |
pick_dual_bottles |
99 | 96 |
place_a2b_left |
98 | 98 |
place_a2b_right |
98 | 97 |
place_bread_basket |
98 | 94 |
place_bread_skillet |
93 | 97 |
place_burger_fries |
98 | 100 |
place_can_basket |
76 | 82 |
place_cans_plasticbox |
98 | 99 |
place_container_plate |
97 | 98 |
place_dual_shoes |
92 | 92 |
place_empty_cup |
100 | 100 |
place_fan |
98 | 97 |
place_mouse_pad |
92 | 95 |
place_object_basket |
85 | 85 |
place_object_scale |
100 | 99 |
place_object_stand |
99 | 97 |
place_phone_stand |
100 | 99 |
place_shoe |
95 | 97 |
press_stapler |
96 | 98 |
put_bottles_dustbin |
98 | 87 |
put_object_cabinet |
91 | 90 |
rotate_qrcode |
93 | 91 |
scan_object |
92 | 84 |
shake_bottle |
100 | 100 |
shake_bottle_horizontally |
100 | 100 |
stack_blocks_three |
99 | 99 |
stack_blocks_two |
100 | 100 |
stack_bowls_three |
80 | 85 |
stack_bowls_two |
90 | 96 |
stamp_seal |
87 | 92 |
turn_switch |
70 | 86 |
| mean | 94.58 ± 0.30 | 94.34 ± 0.31 |
Usage
The weights load into the ImageWAM code (github.com/yuyangalin/ImageWAM, MIT), whose FLUX.2 [klein] factory imagewam.runtime.create_imagewam_flux2_klein supports the 9B variant. Building the model needs the FLUX.2 inference code (github.com/black-forest-labs/flux2; the run used commit 50fe5162), the FLUX.2 [klein] base 9B transformer, the FLUX.2 [dev] autoencoder and Qwen3-8B.
import torch
from hydra.utils import instantiate
from omegaconf import OmegaConf
from imagewam.datasets.lerobot.robot_video_dataset import DEFAULT_PROMPT
from imagewam.datasets.lerobot.utils.normalizer import load_dataset_stats_from_json
cfg = OmegaConf.load("config.yaml")
cfg.model.flux2_src_path = "<flux2 checkout>"
cfg.model.flux2_model_path = "<FLUX.2-klein-base-9B>/flux-2-klein-base-9b.safetensors"
cfg.model.ae_model_path = "<FLUX.2-dev>/ae.safetensors"
cfg.model.qwen3_model_spec = "Qwen/Qwen3-8B"
cfg.model.load_text_encoder = True # encode instructions online
cfg.model.qwen_context_len = 512 # as in the evaluation above
cfg.model.action_dit_pretrained_path = None # the action expert comes from the checkpoint
model = instantiate(cfg.model, model_dtype=torch.bfloat16, device="cuda")
model.load_checkpoint("checkpoints/weights/step_065000.pt")
model.eval()
processor = instantiate(cfg.data.val.processor).eval() # state normalization / action de-normalization
processor.set_normalizer_from_stats(load_dataset_stats_from_json("dataset_stats.json"))
pred = model.infer_action(
prompt=DEFAULT_PROMPT.format(task=instruction),
input_image=image, # [1, 3, 288, 256] in [-1, 1], tiled as above
proprio=proprio, # [1, 14] normalized state
action_horizon=16, num_inference_steps=10, seed=42,
)
action_normalized = pred["action"] # [16, 14]; de-normalize with the processor's action normalizer
Limitations
- The run covers 65,000 of the 69,900 scheduled steps.
- Results are from simulation only; the model has not been run on a physical robot.
License
The weights are a Derivative of FLUX.2 [klein] base 9B under the FLUX Non-Commercial License v2.1 (LICENSE.md and NOTICE). Use is limited to Non-Commercial Purposes as defined there, and the Black Forest Labs Acceptable Use Policy applies. Any rights to use the weights are granted directly by Black Forest Labs Inc. under that license. The weights are not an official product of Black Forest Labs Inc. and are not endorsed by it.
- The text encoder Qwen3-8B (Apache-2.0) and the FLUX.2 [dev] autoencoder are not included.
- The training data come from the public RoboTwin 2.0 release in FastWAM format. The ImageWAM code is MIT-licensed.
IN NO EVENT SHALL THE AUTHORS OR BLACK FOREST LABS INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF OR IN CONNECTION WITH THE USE OF THESE WEIGHTS. The weights are provided as is, without warranty of any kind.
Citation
@article{zhang2026imagewam,
title = {ImageWAM: Do World Action Models Really Need Video Generation, or Just Image Editing?},
author = {Zhang, Yuyang and Zhang, Wenyao and Qi, Zekun and Zhang, He and Lin, Haitao and Zhang, Jingbo and
Mu, Yao and Yang, Xiaokang and Zeng, Wenjun and Jin, Xin},
journal = {arXiv preprint arXiv:2606.19531},
year = {2026}
}
- Downloads last month
- 8
Model tree for JingwuLuo/imagewam-flux2_9b-robotwin
Base model
black-forest-labs/FLUX.2-klein-base-9B