DXF Stats (bbox & count)
Bounding box and entity count
- dxf
- bbox
- count
DXF Stats is the diagnostic node of the DXF lane in ComfyUI_DAO_master. It answers two questions about whatever drawing you've built: how big is it and how much stuff is in it. That's it - no inputs besides the DXF object, and two outputs. Thin, but genuinely useful when you're chaining geometry nodes and want to know whether your drawing is 5mm or 5 meters, or whether that transform actually did anything.
How it works
The node walks the DXF modelspace and computes a bounding box over every supported entity type - circles, lines, polylines, ellipses, splines, arcs - by flattening each entity to sample points (curved entities are flattened with a fine tolerance to catch their true extents). The count is simply the number of entities in the modelspace. Both are computed on the fly from the live in-memory document, so you always get current numbers, no file I/O.
Inputs and outputs
One input: dxf. Two outputs:
bbox- aSTRINGof the form(min_x, min_y, max_x, max_y)in the document's units. If the drawing has no geometry, you get the string"None".count- anINTwith the number of entities.
bbox is the one you'll actually use. Wire it into a Show Text node to read it at a glance, or parse it downstream. There's no need to guess the canvas size for a DXF Preview when you can read the true extents here first.
Why you'd reach for it
The honest answer: this is a debugging and sizing tool, not a headline feature. It earns its place in workflows like:
- Checking that a
DXF Transformscale actually changed the bbox (compare before/after). - Knowing the drawing's extents before you export to SVG, so the viewBox isn't a surprise.
- Verifying your geometry-building loop isn't silently producing an empty document -
countof 0 tells you fast.
How to install
Part of the orion4d/ComfyUI_DAO_master pack:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/ComfyUI_DAO_master.git
pip install ezdxf # the only dependency this node touches
Restart ComfyUI. No models, no system tools.
Common issues
bbox returning "None" means there's no geometry in the document - add shapes upstream. Don't expect the bounding box to account for line weight or stroke thickness; it's the geometric extents of the entities themselves. And a friendly reminder: the units are whatever you set in DXF New, so a bbox of (0, 0, 10, 10) is 10 millimeters or 10 inches depending on what you chose, not what the numbers look like.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| dxf | DXF | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| bbox | STRING | — |
| count | INT | — |