ComfyUI > Nodes > TrentNodes > Latent-Aligned Mask (with VAE)

ComfyUI Node: Latent-Aligned Mask (with VAE)

Class Name

LatentAlignedMask

Category
Trent/Masks
Author
TrentHunter82 (Account age: 0days)
Extension
TrentNodes
Latest Updated
2026-03-20
Github Stars
0.03K

How to Install TrentNodes

Install this extension via the ComfyUI Manager by searching for TrentNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter TrentNodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Latent-Aligned Mask (with VAE) Description

Aligns masks in latent space for precise, refined AI art workflows without a VAE.

Latent-Aligned Mask (with VAE):

The LatentAlignedMask node is designed to process and align masks within the latent space, providing a seamless integration with latent variable models without the need for a Variational Autoencoder (VAE). This node is particularly beneficial for AI artists who wish to manipulate and refine masks in a way that aligns with the underlying latent representations of their models. By aligning masks to the latent space, this node ensures that the masks are more accurately represented and can be used effectively in further processing or generation tasks. The main goal of the LatentAlignedMask is to enhance the precision and usability of masks in AI art workflows, allowing for more controlled and refined outputs.

Latent-Aligned Mask (with VAE) Input Parameters:

mask

The mask parameter is the primary input for the node, representing the initial mask that you wish to align with the latent space. This mask serves as the basis for the alignment process, and its quality and detail can significantly impact the final aligned mask. There are no specific minimum or maximum values for this parameter, as it is dependent on the resolution and detail of the input mask you provide.

compression_factor

The compression_factor parameter determines the level of compression applied to the mask during the alignment process. A higher compression factor can lead to a more compact representation, which may be beneficial for certain applications where storage or processing efficiency is a concern. The default value is 8, and it can be adjusted based on your specific needs.

expansion_pixels

The expansion_pixels parameter controls the number of pixels by which the mask is expanded during the alignment process. This expansion helps to ensure that the mask covers the necessary areas in the latent space, preventing any potential loss of detail. The default value is 8 pixels, but you can adjust this to achieve the desired level of coverage.

blur_latent_units

The blur_latent_units parameter specifies the amount of blurring applied to the mask in the latent space. Blurring can help to smooth out any harsh edges or transitions, resulting in a more natural and visually appealing mask. The default value is 1 latent unit, and you can increase or decrease this value to achieve the desired level of smoothness.

threshold

The threshold parameter sets the cutoff value for determining which areas of the mask are considered active or inactive. A higher threshold can result in a more conservative mask, while a lower threshold may include more areas. The default value is 0.5, and you can adjust this to fine-tune the sensitivity of the mask alignment process.

Latent-Aligned Mask (with VAE) Output Parameters:

aligned_mask

The aligned_mask output is the result of the alignment process, providing a mask that is accurately aligned with the latent space. This output is crucial for ensuring that the mask can be effectively used in subsequent processing or generation tasks, as it reflects the underlying latent representations more accurately.

latent_preview

The latent_preview output offers a visual representation of the mask within the latent space, allowing you to preview how the mask aligns with the latent variables. This preview can be invaluable for assessing the quality and accuracy of the alignment, helping you to make any necessary adjustments to the input parameters.

Latent-Aligned Mask (with VAE) Usage Tips:

  • Experiment with the compression_factor to balance between processing efficiency and detail retention, especially if working with large masks.
  • Use the expansion_pixels parameter to ensure that your mask covers all necessary areas, particularly if you notice any loss of detail in the aligned mask.
  • Adjust the blur_latent_units to achieve a smoother transition in your masks, which can be particularly useful for creating more natural-looking outputs.
  • Fine-tune the threshold to control the sensitivity of the mask alignment, ensuring that you capture all relevant areas without including unnecessary regions.

Latent-Aligned Mask (with VAE) Common Errors and Solutions:

"Invalid mask input"

  • Explanation: This error occurs when the input mask is not in a compatible format or is corrupted.
  • Solution: Ensure that the mask is in a supported format and is not corrupted. Try reloading or re-exporting the mask from your source application.

"Compression factor out of range"

  • Explanation: The specified compression_factor is outside the acceptable range for the node.
  • Solution: Adjust the compression_factor to a value within the recommended range, typically between 1 and 16, to ensure proper processing.

"Threshold value invalid"

  • Explanation: The threshold parameter is set to a value that is not supported by the node.
  • Solution: Ensure that the threshold is set between 0 and 1, as values outside this range may cause unexpected behavior.

Latent-Aligned Mask (with VAE) Related Nodes

Go back to the extension to check out more related nodes.
TrentNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Latent-Aligned Mask (with VAE)