Nodes/ComfyUI-DSD/DSD Resize Selector
ComfyUI Node

DSD Resize Selector

Controls how your subject photo gets squeezed into DSD's reference slot

By irreveloper·Created about a year ago·Updated about a year ago· 42
DSD Resize Selector
    • resize_params
    resize_methodresize_and_center_crop
    interpolationLANCZOS
    pad_r0
    pad_g0
    pad_b0

    The DSD Image Generator needs your subject photo at a specific shape to use as its reference condition, and your photo almost certainly isn't that shape. This node is where you decide how that mismatch gets resolved. It outputs a resize_params object that you feed into the generator's optional resize_params input - it has no other purpose, and it only matters because the generator is otherwise stuck with its default behavior.

    The four methods

    • resize_and_center_crop (default) - scales the image to cover the target shape, then crops the center. Your subject stays the same aspect ratio, but edges get chopped. Good default for portraits where the face is centered.
    • center_crop - the same idea with a slightly different path: only upscales if the image is smaller than the target, then center-crops. For most inputs it lands near the first option; keep it in mind if you're feeding small images.
    • pad - preserves the whole image, aspect ratio intact, and letterboxes the rest with the pad_r/pad_g/pad_b color (RGB, 0–255, black by default). The one to pick when cropping would cut off the subject - say, a full body or a product with surrounding context you need.
    • fit - stretches to the exact target size, no crop, no padding. This distorts the subject, and it's almost never what you want for identity preservation. It's there for completeness.

    interpolation sets the resampling filter - LANCZOS is the default and the highest quality; BICUBIC and BILINEAR are lighter; NEAREST is blocky and pointless here. One honest caveat from the source: the default resize_and_center_crop path is hardcoded to BILINEAR internally, so your interpolation choice only actually takes effect with the other three methods.

    When to actually use this node

    Straight answer: only when the default doesn't fit your image. If you don't connect it, the generator uses resize_and_center_crop anyway, so adding this node with all defaults is a no-op that just documents your workflow. Where it earns its place: portrait crops where you'd rather pad with white than crop a forehead, or product shots where the whole item must survive. The pad_r/g/b fields only do anything in pad mode, so ignore them otherwise.

    Build it as: Load Image → Resize Selector (resize_params) → Image Generator. If your subject is getting truncated or warped, this node - not the generator's width/height - is the lever you're looking for.

    CategoryDSD

    Inputs (5)

    NameTypeDefaultDescription
    resize_methodCOMBOresize_and_center_crop4 options: resize_and_center_crop, center_crop, pad, fit
    interpolationCOMBOLANCZOS4 options: LANCZOS, BICUBIC, BILINEAR, NEAREST
    pad_rINT00–255
    pad_gINT00–255
    pad_bINT00–255

    Outputs (1)

    NameTypeDescription
    resize_paramsRESIZE_PARAMS