Latent-Aligned Mask (Wan 2.1):
The LatentAlignedMaskWan node is designed to process and align masks specifically for the Wan 2.1 VAE, which utilizes an 8x spatial compression. This node is part of the Trent/Masks category and is tailored to optimize mask processing by adjusting the mask's expansion and blur parameters to fit the latent space effectively. The primary goal of this node is to ensure that masks are accurately aligned with the latent space, enhancing the quality and precision of the generated outputs. By offering preset configurations such as "tight," "standard," and "loose," it provides flexibility and ease of use, allowing you to choose the level of mask expansion and blur that best suits your artistic needs. This node is particularly beneficial for AI artists looking to maintain high fidelity in their work while leveraging the compression capabilities of the Wan 2.1 VAE.
Latent-Aligned Mask (Wan 2.1) Input Parameters:
mask
The mask parameter is the input mask that you wish to process and align with the latent space. This mask serves as the foundation for the node's operations, and its quality and characteristics will directly impact the final aligned mask output. There are no specific minimum or maximum values for this parameter, as it is dependent on the image or data you are working with.
preset
The preset parameter allows you to select from predefined configurations that determine the expansion and blur settings for the mask. The available options are "tight," "standard," "loose," and "custom." Each preset offers a different balance between expansion and blur, with "tight" providing minimal expansion and no blur, "standard" offering moderate expansion and blur, and "loose" providing maximum expansion and blur. The "custom" option allows you to specify your own values for expansion and blur. The default value is "standard."
expansion_pixels
The expansion_pixels parameter specifies the number of pixels by which the mask should be expanded in pixel space. This parameter is particularly relevant when using the "custom" preset, as it allows you to define the exact expansion level. The default value is 64 pixels, and it is divided by the compression factor to determine the expansion in latent space.
blur_pixels
The blur_pixels parameter determines the amount of blur applied to the mask in pixel space. Similar to expansion_pixels, this parameter is most relevant when using the "custom" preset. The default value is 8 pixels, and it is divided by the compression factor to calculate the blur in latent space.
Latent-Aligned Mask (Wan 2.1) Output Parameters:
aligned_mask
The aligned_mask output is the processed mask that has been aligned with the latent space. This output is crucial for ensuring that the mask fits well within the compressed latent space, maintaining the integrity and quality of the mask in the final output. The aligned mask is a refined version of the input mask, adjusted according to the selected preset or custom settings.
Latent-Aligned Mask (Wan 2.1) Usage Tips:
- To achieve the best results, choose the preset that closely matches your artistic goals. For precise and detailed work, the "tight" preset may be ideal, while the "loose" preset can be useful for more abstract or broad applications.
- When using the "custom" preset, experiment with different values for
expansion_pixelsandblur_pixelsto find the perfect balance for your specific project. Keep in mind that these values are divided by the compression factor to determine their effect in latent space.
Latent-Aligned Mask (Wan 2.1) Common Errors and Solutions:
"KeyError: 'preset_name'"
- Explanation: This error occurs when an invalid preset name is provided. The node expects one of the predefined preset names: "tight," "standard," "loose," or "custom."
- Solution: Ensure that the preset name you provide matches one of the available options exactly. Double-check for any typos or incorrect casing.
"TypeError: unsupported operand type(s)"
- Explanation: This error may arise if non-numeric values are provided for
expansion_pixelsorblur_pixelswhen using the "custom" preset. - Solution: Verify that the values for
expansion_pixelsandblur_pixelsare numeric and within a reasonable range for your project.
