ImageFromBatch_motorway_edition
Pull a slice out of an image batch without a visible wire
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
Once your images live in a batch, you often need just one slice of it - the first frame of a video to condition on, a single middle frame to inspect, a handful of frames to route somewhere else. ImageFromBatch does exactly that, and ImageFromBatch_motorway_edition is the same node reading its input from and writing its output to a MOTORWAY 🚌💨 pipe.
It's part of agilly1989/ComfyUI_agilly1989_motorway, the author's key-value pipe pack. It reads the batched image out of the pipe under INPUT_image_key (default "image"), slices out a run of frames, and stores the result back under OUTPUT_IMAGE_key (default "IMAGE"). Only output is the Motorway itself.
Inputs that matter
INPUT_image_key(default"image") - pipe key of the batchbatch_index(INT, 0 to 4095, default 0) - which frame to start at (zero-based)length(INT, 1 to 4096, default 1) - how many frames to pullOUTPUT_IMAGE_key(default"IMAGE") - where the slice lands
The mental model is batch[batch_index : batch_index + length]. So to grab the 4th frame of a video, set batch_index to 3 and length to 1. To pull frames 0 through 9, leave batch_index at 0 and set length to 10. If batch_index + length runs past the end of the batch, you'll get an error - know how many frames you actually have.
How it works
Standard clone pattern: pop the Motorway, pull the batch out using the input key, run stock ImageFromBatch with batch_index and length, store the result under the output key, and return a cloned pipe so nothing upstream is touched. It's the natural partner to the pack's ImageBatch_motorway_edition - one stacks images into a batch, the other slices them back out.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
Restart ComfyUI, or install via ComfyUI Manager (search "motorway"). No dependencies beyond ComfyUI itself, no model downloads.
Gotchas
Keys are exact and case-sensitive; a 'MotorwayClass' object has no attribute 'hash_' error means your key string doesn't match anything in the pipe yet. Also mind that the defaults read lowercase ("image") and write uppercase ("IMAGE"), so if you chain this with a clone that reads "image", nothing will be there - set the strings to agree. And the pack-wide health warning: BETA, with the motorway_edition clone family disabled in the 1.1.7 hotfix, so if the node's missing from your menu the stock ImageFromBatch is the same tool with wires.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_image_key | STRING | image | — |
| batch_index | INT | 00–4095 | — |
| length | INT | 11–4096 | — |
| OUTPUT_IMAGE_key | STRING | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |