TdxhImageToSize
One image in, every size type out
- image
- width_INT
- height_INT
- width_FLOAT
- height_FLOAT
- width_STRING
- height_STRING
- width_NUMBER
- height_NUMBER
TdxhImageToSize reads the pixel dimensions of an image and hands them back to you in every type ComfyUI will ever ask for. Feed it one IMAGE, and out come eight outputs: width_INT, height_INT, width_FLOAT, height_FLOAT, width_STRING, height_STRING, width_NUMBER, height_NUMBER. Same two numbers, four representations each.
Under the hood it's almost insultingly simple - the source converts the tensor to a PIL image and reads .size. The whole point is downstream: ComfyUI's type system is picky, and different nodes want the same dimension in different types. EmptyLatentImage wants INTs. Several custom packs (Impact among them) ask for NUMBER. Some text-overlay or save-node variants want STRING. If you're building an img2img or ControlNet workflow that has to match a loaded image's resolution exactly, this node is the no-thinking way to size everything off one source image - you never hardcode a resolution again, and you never hand a FLOAT to a node that demanded an INT and watch it silently misbehave.
The natural wiring: image → TdxhImageToSize → width/height INT → EmptyLatentImage for an img2img setup, or into a KSampler's latent. Use the STRING pair if you're printing the resolution into a caption. Use the NUMBER pair if you've got a node that refuses INT.
Installing it
Part of the tdxh_node_comfyui pack, so one install covers all sixteen nodes. ComfyUI Manager → search tdxh_node_comfyui → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/youyegit/tdxh_node_comfyui
Restart ComfyUI and it's under TDXH → tdxh_image. Hobbyist pack, GPL-3.0; the README warns that nodes can change between versions. No models, no dependencies beyond the pack's sentencepiece line.
When to skip it
If your resolution is always fixed, just type the numbers into EmptyLatentImage and save yourself a node. This earns its slot when you're working from input images that vary in size and everything downstream must track them - the "make my pipeline resolution-agnostic" case, which is exactly what the author's own workflows needed it for. Its big brother, TdxhImageToSizeAdvanced, does all of this plus mode-based resizing; grab that one if you also need to transform the size, not just report it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| width_INT | INT | — |
| height_INT | INT | — |
| width_FLOAT | FLOAT | — |
| height_FLOAT | FLOAT | — |
| width_STRING | STRING | — |
| height_STRING | STRING | — |
| width_NUMBER | NUMBER | — |
| height_NUMBER | NUMBER | — |