Nodes/ComfyUI PS Connector/PS Get Image Size
ComfyUI Node

PS Get Image Size

Let Photoshop decide the canvas instead of hardcoding it

By doubley2000·Created 5 months ago·Updated 4 months ago· 5
PS Get Image Size
  • image
  • width
  • height
width512
height512
use_image_sizetrue

If you've ever built an img2img or inpainting workflow and then wished the canvas size would just follow the image you dragged in, this is the node you were looking for. PS Get Image Size sits in the middle of your graph, reads the actual dimensions of whatever image is flowing through, and hands them out as clean width and height integers. It's one of six nodes in the ComfyUI-PS-Connector pack, and it exists for one reason: so that when a Photoshop plugin (the pack's UXP frontend, AI2PS-plugin_PS.ccx) is driving your workflow, the person in PS gets to control the final resolution instead of you hardcoding 1024×1024 and forgetting about it.

The name isn't a metaphor. The node just looks at an image tensor and reports its shape. Feed it an optional image (IMAGE), and if the use_image_size toggle is on (it defaults to on), it returns that image's real width and height. Flip the toggle off and it falls back to the manual width and height inputs. That's the entire mechanism - two INT outputs, no magic.

The PS plugin's trick is what makes it interesting. When the PS panel sees one of these nodes in the workflow, it renders a small control with width and height fields, a swap button, and an "As img" checkbox. Check "As img" and the fields grey out: on generate, PS grabs the true size of the layer or selection you extracted and forces it over ComfyUI's width and height. Uncheck it and your typed values win. So the same workflow handles "regenerate at exactly the source resolution" and "scale this up to a fixed output" without touching the graph.

What you actually wire: connect the node after your image (a LoadImage or anything producing an IMAGE), then take the width and height outputs into whatever consumes dimensions - usually an Empty Latent node, or as in the pack's own (C)(SDXL)A.json example, straight into a LatentUpscale's samples input. Two wires, done.

Three inputs matter for a beginner:

  • image (optional IMAGE) - the reference whose size you want.
  • use_image_size (BOOLEAN, default true) - follow the image, or use your manual values.
  • width / height (INT, 1–16384) - the fallback when use_image_size is off.

One honest caveat from the README: the PS-side control only shows up if the size this node produces actually feeds the final sampler. If your dimensions go somewhere irrelevant, PS quietly forces it to "enabled" and you get no UI. So place it in the size chain that matters.

Install is the pack install - search "ComfyUI PS Connector" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/doubley2000/ComfyUI-PS-Connector

Restart ComfyUI. First boot auto-clones the ComfyUI-Lora-Manager dependency and drops three example workflows into ComfyUI/user/default/workflows/PSflows/, so restart once more after that. There are no extra Python dependencies to fight with - the pack's pyproject.toml lists none, and this node only uses torch and PIL, which ComfyUI already has.

Troubleshooting this one is mostly about context, not failure: if the PS panel shows no size widget, your size output isn't reaching the sampler, and if generated images come out at unexpected resolutions, check whether "As img" is checked on the PS side - it wins over anything you type in ComfyUI. Also be aware the pack is young (the README was last touched mid-2026, essentially zero community footprint), so its behavior can shift between updates.

CategoryPS_Connector

Inputs (4)

NameTypeDefaultDescription
widthINT5121–16384
heightINT5121–16384
use_image_sizeBOOLEANtrue
imageoptIMAGE

Outputs (2)

NameTypeDescription
widthINT
heightINT