Nodes/comfyui-panels/BBox from Ints
ComfyUI Node

BBox from Ints

The three-second constructor for the pack's bounding boxes

By bmad4ever·Created 12 months ago·Updated 2 months ago· 41
BBox from Ints
    • BBOX
    xmin0
    ymin0
    xmax64
    ymax64

    This is a constructor node, and it does one thing: four integers in, one BBOX object out. No math, no options, no surprises. BBox From Ints takes xmin, ymin, xmax, ymax and packages them as the (xmin, ymin, xmax, ymax) tuple that the pack's crop and bounds nodes all consume.

    Why would you want this instead of just typing numbers into a crop node? Because a BBOX is a first-class value in comfyui-panels - it's what Crop Image By BBox, Crop Mask By BBox, and the crop-masks utilities accept, and it's what the polygon bounds nodes emit. When you have a hand-computed region (say, you measured a panel on your page and want to feed it through the same pipeline that the detected boxes flow through), this node converts your raw numbers into the pack's native currency so the rest of the graph treats it identically. It's also handy as a scaffold when you're prototyping: make a box, crop, tweak the four numbers, repeat - without hunting for where the crop node got its values.

    The inputs and output

    • xmin - default 0.
    • ymin - default 0.
    • xmax - default 64.
    • ymax - default 64.

    Output: one BBOX (the values are converted to floats internally, matching how polygon bounds come out of shapely). The defaults make a 64×64 box from the origin, which is a fine starting point for test crops.

    Installing it

    Part of comfyui-panels - Manager, search "comfyui-panels", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bmad4ever/comfyui_panels
    

    Restart, install deps (shapely, matplotlib, opencv-python), no models.

    Where people get burned

    Honestly, there's not much to get burned by here - it's four numbers. The only real trap is the coordinate convention: in this pack's world x is width, y is height, and a bbox is (left, top, right, bottom) with the origin at the top-left. If you swap min/max, the crop nodes will clamp to nothing and you'll get an empty crop, which is confusing precisely because nothing errors. Keep left < right and top < bottom and you're fine.

    CategoryBmad/Panels

    Inputs (4)

    NameTypeDefaultDescription
    xminINT0
    yminINT0
    xmaxINT64
    ymaxINT64

    Outputs (1)

    NameTypeDescription
    BBOXBBOX