Nodes/APW_Nodes/Image Size (Cloud Models)
ComfyUI Node

Image Size (Cloud Models)

A resolution dropdown for cloud image models — no API key required

By alessandroperilli·Created about a year ago·Updated 12 months ago· 4
Image Size (Cloud Models)
    • aspect_ratio
    • image_width
    • image_height
    • image_latent
    • batch_size
    Aspect Ratio
    Batch Size1

    The name is a lie, and that's the best thing about it. Image Size (Cloud Models) reads like it's about to phone OpenAI and rent a GPU - it doesn't. No API call, no key, no network traffic. This node is a dropdown that hands you a resolution and a batch size, built for workflows that eventually talk to hosted generators like OpenAI's GPT-image-1. You do the cloud part elsewhere; this node just keeps the numbers tidy.

    It comes from APW_Nodes, a small suite of utility nodes that Alessandro Perilli extracted from his free "AP Workflows for ComfyUI" pack. The philosophy of that suite is industrial-scale generation: big batches, reproducible settings, everything wired through named inputs instead of hardcoded numbers. Cloud Size is the hosted-model cousin of the pack's local size nodes - pick a preset, and out come clean integers you can push into whatever calls the API.

    How it works

    Under the hood it's embarrassingly simple, which is the appeal. The Aspect Ratio dropdown maps to a hardcoded dictionary, and the node returns five outputs: a "WxH" string, image_width, image_height, a blank image_latent, and batch_size. The latent is a torch.zeros tensor sized [batch, 4, H//8, W//8] - a leftover from the local siblings that makes this a drop-in swap if you ever switch a workflow from local to hosted. For a cloud model you'll never run locally, that latent is decorative. Wire the dimensions.

    The inputs that matter

    Only two, and both are trivial:

    • Aspect Ratio - three real choices: 1536x1024 (3:2 | 1.6MP), 1024x1536 (2:3 | 1.6MP), and 1024x1024 (1:1 | 1MP). That's the full GPT-image-1 resolution list.
    • Batch Size - 1 to 64, default 1.

    Unlike the local image size node, there's no custom width/height here. What you see is what you get.

    Wiring it up

    Feed image_width and image_height into whatever node formats your hosted-model request, or pass the aspect_ratio string straight into a text prompt or API parameter. Because aspect_ratio is typed as a wildcard (*), it'll plug into nearly anything - that's deliberate, and handy.

    Installing it

    The pack installs like any other:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alessandroperilli/apw_nodes
    

    Restart ComfyUI, or install through ComfyUI Manager by searching "APW Nodes". There are no extra pip dependencies and no model downloads - it leans only on torch and Pillow, which ComfyUI already ships. One thing to know: this repo is archived. The author points to its successor, OCS_Nodes (Open Creative Studio Nodes), but the archived code works fine as-is.

    Where people get burned

    Two small traps. First, the ------ OpenAI GPT-image-1 ------ line at the top of the dropdown is a label, not a choice - but ComfyUI will happily let you select it. In this node that's not even a safe fallback (unlike the local version): the resolution map lookup fails and the node errors out. Pick a real preset. Second, remember this node never actually touches the cloud - if you wire its image_latent into a sampler expecting a real GPT-image-1 call, you'll just get a blank tensor back. Use it for dimensions, not magic.

    CategoryAPW Nodes

    Inputs (2)

    NameTypeDefaultDescription
    Aspect RatioCOMBO4 options: ------ OpenAI GPT-image-1 ------, 1536x1024 (3:2 | 1.6MP), 1024x1536 (2:3 | 1.6MP), 1024x1024 (1:1 | 1MP)
    Batch SizeINT11–64

    Outputs (5)

    NameTypeDescription
    aspect_ratio*
    image_widthINT
    image_heightINT
    image_latentLATENT
    batch_sizeINT