Nodes/ComfyUI-Pixaroma/Longest Side Pixaroma
ComfyUI Node

Longest Side Pixaroma

Scale an image so its longest side is the size you pick, and optionally crop it to a shape on the way. Pick a size from the tabs (864, 1024, 1216 and so on) and the longer edge of the picture becomes exactly that, with the other edge following so nothing is squashed. It works the same for a tall photo or a wide one, so you never have to decide whether you mean width or height. The shape chips underneath crop the picture first. Keep leaves the shape alone and simply scales it. Pick 1:1, 16:9, 9:16 or any other shape and the biggest piece of that shape is taken from the middle of your picture, so nothing stretches and no empty bars appear. Which sizes and shapes appear, plus where the crop is taken from, are all in the settings behind the gear. The small button at the top steps through Off, 8, 16, 32 and 64, and rounds both sides to that step, because most models want sizes in steps like these. Outputs the finished image plus its width and height, ready to wire into a sampler.

By pixaroma·Created 5 months ago·Updated about 16 hours ago· 333
Longest Side Pixaroma
  • image
  • image
  • width
  • height
Category👑 Pixaroma/✂️ Resize & Crop

Inputs (1)

NameTypeDefaultDescription
imageIMAGEThe picture to resize. Its longer edge becomes the size you picked on the node.

Outputs (3)

NameTypeDescription
imageIMAGEThe resized picture, cropped first if you picked a shape other than keep.
widthINTThe finished width in pixels, already rounded to the step if one is set.
heightINTThe finished height in pixels, already rounded to the step if one is set.