Nodes/ComfyUI-PixelConstrainedScaler/Pixel Constrained Scaler
ComfyUI Node

Pixel Constrained Scaler

A ComfyUI node in image/resolution with 6 inputs and 5 outputs.

By neonr-0·Created 9 months ago·Updated 9 months ago· 1
Pixel Constrained Scaler
  • image
  • image_passthrough
  • constrained_width
  • constrained_height
  • constrained_aspect_ratio
  • original_aspect_ratio
min_res256
max_res2048
max_megapixels2.4
scaling_factor1.5
multiple_of8
Categoryimage/resolution

Inputs (6)

NameTypeDefaultDescription
imageIMAGEInput image to analyze for resolution constraints
min_resINT256Minimum allowed dimension (width/height) in pixels
max_resINT2048256–8192Maximum allowed dimension (width/height) in pixels
max_megapixelsFLOAT2.4Maximum allowed resolution in megapixels (e.g., 2.3 = 2.3 million pixels)
scaling_factorFLOAT1.50.1–4Additional scaling factor (1.0 = no change, 2.0 = double size). Megapixel limit takes priority when original image is larger than the cap.
multiple_ofINT8Ensure dimensions are multiples of this number (8, 64, etc)

Outputs (5)

NameTypeDescription
image_passthroughIMAGE
constrained_widthINT
constrained_heightINT
constrained_aspect_ratioFLOAT
original_aspect_ratioFLOAT