BBox Bridge to WithAnyone
The adapter that speaks WithAnyone's bbox dialect
- withanyone_bbox
WithAnyone is a Flux-based identity-consistent generation model (from Doby-Xu's project) that gets a lot of attention for controllable, copy-paste-free face generation - and its ComfyUI nodes expect bounding boxes in a specific dialect: normalized ratios like 0.1234,0.4567,0.6789,0.8123, meaning x1_ratio,y1_ratio,x2_ratio,y2_ratio in 0-to-1 space. Pixel coordinates from a canvas node won't cut it. BBox Bridge is the translator: it takes a width, a height, and a canvas-format x,y,w,h string, and spits out the WithAnyone string.
How it works
The math is trivial but it's the kind of trivial you'd rather not do by hand and hardcode into a workflow. The node parses canvas_bbox (x,y,w,h), computes the second corner (x2 = x + w, y2 = y + h), divides everything by the canvas width/height to get 0–1 ratios, clamps to range, and formats to four decimals. Empty input returns an empty string rather than erroring.
- Inputs:
width,height,canvas_bbox. - Output:
withanyone_bbox- wire this straight into WithAnyone's conditioning node.
The intended flow is: draw the box on Canvas BBox (or anywhere that gives you x,y,w,h), pipe it through here, done. It's the pack's own glue for a WithAnyone workflow.
The honest take
This is a niche-of-a-niche node. If you don't run WithAnyone, it does nothing for you - skip it. If you do, and you're tired of typing 0.5234,0.3123,... by hand into WithAnyone's single-person conditioning, it's exactly the bridge the name promises. It also works as a general "pixels to normalized ratios" converter for any consumer that wants 0–1 bboxes, since that format shows up across several control/conditioning nodes.
Installing
Like the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI-YCNodes_Toolkit
Restart (or use ComfyUI Manager and search "ComfyUI-YCNodes_Toolkit"). Dependencies are just numpy and Pillow. Note it's a helper - you'll still need WithAnyone itself installed for the output to be useful, and that's a heavier setup than this pack alone.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| canvas_bbox | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| withanyone_bbox | STRING | — |