ComfyUI > Nodes > Akatz Custom Nodes > Scale Mask | Akatz

ComfyUI Node: Scale Mask | Akatz

Class Name

AK_ScaleMask

Category
💜Akatz Nodes/Mask
Author
akatz-ai (Account age: 358days)
Extension
Akatz Custom Nodes
Latest Updated
2025-04-05
Github Stars
0.03K

How to Install Akatz Custom Nodes

Install this extension via the ComfyUI Manager by searching for Akatz Custom Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Akatz Custom Nodes 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

Scale Mask | Akatz Description

Adjust mask intensity by scaling factor for image processing tasks, enhancing or reducing specific features in images.

Scale Mask | Akatz:

The AK_ScaleMask node is designed to adjust the intensity of a mask by applying a scaling factor, which is particularly useful in image processing tasks where you need to modulate the strength or visibility of certain features within an image. This node takes a mask, which is essentially a tensor representing different areas of an image, and scales its values by a specified factor. This operation can be beneficial in scenarios where you want to emphasize or de-emphasize certain parts of an image, such as enhancing the contrast of specific regions or reducing the prominence of others. By providing a simple yet effective way to control the mask's intensity, the AK_ScaleMask node allows for more nuanced and dynamic image manipulation, making it a valuable tool for AI artists looking to refine their creative outputs.

Scale Mask | Akatz Input Parameters:

mask

The mask parameter is a torch.Tensor that represents the input mask to be scaled. It is expected to have a shape of either [B, H, W] or [B, C, H, W], where B is the batch size, C is the number of channels, H is the height, and W is the width of the mask. This parameter is crucial as it defines the areas of the image that will be affected by the scaling operation. The mask should be a valid tensor, as the node will perform operations directly on this data structure.

scale_factor

The scale_factor is a float value that determines the degree to which the mask will be scaled. It ranges from 0.0 to 1.0, with a default value of 1.0. A scale factor of 1.0 means the mask will remain unchanged, while a value closer to 0.0 will reduce the mask's intensity, effectively dimming the areas it covers. This parameter allows for fine-tuning the impact of the mask on the image, enabling users to achieve the desired level of emphasis or subtlety in their image processing tasks.

Scale Mask | Akatz Output Parameters:

MASK

The output parameter MASK is a torch.Tensor that represents the scaled version of the input mask. It retains the same shape as the input mask, ensuring compatibility with subsequent processing steps. The scaled mask reflects the adjustments made by the scale factor, providing a modified version of the original mask that can be used to influence the final image output. This output is essential for achieving the intended visual effects in your image processing workflow.

Scale Mask | Akatz Usage Tips:

  • To achieve subtle adjustments, use a scale_factor slightly less than 1.0 to gently reduce the mask's intensity without completely diminishing its effect.
  • For more pronounced effects, experiment with lower scale_factor values to significantly alter the mask's impact, which can be useful for creating dramatic contrasts or highlighting specific image features.

Scale Mask | Akatz Common Errors and Solutions:

Input 'mask' must be a torch.Tensor.

  • Explanation: This error occurs when the input provided for the mask parameter is not a torch.Tensor, which is the expected data type for this node.
  • Solution: Ensure that the input mask is correctly formatted as a torch.Tensor before passing it to the node. You may need to convert your data to a tensor using appropriate PyTorch functions.

Input 'mask' must have 3 or 4 dimensions ([B, H, W] or [B, C, H, W]).

  • Explanation: This error indicates that the input mask does not have the required dimensions, which are necessary for the node to process the data correctly.
  • Solution: Verify that your input mask has the correct shape. If it does not, reshape or adjust your data to meet the expected dimensionality before using the node.

Scale Mask | Akatz Related Nodes

Go back to the extension to check out more related nodes.
Akatz Custom Nodes
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 Playground, enabling artists to harness the latest AI tools to create incredible art.