HYWorld2 Dataset Frame Pairs
Turning finished world renders into a training dataset
- final_frames
- dataset_frames
- context_frames
Once you've expanded a few worlds, you've got a pile of trajectory renders and their final expanded videos - and that pile is, quietly, a dataset. HYWorld2 Dataset Frame Pairs is the utility node that sweeps up that pile and turns it into structured frame pairs you can train on. It's aimed squarely at LoRA and dataset-prep workflows, which is why it lives in the pack's Utils category rather than the main pipeline.
The keyframe: final-video-based training is only as good as the pairing between your source render and the expanded result. This node does the pairing for you, walking every completed trajectory in your workspaces and matching frames.
How it works
Point it at your workspaces root with root_dir, optionally filter which workspaces with workspace_filter (a glob, default *), and name the result set with result_name (default worldstereo-memory-dmd - the same default the expansion stages write). max_pairs (0 = unlimited) caps how many pairs it collects.
For each trajectory it reads the source render.mp4 and the matching result video, aligns frame counts (it matches render indices to final frames), then emits three lists:
final_frames- the finished, expanded frames (your training target).dataset_frames- the matching source render frames (your conditioning input).context_frames- the previous final frame, as temporal context. The first frame gets a black context because there's nothing before it.
All frames get resized to the first pair's size so the batch is consistent. If a trajectory's render and result videos don't line up, the node raises a clear "Frame pairing failed" error rather than silently training on garbage.
Inputs and outputs
Four inputs, all simple: root_dir, workspace_filter, result_name, max_pairs. Three outputs, all IMAGE lists - the final_frames / dataset_frames / context_frames triple above. Feed them into a dataset-saver node or straight into a training graph.
Install & troubleshooting
Shared pack install: ComfyUI Manager (search HY-World 2.0) or clone + pip install -r requirements.txt + python install.py. The node reads videos via imageio-ffmpeg, which requirements.txt covers.
Two failure modes worth knowing. First: "No HYWorld2 dataset frame pairs found" means nothing matched - check result_name against what your expansion stage actually wrote (if you used the Klein node with a custom result_name, match it here). Second, the pairing error means the render and result videos genuinely have different frame counts - usually from a partially completed expansion run; re-run the expansion for that trajectory. And remember the frame pairing is only as clean as the expansion, so if your training set looks noisy, the fix is upstream in World Expansion, not here.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| root_dir | STRING | — | |
| workspace_filter | STRING | * | — |
| result_name | STRING | worldstereo-memory-dmd | — |
| max_pairs | INT | 00–1000000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| final_frames | IMAGE | — |
| dataset_frames | IMAGE | — |
| context_frames | IMAGE | — |