abyz22_Padding Image
Zoom-and-pad data augmentation with pose baked in
- image
- conditioning
- vae
- image
- pose_image
- conditioning
- latent
This is the pack's "Resize Image (zoom in/out)" node, and it does a lot more than the name suggests. You hand it an image, a conditioning, a VAE, and a ControlNet; it resizes your image by a random factor between two ratios, pads (or crops) it back to the original canvas, computes the pose of whatever's in the frame, and hands back the padded image, the pose skeleton, a conditioning with that pose ControlNet already applied, and the latent. One queue roll and you get a "zoomed differently" variant with the pose conditioning kept honest.
It's from abyz22/image_control, the Impact Pack fork. In that world the pattern is obvious - "Change Breast," "Resize Head," "Showing only 1 breast" all want the subject re-framed without the body breaking - but as a pure data-augmentation tool it's also solid for training sets, which is exactly what the random zoom/pad/placement variety is for.
Inputs that matter
image,conditioning,vae- the usual trio.control_net_name- picked from yourmodels/controlnetfolder; openpose works best since the node generates a pose image.pose_strength(0–10, default 1) - ControlNet weight on the applied pose.pad_mode-constant(solid border),replicate(stretch edge pixels), ornoise(random static in the padding).mode_type- where the resized image sits: Top-Left through Center to Bottom-Right, orRandomper frame.Ratio_min/Ratio_max(0.3–2.5) - the random zoom factor range. Below 1 zooms out (pads), above 1 zooms in (crops).seed- drives the placement/zoom roll.
Outputs: image, pose_image, conditioning (with ControlNet applied), latent - everything downstream needs in one shot.
How it works
It resizes per frame by a random ratio, places the result on the canvas per mode_type, and fills the leftover with your pad_mode. It detects pose through DWPreprocessor (from ComfyUI's ControlNet Aux Preprocessors - that pack must be installed or this node fails), resizes the pose skeleton to match, then loads the ControlNet and applies it to your conditioning with pose_strength. Finally it VAE-encodes to latent. The careful bit: when Ratio_min and Ratio_max are both ~1, it skips the whole dance and just encodes - a nice passthrough that keeps the node safe in non-augmentation pipelines.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/abyz22/image_control
or ComfyUI Manager → "image_control", restart, and install ComfyUI ControlNet Aux Preprocessors alongside. Pack requirements add openpyxl, pytorch-lightning, kornia.
Where it bites
The DWPreprocessor dependency is the big one - if the node dies with a missing-mapping error, install ControlNet Aux. Watch the canvas math: Ratio_max above ~2 with a mode_type near the edges can crop so much of the subject out that the pose ControlNet fights the composition. And because the zoom factor is random per frame, batch output is deliberately inconsistent - that's the point for augmentation, but don't expect frame-to-frame continuity if you're trying to use it for something steady.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| conditioning | CONDITIONING | — | |
| vae | VAE | — | |
| control_net_name | COMBO | 0 options: | |
| pose_strength | FLOAT | 1.000–10 | — |
| pad_mode | COMBO | 3 options: constant, replicate, noise | |
| mode_type | COMBO | 10 options: Top-Left, Top, Top-Right, Center-Left, Center, Center-Right, +4 | |
| Ratio_min | FLOAT | 0.50.3–2.5 | — |
| Ratio_max | FLOAT | 1.50.3–2.5 | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| pose_image | IMAGE | — |
| conditioning | CONDITIONING | — |
| latent | LATENT | — |