Nodes/ComfyUI-ArchAi3d-Qwen/πŸ“ Qwen Image Scale
ComfyUI Node

πŸ“ Qwen Image Scale

A ComfyUI node in ArchAi3d/Qwen/Image with 19 inputs and 6 outputs.

By amir84ferdosΒ·Created 10 months agoΒ·Updated 4 months agoΒ· 65
πŸ“ Qwen Image Scale
  • image
  • mask
  • image_vl
  • image_latent
  • mask
  • latent_width
  • latent_height
  • debug_text
β—„aspect_ratio_modeautoβ–Ί
β—„preferred_aspect_ratio16:9 (Panorama)β–Ί
β—„vl_target_area147456β–Ί
β—„vl_divisible_by32β–Ί
β—„latent_target_area1763584β–Ί
β—„latent_divisible_by32β–Ί
β—„latent_area_tolerance0.30β–Ί
β—„vl_use_latent_sourcetrueβ–Ί
β—„vl_ignore_latent_letterboxtrueβ–Ί
β—„vl_ignore_latent_croptrueβ–Ί
β—„vl_upscale_methodareaβ–Ί
β—„vl_cropdisabledβ–Ί
β—„vl_letterboxfalseβ–Ί
β—„latent_upscale_methodlanczosβ–Ί
β—„latent_cropcenterβ–Ί
β—„latent_letterboxfalseβ–Ί
β—„debugtrueβ–Ί
CategoryArchAi3d/Qwen/Image

Inputs (19)

NameTypeDefaultDescription
imageIMAGEβ€”
aspect_ratio_modeoptCOMBOautoAuto: Automatically find closest preferred aspect ratio to input image. Manual: Choose specific preferred ratio (ignores input aspect).
preferred_aspect_ratiooptCOMBO16:9 (Panorama)Manually select preferred aspect ratio (only used in manual mode). These ratios are optimized for QwenVL's training data.
vl_target_areaoptINT1474563000–500000Target pixel area for QwenVL output (e.g., 147456 = ~147K = 384Γ—384). VL dimensions are calculated using preferred aspect ratio to match QwenVL's optimal training ratios. QwenVL works best with ~150K pixels.
vl_divisible_byoptINT321–256Ensures VL width and height are divisible by this number. Recommended: 32 for optimal AI processing.
latent_target_areaoptINT17635843000–4500000Target pixel area for latent output (e.g., 1048576 = ~1M = ~1024Γ—1024). Latent dimensions will EXACTLY match VL's preferred aspect ratio while staying within tolerance range. Higher = better quality but slower.
latent_divisible_byoptINT321–256Ensures latent width and height are divisible by this number. Recommended: 32 for VAE compatibility. Must achieve exact aspect match with VL.
latent_area_toleranceoptFLOAT0.300.1–0.8Flexibility for latent pixel count (Β±%). Default 0.3 = Β±30%, allowing 700K-1.3M when target is 1M. Gives algorithm room to find dimensions that EXACTLY match VL aspect ratio while meeting divisibility constraints. Higher tolerance = easier to find perfect aspect match.
vl_use_latent_sourceoptBOOLEANtrueVL source selection. True (recommended): Use processed Latent as source for pixel-perfect alignment and guaranteed aspect match. False: Use original Input for traditional independent processing.
vl_ignore_latent_letterboxoptBOOLEANtrueWhen using Latent source, ignore vl_letterbox setting. Latent is already letterboxed if needed, prevents double padding.
vl_ignore_latent_cropoptBOOLEANtrueWhen using Latent source, ignore vl_crop setting. Latent is already cropped if needed, prevents double cropping.
vl_upscale_methodoptCOMBOareaResampling algorithm for VL. Area=best for downscaling (sharp), Lanczos=best for upscaling (smooth). Default 'area' optimal since VL is typically downscaled.
vl_cropoptCOMBOdisabledHow to handle aspect ratio mismatch. Usually keep disabled as VL aspect matches Latent exactly. NOTE: Ignored when vl_use_latent_source=True and vl_ignore_latent_crop=True.
vl_letterboxoptBOOLEANfalseAdd black bars to preserve exact aspect ratio. Usually keep disabled as VL aspect matches Latent exactly. NOTE: Ignored when vl_use_latent_source=True and vl_ignore_latent_letterbox=True.
latent_upscale_methodoptCOMBOlanczosResampling algorithm for latent. Lanczos=best for upscaling (smooth, high quality), Area=best for downscaling (sharp). Default 'lanczos' optimal since latent is usually upscaled.
latent_cropoptCOMBOcenterHow to handle aspect ratio mismatch for latent. Center (recommended): Crops input image to fill latent frame completely with preferred aspect ratio. Disabled: Stretches to fit (may distort).
latent_letterboxoptBOOLEANfalseAdd black bars to latent instead of cropping. Enable to preserve entire input image with preferred aspect ratio.
debugoptBOOLEANtrueShow detailed info: aspect ratio selection (auto/manual), preferred ratio match quality, dimensions, tolerance checks, and pixel alignment status.
maskoptMASKOptional mask to scale alongside image_latent. Will be resized to match latent dimensions using bilinear interpolation.

Outputs (6)

NameTypeDescription
image_vlIMAGEβ€”
image_latentIMAGEβ€”
maskMASKβ€”
latent_widthINTβ€”
latent_heightINTβ€”
debug_textSTRINGβ€”