Skip to content

Juarrow/custom_comfy_nodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JRW ComfyUI node collection

ComfyUI custom nodes for parsing JSON values and turning bounding-box style inputs into consistent integer coordinates.

Included Nodes

  • Parse JSON String: Parses a JSON string into the internal JRW_PARSED_JSON datatype 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 returns x1, x2, y1, y2, width, and height as integers.
  • Extract Bounding Box From Box Inputs: Normalizes SEGS, BOUNDING_BOX, or BBOX inputs into the same integer outputs.

What The Box Nodes Return

Both bounding box nodes return:

  • x1: left edge
  • x2: right edge
  • y1: top edge
  • y2: bottom edge
  • width: x2 - x1
  • height: 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.

Accepted Box Formats

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:

  1. SEGS
  2. BOUNDING_BOX
  3. BBOX

Supported formats include:

  • BOUNDING_BOX values with x, y, width, and height
  • Mapping-like values using x/y/width/height, left/top/width/height, x1/y1/x2/y2, or left/top/right/bottom
  • Nested wrapper keys such as bbox, box, bounding_box, bounds, rectangle, rect, crop_region, region, and roi
  • 4-value sequences, namedtuples, and tensor or ndarray-like values that can be converted to [x1, y1, x2, y2]
  • Impact Pack style SEGS values such as (shape, [segments...])

Installation

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_nodes

Restart ComfyUI after installation or after backend code changes so the custom nodes are reloaded.

Documentation

Node help markdown is stored in web/docs/ and is keyed by the backend node class names exported from NODE_CLASS_MAPPINGS.

Notes

  • Parse JSON String returns null for an empty string.
  • Parse JSON String can optionally raise on invalid JSON with error_on_invalid.
  • Get JSON Property requires a Python dict at runtime.
  • Get JSON List Item requires a Python list at runtime.
  • Extract Bounding Box can return all zeros instead of raising when error_on_invalid is disabled.
  • Extract Bounding Box From Box Inputs always raises if no usable box input is provided.

About

Custom node collection to improve my quality-of-workflow-life in comfy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages