Load Image Resizer PoP
Load an image and hit a megapixel target in one node
- IMAGE
- MASK
The standard way to load an image and get it to a sane working size in ComfyUI is two nodes: LoadImage, then something like an image-scale node to hit your target resolution. This folds both into one - pick a file from your ComfyUI input folder, set a megapixel target, and out comes an appropriately-sized image with its aspect ratio preserved. It's a convenience node, not a novel technique, but it's a genuinely handy one if you're feeding a batch of differently-sized source photos into a workflow and want them normalized to a consistent compute budget before anything downstream touches them.
How it works
It loads the file the same way LoadImage does, then computes new dimensions from your megapixels target while keeping the original aspect ratio intact - the math scales width and height together so the output lands near your target pixel count without distorting the image. If the source file has an alpha channel, that gets pulled out as a separate mask output; if it doesn't, you still get a mask, just an empty one, so the output shape stays consistent whether or not your source image happened to have transparency.
Sizing to a megapixel budget rather than a fixed width/height matters for a reason grounded in how diffusion models work: every model has a native resolution range, and feeding it images way outside that range - whether upstream through img2img or through a ControlNet preprocessor - is a common source of degraded output, duplicated detail, or outright noise. Normalizing a folder of oddly-sized source photos to roughly the same megapixel count before they hit your VAE encoder or preprocessors is cheap insurance against that.
The inputs and outputs that matter
image- pick from files already in ComfyUI's input folder, same selection UI as the standard LoadImage node.megapixels(default 1, range 0.01–64) - your target size. 1.0 lands you around SDXL's native ballpark; drop it for SD 1.5-scale work, raise it if you're deliberately working at a higher resolution.- Outputs are
IMAGEandMASK- the resized image goes wherever a source image is needed (img2img, a ControlNet preprocessor, VAEEncoderPoP), and the mask is there if your source had an alpha channel you want to use for inpainting or compositing.
How to install it
ComfyUI Manager: search "comfy_PoP", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/picturesonpictures/comfy_PoP
No extra dependencies and nothing to download - this leans on the same image libraries ComfyUI's own LoadImage already uses.
Common issues & troubleshooting
Your file isn't in the dropdown. Same rule as the standard LoadImage node: the file needs to already be in ComfyUI's input folder (or uploaded through the UI, which puts it there for you) before this node can see it.
Output size isn't quite what you expected. megapixels is a target, not an exact pixel dimension - the node solves for width/height that preserve your source aspect ratio while landing near that pixel count, so an unusually wide or tall source image will end up at different literal dimensions than a square one at the same megapixel setting.
Downstream generation still looks off despite resizing. Getting to a reasonable megapixel count helps, but it doesn't guarantee you're hitting your specific model's trained resolution or aspect-ratio buckets - SDXL, for instance, was trained on a fixed set of ratios around the 1-megapixel mark, not an arbitrary continuous range. If output quality still seems resolution-related after using this node, check your target against what your specific checkpoint was actually trained at.
Mask output looks empty or unused. That's expected for any source image without an alpha channel - most JPEGs and plenty of PNGs won't have one, so an empty mask coming out is normal, not a sign the node malfunctioned.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| megapixels | FLOAT | 1.000.01–64 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |