Files
ausboss-ComfyUI-AusBoss/js/docs/AUSBOSS_NODES_ImageSize.md
ausboss 05038baaa3 Five basics the normal nodes have: sums, any wire into Show Text, name tokens, word weights, Image Size's numbers
Found in a sweep of the pack against ComfyUI's own nodes: things the normal
node does that the pack's node did not.

- Every number box takes a sum. Click a number, type 1024*1.5 or
  (1920-64)/2 and press Enter, as in ComfyUI's own number boxes: + - * / %,
  brackets and a sign. The reader is the pack's own (sumValue in
  js/shared/scrub_input.mjs) and is only asked when the text is not a plain
  number.
- Show Text takes any wire. Its input was STRING only. A number, an on/off
  value or a list is shown too; a picture or a latent is shown by its size.
  The output stays STRING and carries the text that is shown, so text
  passes through unchanged and a number comes out as text.
- Save Image takes name tokens in the file name, as ComfyUI's own Save
  Image does: %date:yyyy-MM-dd% and %Node.setting% are filled in the
  browser when a run is sent (js/shared/name_tokens.mjs, now shared with
  Save Video), %width% %height% and the time tokens on the server. The
  path preview shows them. A linked filename is never read for tokens.
- Ctrl + Up and Ctrl + Down change a word's weight in the pack's prompt
  boxes (Text, Krea 2 Encode). The card's text box stopped the key before
  ComfyUI's own listener saw it; those two keys now go on from a multiline
  box, and from nowhere else.
- Image Size shows what it measured beside its outputs after a run
  ("width: 1024"). The numbers go into the output labels, so the node keeps
  its size. ComfyUI says nothing about a node whose answer came from its
  cache, so the numbers are kept in the node's properties and come back
  when a workflow is opened again; a changed picture wire clears them.

No input was added, renamed or reordered. Help pages, README lines, tests
and CHANGELOG entries are included.
2026-10-11 17:10:52 -05:00

1.4 KiB

Image Size

Reads an image's dimensions and hands them out as INTs: width, height, longest_edge, shortest_edge, and count.

Wire them wherever a workflow wants numbers that must match the actual image — an Empty Latent sized to the source, a resize keyed off the longest edge, aspect-aware math with the shortest. Because the values come off the wire, they can never drift out of date the way retyped numbers do.

After a run the node shows each number beside its output, such as width: 1024, so you can read the size without wiring anything to it.

Outputs

  • width / height: The frame size in pixels.
  • longest_edge: max(width, height) — the number resize-to-fit logic keys on.
  • shortest_edge: min(width, height) — the number crop-to-fill and many preprocessing pipelines key on.
  • count: The number of images in the batch — 1 for a single image, the frame count for video frames.

Notes

A batch reports the size its frames share (IMAGE batches are uniform by construction). The node does no work worth caching or canceling — it reads its numbers off the tensor's shape.

The numbers beside the outputs are from the last run. They are saved with the workflow, so a workflow you open again shows them, and they are cleared when you wire in another picture. If the node measured a list of batches in one run, it shows no numbers, since no one number is true for all of them.