KJNodes/latentsgenerated

Empty Latent Image Presets(EmptyLatentImagePresets)

This node technically extracts width and height values by parsing the user-selected preset string, and calls ComfyUI's built-in `EmptyLatentImage` function to generate a latent noise tensor of the specified dimensions and batch size.

Empty Latent Image Presets

Latent
Width
Height
dimensions
512 x 512 (1:1)
invert
batch_size
1
KJNodes

The Empty Latent Image Presets node technically extracts width and height values by parsing the user-selected preset string and calls ComfyUI's built-in EmptyLatentImage function to generate a latent noise tensor of the specified dimensions and batch size.

Empty Latent Image Presets is a preset node for generating empty latent images. It allows users to quickly select from a set of predefined image dimensions and aspect ratios, simplifying the creation of the initial latent space in a workflow. This node serves as a convenient starting point for initiating the image generation process.

Node Functionality

Technically, this node extracts width and height values by parsing the user-selected preset string and calls ComfyUI's built-in EmptyLatentImage function to generate a latent noise tensor of the specified dimensions and batch size. It supports various common image resolutions (512x512, 768x512, 960x512, 1024x512, 1024x576, 1536x640, 1344x768, 1216x832, 1152x896, 1024x1024) and provides an option to swap the aspect ratio to accommodate different generation needs.

Node Parameter Description - Empty Latent Image Presets

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
dimensionsCOMBOYes512 x 512 (1:1)512 x 512 (1:1), 768 x 512 (1.5:1), 960 x 512 (1.875:1), 1024 x 512 (2:1), 1024 x 576 (1.778:1), 1536 x 640 (2.4:1), 1344 x 768 (1.75:1), 1216 x 832 (1.46:1), 1152 x 896 (1.286:1), 1024 x 1024 (1:1): Select the preset image dimensions and aspect ratio. Options: 512x512 (1:1), 768x512 (1.5:1), 960x512 (1.875:1), 1024x512 (2:1), 1024x576 (1.778:1), 1536x640 (2.4:1), 1344x768 (1.75:1), 1216x832 (1.46:1), 1152x896 (1.286:1), 1024x1024 (1:1).
invertBOOLEANYesFalse-: Boolean value. When True, swaps the width and height values of the selected preset.
batch_sizeINTYes11 - 4096: Sets the number of latent image batches to generate, with a valid range from 1 to 4096.

Output

Parameter NameData TypeDescription
LatentLATENT: The output empty latent noise tensor, used for subsequent image generation.
WidthINT: The pixel width value corresponding to the selected preset.
HeightINT: The pixel height value corresponding to the selected preset.

Usage Scenarios

This node is very useful when building an image generation workflow that requires a fixed output size. For example, when creating social media banners or artwork with specific aspect ratios, you can directly select a preset like "1024 x 576 (1.778:1)" without needing to manually connect two separate numerical nodes to set the width and height, thereby improving workflow construction efficiency.

Notes

Please note that this node generates an empty latent image (i.e., random noise). It needs to be connected to a sampler node like KSampler and combined with prompts to generate the final image. The output dimension information can be used by subsequent nodes that require knowledge of the image resolution (such as ControlNet preprocessors or image save nodes).

The Empty Latent Image Presets node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…