ComfyUI Node
Select loop segment
Pick the best self-closing loop out of a shot by seam versus motion, then resample it to a fixed frame count for a sprite atlas.
Select loop segment
- image
- ui_widget
- image
- receipt
- image_list
◄source_fps24.00►
◄target_count24►
◄min_period_frames12►
◄max_period_frames96►
◄motion_floor0.60►
◄analysis_max_edge96►
Category✨ LF Nodes/Image
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Ordered frames of one shot (for example a decoded video). The best self-closing segment is chosen and resampled to target_count frames, excluding the final endpoint so the loop closes. | |
| source_fps | FLOAT | 24.000.01–1000 | Frame rate of the source frames; derives cycle seconds. |
| target_count | INT | 241–4096 | Frames in the output loop. Periods shorter than this are ignored. |
| min_period_frames | INT | 122–4096 | Shortest cycle to consider, in source frames. |
| max_period_frames | INT | 962–4096 | Longest cycle to consider, in source frames (clamped to the shot). |
| motion_floor | FLOAT | 0.600–4 | Minimum mean inter-frame motion inside a candidate, as a multiple of the shot's median step. Keeps frozen stretches from winning. |
| analysis_max_edgeopt | INT | 968–1024 | Longest edge of the grey analysis copies. |
| ui_widgetopt | LF_MASONRY | [object Object] | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Sampled loop frames as one batch, in playback order; pixels are unchanged. |
| receipt | JSON | Loop-selection receipt: chosen start/period, seam and motion scores, sampled indices. |
| image_list | IMAGE | The same sampled frames as an authoritative list. |