Resize Image for SDXL (Mikey)
Fit any image into SDXL's 1024² budget for img2img
- image
- IMAGE
Feed SDXL an image at some arbitrary resolution - a phone photo, a screenshot, whatever you're doing img2img on - and you're fighting the model before you've even started. SDXL was trained at 1024x1024 and a handful of nearby aspect ratios; push it something wildly off that and you get the classic symptoms: duplicated anatomy, tiling artifacts, stretched proportions. This node exists to fix that up front, before your image ever reaches a sampler.
How it works
It's a resize node scoped specifically to SDXL's native resolution budget: give it an image at any size, and it fits it into the roughly 1024x1024 pixel area SDXL actually knows how to work with, using whichever interpolation method you pick. That's the README's own framing - "resize an image to fit into 1024x1024 resolution. Good for Img2Img workflows" - and it's a real, common gotcha the wider community runs into constantly: generating (or in this case, starting from) an image at a resolution wildly different from what the checkpoint was trained on causes duplicated anatomy and stretched or tiled results, independent of which SDXL checkpoint you're using.
The inputs and outputs that matter
image- the source image to fit.upscale_method- the interpolation algorithm:nearest-exact,bilinear,area, orbicubic.bicubicis the standard general-purpose choice for photographic content;nearest-exactis worth reaching for specifically on pixel art or hard-edged graphics where smoothing would blur detail you want kept crisp.crop-disabledorcenter.disabledfits the whole image in, preserving all of it (likely with letterboxing to hit the target aspect);centercrops to fill, trading off some of the edges of the source image for a clean fill of the target area with no bars.IMAGE(output) - the resized image, ready for a VAE Encode into an img2img pipeline.
How to install it
Bundled with the rest of Mikey Nodes. ComfyUI Manager: search "Mikey Nodes," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/bash-j/mikey_nodes
then restart. No models or extra downloads - this is pure image resizing.
Common issues & troubleshooting
Still getting stretched or duplicated results after resizing. Fitting the pixel area to roughly 1024² isn't the same as landing on one of SDXL's specific trained aspect ratios (1152x896, 1216x832, 1344x768, 1536x640, and their rotations). If your source image has an unusual aspect ratio, this node gets you into the right ballpark of total pixels, but for the cleanest results pair it with a proper aspect-ratio-aware node - this pack's own Ratio Advanced - when the exact ratio matters as much as the pixel count.
Important content getting cropped out. That's crop set to center doing its job - it fills the frame by trimming edges rather than preserving the whole source. Switch to disabled if losing any part of the original image isn't acceptable, and expect the result to not perfectly fill a square canvas in that case.
Pixel art or line art looking soft after resizing. Smoothing interpolation methods (bilinear, bicubic, area) blur hard edges. If you're working with something that needs to stay crisp, nearest-exact is the one to reach for instead - it won't blend pixels together.
This node doesn't itself fix bad img2img results. It only gets the input image to a sane resolution before sampling. Denoise strength, prompt, and model choice still do the rest of the work - a well-sized image with a badly-tuned denoise strength will still misbehave.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| upscale_method | COMBO | 4 options: nearest-exact, bilinear, area, bicubic | |
| crop | COMBO | 2 options: disabled, center |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |