Image Slice Cowboy
Split an Image or a Whole Batch in Half, Cleanly
- images
- left_or_top
- right_or_bottom
- size_a
- size_b
Sometimes the fastest way to process an image is to cut it in half. Side-by-side comparison panels need to come apart, spritesheets need splitting into cells, a video frame needs its two regions processed with different settings, and a 2D layout occasionally needs to become two separate passes. Image Slice Cowboy is the node that does the cutting: one straight slice through every frame, two halves out.
It's the kind of node whose spec is almost boringly simple - until you realize it keeps the batch structure intact. N frames in means two batches of N frames out, each half preserving the full sequence. That's what makes it useful in video pipelines, not just on single images.
How it works
Three controls:
direction-verticalcuts left/right,horizontalcuts top/bottom.split_position(0.01–0.99, default 0.5) - where the cut lands along the chosen axis. 0.5 is exactly halfway; 0.3 chops 30% off the left/top. So it's not just a halver - it's a "chop at X%" tool.force_even(default off) - rounds the cut to an even pixel so both halves stay divisible by 2, which matters because diffusion models want even dimensions. Turn this on for anything destined for a sampler or a video encoder.
Outputs are named for whichever direction you picked:
left_or_top/right_or_bottom- the two halves. For a vertical cut that's left and right; for horizontal, top and bottom.size_a/size_b- the pixel size of each half (width for vertical, height for horizontal). Handy for sanity checks and for re-joining the halves later with exact offsets.
A batch of N frames in produces two batches of N frames out - each half keeps the full batch, so a video clip splits into two complete clips. That's the detail that makes this more than a single-image crop tool.
Where you'll actually use it:
- Comparison grids - split a side-by-side A/B image into the two originals.
- Two-pass processing - run different upscalers or different prompts on each half of a frame, then rejoin.
- Spritesheet / layout splitting - chop a tiled layout into its component pieces (slice repeatedly for a full grid).
- Video halves - split a clip's frames vertically or horizontally to process each half separately.
Install
Search "Trent Nodes" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt
Pure tensor slicing - no models. Restart ComfyUI after installing. (Manager has been flaky on this pack per the author's early-rename note; the manual clone always works.)
Common issues
- Odd-sized halves. That's what
force_evenfixes. If a downstream node complains about dimensions, that's your first switch to flip. - "I cut left/right but got top/bottom." Double-check
direction- the output namesleft_or_top/right_or_bottomcover both directions, so it's easy to misread which is which until you look at the result. - Lost track of where the cut was.
size_atells you the first half's dimension - combine it with the original size to reconstruct the exact cut position for re-joining.
For splitting a batch in half (or at any percentage) without losing the batch, this is the node. Small, sharp, and it does exactly what the name says.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| direction | COMBO | vertical | vertical = cut left|right, horizontal = cut top|bottom |
| split_position | FLOAT | 0.500.01–0.99 | Where to cut along the axis (0.5 = halfway) |
| force_even | BOOLEAN | false | Round the cut to an even pixel so both halves stay divisible by 2 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| left_or_top | IMAGE | — |
| right_or_bottom | IMAGE | — |
| size_a | INT | — |
| size_b | INT | — |