Remap Mask Range(RemapMaskRange)
This node receives a MASK-type tensor input and performs a linear transformation based on the user-defined `min` and `max` parameters.
Remap Mask Range
The Remap Mask Range node receives a MASK type tensor as input and performs a linear transformation based on the user-defined min and max parameters.
The Remap Mask Range node is used to remap the numerical range of a mask. Its core function is to adjust the pixel intensity interval of the input mask, allowing users to define new minimum and maximum values. Through this operation, the contrast and intensity performance of the mask can be flexibly enhanced or weakened.
Node Function
This node receives a MASK type tensor as input and performs a linear transformation based on the user-defined min and max parameters. Its internal mechanism first finds the maximum value in the input mask, then scales all pixel values proportionally to the new [min, max] range. Finally, all output values are clamped between 0.0 and 1.0 to ensure the result conforms to standard mask numerical specifications.
Node Parameter Description - Remap Mask Range
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Value Range/Options | Description |
|---|---|---|---|---|---|
mask | MASK | Yes | - | - | The input mask to be remapped. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Value Range/Options | Description |
|---|---|---|---|---|---|
min | FLOAT | Yes | 0.0 | -10.0 - 1.0 (step: 0.01) | Sets the new minimum value for the output mask. Type is FLOAT, value range is -10.0 to 1.0, adjustment step is 0.01. |
max | FLOAT | Yes | 1.0 | 0.0 - 10.0 (step: 0.01) | Sets the new maximum value for the output mask. Type is FLOAT, value range is 0.0 to 10.0, adjustment step is 0.01. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| mask | MASK | Outputs the new mask after its numerical range has been remapped. |
Usage Scenarios
This node is very useful in image generation or editing workflows when you need fine-grained control over the "intensity" or "opacity" of a specific area mask. For example, before using a mask to control repaint strength or as a blending factor, you can use this node to expand a weak mask signal (e.g., in the range of 0.1-0.3) to the full 0-1 dynamic range, thereby achieving a more pronounced effect.
Remap Mask Range Node Source Code Link
The Remap Mask Range node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.