Precision dimension control nodes for aspect ratio adjustments and resizing workflows
image_aspect_ratio_extractor- Extract aspect ratios with constraints (0.25-4.0 range)image_resolution_extractor- Extract specific dimensions (width, height, shortest/longest side)calculate_aspect_ratio_extension- Compute pixel extensions for target aspect ratioscalculate_upscale_factor- Determine optimal scaling ratioscalculate_upscale_rounds- Calculate iteration count for multi-stage upscaling
smart_image_resize- Intelligent resizing with min/max constraints, model-based upscaling, reference ratio matching, and standard ratio paddingresize_to_multiple- Resize images to multiples of specified numbers (stretch/crop)image_crop_by_percentage- Precision cropping with percentage/pixel controlsmask_crop_by_percentage- Synchronized mask cropping with detection modesextend_canvas_by_percentage- Expand canvas with color fill and featheringapply_mask_to_image- Apply mask as alpha channel (black mask areas become transparent)
- Mathematical Precision - Pixel-perfect calculations with rounding control
- Dual Measurement Modes - Seamless percentage ↔ pixel conversion
- Non-Destructive Workflow - All operations preserve source data
- Advanced Detection - Mask-based cropping with multiple detection algorithms
-
Clone to your ComfyUI
custom_nodesdirectory:ComfyUI/custom_nodes/image-resizing/ -
Restart ComfyUI
- Aspect Ratio Extractor: Extracts ratios with constraints, supports rounding to common ratios
- Resolution Extractor: Extracts width, height, shortest, or longest side dimensions
- Aspect Ratio Extension: Calculates pixel extensions needed for target aspect ratios
- Upscale Factor: Determines optimal scaling ratios between source/target dimensions
- Upscale Rounds: Calculates iteration count for multi-stage upscaling workflows
- Smart Image Resize: Intelligent image resizing with min/max resolution constraints, reference ratio matching, model-based or basic upscaling, and standard ratio padding
- Resize to Multiple: Resizes images to multiples of specified numbers (32, 64, etc.)
- Image Crop by Percentage: Precision cropping with 9 position options and offset controls
- Mask Crop by Percentage: Advanced mask-based cropping with detection algorithms
- Extend Canvas by Percentage: Expands canvas with color fill, feathering, and mask support
- Apply Mask to Image: Combines image + mask into RGBA output, using mask as transparency (white=opaque, black=transparent)
- Percentage crop semantics:
left/right/top/bottompercentages are defined over each side's half-axis (100reaches the center from that side). - Input limits by mode: with
use_pixel=true, crop values are not upper-bounded; withuse_pixel=false, crop inputs are clamped to0-100.
- Adapting assets for specific aspect ratios
- Matching images to reference aspect ratios without cropping
- Creating social media templates
- Matching AI model input requirements
- Batch canvas extensions and cropping
- Multi-stage upscale preparations
- ComfyUI
- Standard ComfyUI dependencies
This project is provided as-is for the ComfyUI community.