ComfyUI custom nodes for parsing JSON values and turning bounding-box style inputs into consistent integer coordinates.
- Parse JSON String: Parses a JSON string into the internal
JRW_PARSED_JSONdatatype used by the other JRW nodes. - Get JSON Property: Reads a property from a parsed JSON object by key.
- Get JSON List Item: Reads an item from a parsed JSON array by index.
- Extract Bounding Box: Reads one
[x1, y1, x2, y2]box from parsed JSON and returnsx1,x2,y1,y2,width, andheightas integers. - Extract Bounding Box From Box Inputs: Normalizes
SEGS,BOUNDING_BOX, orBBOXinputs into the same integer outputs.
Both bounding box nodes return:
x1: left edgex2: right edgey1: top edgey2: bottom edgewidth:x2 - x1height:y2 - y1
Coordinates are normalized so left/top are the smaller values, and fractional values are expanded to integer pixel bounds by flooring the minimum edge and ceiling the maximum edge.
Extract Bounding Box expects parsed JSON containing a list of 4-value boxes in [x1, y1, x2, y2] order.
Extract Bounding Box From Box Inputs accepts one connected source in this priority order:
SEGSBOUNDING_BOXBBOX
Supported formats include:
BOUNDING_BOXvalues withx,y,width, andheight- Mapping-like values using
x/y/width/height,left/top/width/height,x1/y1/x2/y2, orleft/top/right/bottom - Nested wrapper keys such as
bbox,box,bounding_box,bounds,rectangle,rect,crop_region,region, androi - 4-value sequences, namedtuples, and tensor or ndarray-like values that can be converted to
[x1, y1, x2, y2] - Impact Pack style
SEGSvalues such as(shape, [segments...])
Clone or copy this folder into your ComfyUI custom_nodes directory:
cd ComfyUI/custom_nodes
git clone git@github.com:Juarrow/custom_comfy_nodes.git jrw_comfy_qol_nodesRestart ComfyUI after installation or after backend code changes so the custom nodes are reloaded.
Node help markdown is stored in web/docs/ and is keyed by the backend node class names exported from NODE_CLASS_MAPPINGS.
Parse JSON Stringreturnsnullfor an empty string.Parse JSON Stringcan optionally raise on invalid JSON witherror_on_invalid.Get JSON Propertyrequires a Pythondictat runtime.Get JSON List Itemrequires a Pythonlistat runtime.Extract Bounding Boxcan return all zeros instead of raising whenerror_on_invalidis disabled.Extract Bounding Box From Box Inputsalways raises if no usable box input is provided.