Tools for scaling images and latents appropriate to SD3 in ComfyUI.
Tools for scaling images and latents appropriate to SD3 in ComfyUI
This custom node is a wrapper for the builtin ImageScaleToTotalPixels that works within the desired constraint of SD3 to operate on images whose width and height are divisible by 64.
Generally only use this node when scaling an input image intended to be passed to a sampler (img2img) as the SD3-specific resolution only applies to sampler inputs.
Inputs:
upscale_method
—(inherited from ImageScaleToTotalPixels
) see ComfyUI docsmegapixels
—(inherited from ImageScaleToTotalPixels
) the desired total megapixels of the resulting image, see belowOutputs:
image
—The scaled imageSD3 wants input latents that have width and height divisible by 64. To meet this requirement, when scaling to a specific megapixel resolution, the resulting width and height are checked and reduced to the nearest value that is divisible by 64.
Because no cropping is performed, some stretching may occur if either dimension needs to be reduced. Since you should be working at at least the megapixel range for your input image with SD3, this probably won't be noticable, but you should be aware that this will occcur.