Nodes/Fens-Simple-Nodes/Optimal Empty Latent (Advanced)
ComfyUI Node

Optimal Empty Latent (Advanced)

Choose optimal WxH for a given aspect ratio & MP target. Supports exact resolution input when optimized resolution is disabled.

By Taithrah·Created about a year ago·Updated about a month ago· 6
Optimal Empty Latent (Advanced)
    • Latent
    • Width
    • Height
    • Block Size
    • Details
    dimensions1:1
    latent_alignmentSDXL (1024px)
    optimizationtrue
    invertfalse
    batch_size1
    block_size64
    spacial_downscale_ratio8
    target_mp1.000
    search_range12
    channels4
    CategoryFens_Simple_Nodes/Latent

    Inputs (10)

    NameTypeDefaultDescription
    dimensionsSTRING1:1Formats: W:H (e.g. 16:9), WxH (e.g. 1280x720), or decimal (e.g. 1.777). Use WxH when 'Optimization' is FALSE.
    latent_alignmentCOMBOSDXL (1024px)Optimization preset for model type. Select 'Custom' to set your own parameters.
    optimizationBOOLEANtrueTRUE: Automatically calculates best resolution for your aspect ratio. FALSE: Use your own resolution (WxH format).
    invertBOOLEANfalseSwap width and height (invert aspect ratio, e.g. 16:9 > 9:16).
    batch_sizeINT11–4096Number of latent images in batch (VRAM usage increases with batch size).
    block_sizeINT648–64Pixel dimension alignment constraint. (Only used when 'Custom' is selected.)
    spacial_downscale_ratioINT88–64The VAE's total downsampling factor. (Only used when 'Custom' is selected.)
    target_mpFLOAT1.0000.05–32Target megapixels. (Only used when 'Custom' is selected.)
    search_rangeINT121–100Search range for optimization. Higher values search more possibilities. (Only used when 'Custom' is selected.)
    channelsINT41–128Latent channel count (e.g. 4 for SD1/SDXL, 16 for FLUX/Cosmos-Predict2-family). (Only used when 'Custom' is selected.)

    Outputs (5)

    NameTypeDescription
    LatentLATENTLatent tensor
    WidthINTWidth
    HeightINTHeight
    Block SizeINTBlock size used for the calculation.
    DetailsSTRINGDetails about the calculation