SDXL Quick Image Scale (WLSH)
Resize onto SDXL's actual trained resolutions
- original
- IMAGE
SDXL wasn't trained at arbitrary resolutions - it was trained on a specific set of "bucket" sizes, all landing around one megapixel but at different aspect ratios, so the model would learn to handle more than just square images. Push an image through an SDXL-based pass (img2img, a refiner, an inpaint) at some odd resolution the model never saw during training and you're more likely to get weird artifacts or composition drift. This node's whole job is getting a source image onto one of those trained resolutions before it hits the rest of your SDXL pipeline.
How it works. resolution gives you a shortlist of SDXL's known-good sizes - 1024x1024 (1:1), 1152x896, 1216x832, 1344x768, and 1536x640, each labeled with its aspect ratio. direction (landscape/portrait) mirrors whichever one you picked, so the same five choices cover ten actual shapes without doubling the dropdown. upscale_method is the interpolation used to get there - nearest-exact, bilinear, or area, the same tradeoffs as any resize (bilinear is the safe default; area is better if you're shrinking rather than growing). crop decides what happens when your source image's aspect ratio doesn't exactly match the target: disabled stretches to fit (distorting the image if the ratios differ), center instead crops the source to match the target aspect before resizing, so you lose some edge content but keep proportions honest.
Inputs and what a beginner sets: original (your source image), upscale_method (bilinear is fine for most cases), resolution (pick whichever bucket is closest to your source's own aspect ratio to minimize distortion or cropping), direction (match your source's actual orientation). Output: a single IMAGE, resized and ready to feed into an SDXL img2img, refiner, or inpaint pass.
Installing it
ComfyUI Manager: search "wlsh_nodes" or "WLSH Nodes", install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/wallish77/wlsh_nodes, restart ComfyUI. No models needed for the resize itself.
Common issues
The thing to get right is matching resolution and direction to your source's actual shape - pick a bucket wildly different from your image's real aspect ratio with crop set to disabled and you'll stretch the image noticeably, which shows up as subtly warped proportions in anything you generate from it afterward. If that happens, either switch crop to center (accepting some cropping in exchange for correct proportions) or pick a resolution closer to your source's actual ratio. And remember this node only resizes - it doesn't add detail. If your source is small and soft, scaling it up onto an SDXL bucket size here gets you the right dimensions for the pipeline, not sharper content; that's still a separate job for a generative upscaler or the img2img pass itself.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| original | IMAGE | — | |
| upscale_method | COMBO | 3 options: nearest-exact, bilinear, area | |
| resolution | COMBO | 5 options: 1024x1024|1:1, 1152x896|9:7, 1216x832|19:13, 1344x768|7:4, 1536x640|12:5 | |
| direction | COMBO | 2 options: landscape, portrait | |
| crop | COMBO | 2 options: disabled, center |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |