Nodes/ComfyUI-CitronNodes/Width/Height Literal (Citron Image Saver)
ComfyUI Node

Width/Height Literal (Citron Image Saver)

The Width/Height Literal Only Hands You One Number

By citronlegacy·Created about a year ago·Updated 22 days ago· 0
Width/Height Literal (Citron Image Saver)
    • size
    ◄size512►

    First, the name oversells it

    It's called Width/Height Literal, and the pack README says it "provides width and height integers." The shipped code says otherwise. The class behind that title returns exactly one output - a single INT named size. Not a pair, not a tuple, one number.

    Which is fine, but plan for it: a 1024×768 workflow needs two of these nodes. If you dropped one on the canvas expecting two sockets and went hunting for the second, the label is the problem, not you. The (Citron Image Saver) suffix is just the pack's namespace prefix - it's on every node in here, including the ones that save nothing.

    Why you'd bother with a node that does nothing

    Because repetition is where workflows rot. Your resolution usually shows up in more than one place: the empty latent, an upscale target, maybe a note to yourself. Type 832 into three widgets, then switch to 1216 and update two of them - that's how you end up with a letterboxed render and no idea why.

    A literal node breaks that number out of a widget so it can fan out from one source. It's the same job core PrimitiveInt does, and it's the most common piece of plumbing in the ecosystem: one value, many consumers, no silent mismatch.

    How it works

    It's a passthrough. Whatever is in the widget goes out the socket, unchanged, every run. No math, no caching tricks, no hidden state. The bounds are the interesting part:

    • min 0, max 16384. That ceiling is ComfyUI's own MAX_RESOLUTION, the same limit the core latent nodes use. Your VRAM gives up long before 16384 does.
    • default 512, and step 8, which is a widget convention (the number drags and arrow-keys in eights), not a filter. Nothing downstream stops you feeding it 1001.
    • Don't. Latent space is 8× downsampled, so a size that isn't a multiple of 8 gets quietly floored, and you get 1000 instead of the 1001 you asked for and never notice. Keep it on 8, and for SD/SDXL-family models stay on multiples of 64, which is what they were trained on.

    Inputs and outputs that matter

    One in, one out.

    • size (INT, input): the number. The author's tooltip - "size as integer (in steps of 8)" - is the whole spec.
    • size (INT, output): wire it into anything with an integer socket.

    In practice that's a converted width/height widget on Empty Latent Image, the target-size inputs on upscale nodes, mask dimensions, a crop rect. Right-click the target widget → "Convert width to input," then drag the wire. If you convert it and leave it unwired, the widget value still applies, so nothing explodes mid-rewire.

    Installing it

    The README lists ComfyUI Manager as "coming soon," and the pack's pyproject.toml still has placeholder values in its publishing fields, so don't count on finding it in the registry. Clone it.

    cd ComfyUI/custom_nodes
    git clone https://github.com/citronlegacy/ComfyUI-CitronNodes.git
    pip install -r ComfyUI-CitronNodes/requirements.txt
    

    Then restart ComfyUI and search "Width" (or "Citron") in the node menu - you'll find it under Citron_ImageSaver/utils.

    No model downloads, nothing heavy, no GPU cost. The one dependency is piexif, which sounds absurd for a node that outputs an integer - and here's the gotcha: piexif is imported at the top of the pack's saver module, and __init__.py pulls that saver chain in on startup. Skip the pip install and the entire pack fails to import, literals included.

    Common issues

    The node isn't in the menu at all. Look for an IMPORT FAILED line naming this pack in the startup console - usually the missing piexif. Run the pip line and restart.

    You can't find the socket to plug into. The literal does nothing until the destination's widget becomes an input (right-click → Convert to input; newer frontends let you drag straight from the widget).

    Only one number came out. See the top. Two nodes, or accept a square.

    You get 1000 instead of 1001. Off-grid resolutions are the classic cause of "why is my image slightly cropped compared to what I set?"

    Worth knowing on support: this pack has almost no public footprint, so there are no tutorials to fall back on. The source is short and readable, which for a node this small is all the documentation you need.

    Would I install the pack for this node?

    No. PrimitiveInt ships with ComfyUI and does the identical job. If you already run Citron's image saver for its metadata handling, its literal family is a tidy set of typed value nodes and this one slots right in - but installing a whole pack for a number-in-a-box is a bad trade.

    CategoryCitron_ImageSaver/utils

    Inputs (1)

    NameTypeDefaultDescription
    sizeINT5120–16384size as integer (in steps of 8)

    Outputs (1)

    NameTypeDescription
    sizeINTsize (INT)