π Compositor Transforms Output (V3)
Turn a canvas layout into numbers other nodes can eat
- x
- y
- width
- height
- angle
- bbox x
- bbox y
- bbox width
- bbox height
The Compositor remembers where you dragged things, but that knowledge lives in a JSON string - the transforms output on Compositor3. This node is the translator: it reads that JSON and spits out plain integers that ordinary nodes understand. The pitch in the README is regional prompting: drag an image exactly where you want it on the canvas, then feed its x/y/width/height straight into a Set Area Conditioning node or a crop/paste coordinate input, and your generation region lines up with your visual layout.
Wire the Compositor's transforms output into the transforms input here. That's the whole connection.
Inputs
transforms- the JSON string from the Compositor. Note it'sforceInput, so you must wire it; you can't type a value in.channel- which of the 8 layers to read (1β8, default 1). Remember image1 is the background-most layer.forceInt- when on (default), everything comes out as integers. That's what Set Area Conditioning wants. Flip it off if you need the raw float precision.
Outputs
Nine of them, all per the selected channel: x, y, width, height, angle, plus the bounding box variants bbox x, bbox y, bbox width, bbox height. The x/y are the layer's top-left after padding is subtracted (the canvas coordinates are padding-based, so this node removes it for you), width/height are the scaled dimensions, and the bbox set is the layer's un-rotated bounding box - useful when the object is rotated and you need the axis-aligned footprint. All of them wire into INT inputs downstream.
Installing
Pack install as usual - no models, no extra dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/erosDiffusion/ComfyUI-enricos-nodes.git
or ComfyUI Manager β "Compositor" β erosDiffusion, then restart.
Gotchas
- The
anglehere is the rotation from the canvas state; if you rotate a layer and then feed its x/y into something, use the bbox pair if the unrotated footprint is what the downstream node expects. - The transforms JSON is only updated when the canvas saves (on mouse-out), so the numbers you get are from the last saved state. If you drag something and the outputs look stale, mouse out of the canvas to save first.
- This is the V3 node; the V4-era equivalent (Compositor4TransformsOut) exists and reads the same JSON structure, but V4 currently hands you the state via
fabricData_outputinstead of atransformssocket - same data, different port.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| transforms | STRING | β | |
| channel | INT | 11β8 | β |
| forceInt | BOOLEAN | true | β |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| x | INT | β |
| y | INT | β |
| width | INT | β |
| height | INT | β |
| angle | INT | β |
| bbox x | INT | β |
| bbox y | INT | β |
| bbox width | INT | β |
| bbox height | INT | β |