Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

Available Nodes

EmptyLatentImageCustomPresets

ComfyUI Node Documentation: EmptyLatentImageCustomPresets

Overview

The EmptyLatentImageCustomPresets node in the ComfyUI KJNodes package generates empty latent images based on custom dimension presets. This node is particularly useful for users who need to work with dimensions that differ from standard options, allowing for greater flexibility in creative workflows.

Node Functionality

This node reads custom dimensions from a configuration file and creates an empty latent image that can be used as a starting point for image processing workflows in ComfyUI. By being able to select from user-defined dimensions, it allows for personalized setups tailored to specific project requirements.

Inputs

The EmptyLatentImageCustomPresets node accepts the following inputs:

  • Dimensions: A dropdown menu providing a list of dimension presets that have been defined in the 'custom_dimensions.json' file. Each option includes a label defined by the user and the corresponding dimensions in the format of width by height (e.g., "MyPreset - 1024x768").

  • Invert: A boolean toggle that, when enabled, swaps the width and height of the selected dimensions. This feature is useful when the orientation of the image needs to be quickly changed from landscape to portrait or vice versa.

  • Batch Size: An integer value specifying the number of empty latent images to generate. This allows users to create multiple images with the same settings in one operation, facilitating batch processing.

Outputs

The node outputs three values:

  • Latent: The generated empty latent image(s) based on the selected dimensions.
  • Width: The width of the generated image(s). This reflects the current dimensions after any inversion.
  • Height: The height of the generated image(s). Like the width, this reflects the dimensions after considering any inversion.

Usage in Workflows

In ComfyUI workflows, EmptyLatentImageCustomPresets can be used as a foundational step in the image generation process. It might be particularly useful in scenarios where users have unique dimension constraints that are not covered by standard presets. Incorporating this node enables users to consistently maintain these dimensions across different stages of their workflows.

A common use case might involve:

  1. Selecting a preset dimension from custom_dimensions.json tailored to a specific use case or device screen size.
  2. Generating a batch of empty latent images for iterative image processing experiments.
  3. Using the latent images as input for further processing nodes, such as those for applying styles or generating new content.

Special Features

  • Custom Configuration: The node relies on a custom_dimensions.json file, which allows users to define and manage their own set of dimension presets. This level of customization makes it a powerful tool for designers requiring specific image dimensions.

  • Orientation Control: The invert feature gives users additional flexibility by easily allowing the swapping of width and height, which can be crucial for projects involving both landscape and portrait orientations.

  • Batch Processing: The ability to specify a batch size enables the generation of multiple images at once, enhancing workflow efficiency.

In summary, the EmptyLatentImageCustomPresets node is a versatile tool in the ComfyUI ecosystem, aimed at users who need precise control over the dimensions of their image assets at the initial stages of their creative workflows.