Nodes/Comfyui Krs Nodes/Qwen Image Edit Latent Krs
ComfyUI Node

Qwen Image Edit Latent Krs

A ComfyUI node in utils with 22 inputs and 4 outputs.

By KursatAs·Created 10 months ago·Updated 9 months ago· 0
Qwen Image Edit Latent Krs
  • image
  • model
  • vae
  • preview
  • latent
  • viz_image
  • padded_image
width_latent1024
height_latent1024
locked_axiswidth
snap_modemultiple_of_16
use_exact_input_dimsfalse
use_target_megapixelsfalse
target_megapixels1.00
fit_modepad_only
snap_strategynearest
background_colorgray
latent_scale8
latent_channels4
latent_modezeros
latent_seed-1
upscale_methodlanczos
cropcenter
force_5dfalse
normalize_modenone
pad_plus_2false
Categoryutils

Inputs (22)

NameTypeDefaultDescription
imageIMAGEThe input image tensor to snap dimensions and process.
width_latentINT102416–4096Desired output width in pixels. Snapped to valid values based on snap_mode.
height_latentINT102416–4096Desired output height in pixels. Snapped to valid values based on snap_mode.
locked_axisCOMBOwidthWhich axis to lock when snapping dimensions. 'independent' allows both to snap separately.
snap_modeCOMBOmultiple_of_16How to snap dimensions: multiples of 16, 32, 64, or powers of 2 divisible by 16.
use_exact_input_dimsBOOLEANfalseIf enabled, use exact input dimensions without snapping.
use_target_megapixelsBOOLEANfalseIf enabled, snap dimensions to match the target megapixels instead of user width/height.
target_megapixelsFLOAT1.000.1–8Target total megapixels for the output image when use_target_megapixels is enabled.
fit_modeCOMBOpad_onlyHow to fit the image: pad only (no cropping) or allow cropping to match snapped dimensions.
snap_strategyCOMBOnearestStrategy for snapping: round up, down, or to nearest valid value.
background_colorCOMBOgrayBackground color for padding areas: black, gray, or white.
latent_scaleCOMBO8Downscale factor for latent space, typically 8 for SD1.5 or 16 for SDXL.
latent_channelsINT41–32Number of channels in the latent tensor. Auto-detected from model if provided.
latent_modeCOMBOzerosHow to initialize the custom latent: all zeros or random noise.
latent_seedINT-1-1–2147483647Seed for random latent generation. -1 for random seed.
upscale_methodCOMBOlanczosInterpolation method for upscaling the image.
cropCOMBOcenterCropping method during upscaling: disabled or center crop.
force_5dBOOLEANfalseForce 5D tensor for VAE encoding (for specific models like SVD).
normalize_modeCOMBOnoneNormalization mode for VAE input: [-1,1], [0,1], or none.
pad_plus_2BOOLEANfalseAdd 2 pixels padding to VAE input (for specific requirements).
modeloptMODELOptional model to auto-detect latent channels from.
vaeoptVAEOptional VAE for encoding the image into latent space. If provided, switches output to VAE latent.

Outputs (4)

NameTypeDescription
previewSTRING
latentLATENT
viz_imageIMAGE
padded_imageIMAGE