Scale Polygon
Stretch or squash a panel — independently on each axis
- polygon
- origin
- POLYGON
Scale Polygon resizes a panel polygon, and the thing that separates it from a plain "resize" node is that the X and Y factors are independent. You can stretch a panel wide without touching its height, or squash it flat - which is exactly the freedom you want when you're sculpting a page from the raw cut layout the generators produce.
It's a thin wrapper around shapely's affine scale, so the result is exact vector geometry: no resampling, no quality loss, and the output polygon plugs straight into the mask, crop, and paste nodes downstream. This is the same family as Rotate Polygon and Skew Polygon, and together they're the toolkit for turning an abstract layout into panels that actually fit your story beats.
The inputs:
- polygon - the panel to scale.
- xfact / yfact - scale factors on each axis, -10 to 10, default 1 (no change). 2 doubles, 0.5 halves. Negative values mirror that axis - a sneaky extra feature: scale by -1 on X to flip a panel left-right, which is handy for RTL page work.
- origin (optional) - the pivot, a POLY_3O value from the origin nodes. Unconnected, it scales around the panel's center; scale around a vertex and the panel grows away from that corner like it's anchored there.
The typical move: scale a panel larger than its neighbors to make it the visual anchor of the page - the splash panel. Scale it asymmetrically (say xfact 1.3, yfact 1.0) to lengthen a panel without changing its vertical rhythm, which keeps the row gutters aligned even as the panel gets more presence. Because it's per-axis, it's also how you correct a panel that's the wrong aspect ratio for the art you want to put in it.
One thing to keep an eye on: independent X/Y scaling changes aspect ratio, and if you scale so far that the polygon's area balloons past the canvas, it will overlap neighbors or stick off the page. The pack won't stop you - it's your composition, your problem. And if you're feeding the scaled polygon into Polygon To Resized Mask for paste-back, remember the scale output of that node reflects the mask's own resizing, not your manual scaling here; the geometry stays consistent as long as the polygon is what flows through the chain.
The workflow pattern is the same as its siblings: build panels → scale/rotate/skew each one → Preview Panels to check → masks and paste. Keep the polygon flowing through untouched and everything downstream agrees.
Installing
Part of comfyui-panels by bmad4ever. Via ComfyUI Manager (search "comfyui-panels") and restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_panels
Deps: shapely, matplotlib, opencv-python - no models, no GPU. Shapely is pinned exactly; version clashes with other packs are the realistic import failure.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| polygon | POLYGON | — | |
| xfact | FLOAT | 1.000-10–10 | — |
| yfact | FLOAT | 1.000-10–10 | — |
| originopt | POLY_3O | The origin point used for the operation. If none provided, the 'center' option is used. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| POLYGON | POLYGON | — |