LongCat Image Resizer
Get reference images into LongCat's aspect buckets without mangling them
- image
- image
- width
- height
LongCat wasn't trained on any old resolution. It was trained on a fixed set of aspect-ratio buckets - the MULTI_ASPECT_RATIO tables in the model code, grouped around 1024, 512, and 256-pixel bases. Feed it something off-bucket and you get the usual soft degradation, worse composition, occasionally doubled anatomy. LongCatImageResizer is the fix: it snaps an image to the nearest supported size before it ever hits the model.
This matters most in the edit flow. TextEncodeLongCatImageEdit hands reference images to the sampler, which encodes them into latents and denoises around them - so the reference's size needs to match a bucket for the whole pipeline to behave. This node is how you get there.
It takes an image, a method, and an interpolation:
- method -
keep proportion(default-friendly) finds the bucket with the closest aspect ratio and resizes into it;stretchforce-fits, distorting if the aspect differs;fill/cropscales to cover then center-crops;padscales to fit and letterboxes with black. - interpolation -
nearest,bilinear,bicubic, orlanczos. For anything you're going to actually edit or regenerate,lanczosis the one you want; the others are there for pixel-art style hard edges.
It returns three things: the resized image, plus width and height as ints. Those int outputs are genuinely useful - wire them into a text node or a LongCatSizePicker so the rest of the graph agrees on the dimensions you ended up with.
Which method should you reach for? For most reference photos, keep proportion - it picks the closest aspect bucket so the crop is minimal. pad is the safe choice when you can't afford to lose edges but don't mind black bars. fill/crop only makes sense when the center is what matters. Skip stretch unless you're deliberately testing what distortion does.
It lives in the pack purely as a utility - there's no model loading or sampling here, so it's the one node in the LongCat set that can't really break your workflow. Point it at an image, pick a method, and wire the output into the edit encoder.
A note for the workflow as a whole: this plugin is an early port of LongCat (a model family with no native ComfyUI support), and it's rough around the edges - one commit, a README with a lot of roadmap. But the resizer is the most self-contained piece of it, and it's a reasonable thing to drop into any LongCat graph you're assembling until the pack matures.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| method | COMBO | 4 options: keep proportion, stretch, fill/crop, pad | |
| interpolation | COMBO | 4 options: nearest, bilinear, bicubic, lanczos |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |