ComfyUI Node
kubakub crop
Crop by drawing on the picture, as in Photoshop: drag a box, drag inside it to move it, the handles to size it (Shift keeps the ratio, Alt sizes from the centre), double click = all of it. Pick a ratio on the pills (original, 'picture' = the ratio of a connected picture, e.g. the facade matrix), and the size that comes out. Drag past the edge to add canvas: the new area is filled (edge, mirror, black, white, grey) and comes out as its own mask, for an outpaint. A batch or video is cut the same on every frame. The box is kept as a part of the picture, so it stays right when the picture comes at another size.
kubakub crop
- image
- ratio_of
- image
- box_mask
- new_area
- crop_box
◄box0 0 1 1►
◄ratiofree►
◄sizeas cut►
◄model_safetrue►
◄filledge►
Categorykubakub/utils
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The picture (or the frames of a video) to crop. | |
| box | STRING | 0 0 1 1 | The box, drawn on the picture (kept as 0-1 of it). You never need to type it. |
| ratio | COMBO | free | The box's shape (the pills on the picture). |
| size | COMBO | as cut | What comes out: the pixels as cut, or scaled to this long side. |
| model_safe | BOOLEAN | true | Width and height in steps of 16 px (what Flux and most models want). |
| fill | COMBO | edge | What fills the canvas added past the picture's edge. |
| ratio_ofopt | IMAGE | A picture whose shape the box takes (the 'picture' pill), e.g. the facade matrix. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The crop (every frame). |
| box_mask | MASK | White where the box lies on the picture (the picture's size). |
| new_area | MASK | White on the canvas added past the picture's edge (the crop's size): the mask for an outpaint. All black when nothing was added. |
| crop_box | KUBA_CROP_BOX | Where the crop came from: for kubakub uncrop. |