A versatile node for generating empty latent tensors with support for SD3.5, SDXL, and Flux models. This node offers extensive aspect ratio support, batch processing, and flexible dimension overrides, ensuring optimal performance across different model types.
"1024x1024 (1:1)")1)4)The node returns:
[batch_size, 4, height // 8, width // 8], representing empty latent samples ready for further processing.Here’s an example of how to use this node programmatically:
import torch
from ComfyUI-SD3.5-Latent-Size-Picker.sd3_5_empty_latent import SD3_5EmptyLatent
# Initialize the SD3_5EmptyLatent node
latent_picker = SD3_5EmptyLatent()
# Set parameters
resolution = "1024x1024 (1.0)"
batch_size = 2
width_override = 768
height_override = 0
invert_ratios = "No"
# Execute to generate the latent tensor
latent_output, width, height = latent_picker.execute(
resolution=resolution,
batch_size=batch_size,
width_override=width_override,
height_override=height_override,
invert_ratios=invert_ratios
)
print(f"Latent Shape: {latent_output['samples'].shape}, Width: {width}, Height: {height}")
To use this node in ComfyUI:
custom_nodes folder in ComfyUI:“`bash
git clone https://github.com/mithamunda/ComfyUI-SD3.5-Latent-Size-Picker.git
“`
This code is released under the MIT License, allowing for free use, distribution, and modification. See the LICENSE file for more details.