Float To Mask(FloatToMask)
From a technical implementation perspective, this node takes one or more floating-point numbers as input and determines the output mask batch size based on the number of these values.
Float To Mask
From a technical implementation perspective, the Float To Mask node receives one or more floating-point numbers as input and determines the output mask batch size based on the number of these values.
The Float To Mask node is a tool for generating masks. Its core function is to batch-create mask images with specified dimensions and uniform grayscale values based on the input floating-point numbers. This node simplifies the conversion process from numerical values to visual masks.
Node Function
From a technical implementation perspective, the node receives one or more floating-point numbers as input and determines the output mask batch size based on the number of these values. The dimensions of each mask are determined by user-defined width and height parameters, and the grayscale value of all its pixels is set to the corresponding input floating-point number. Internally, the node converts the input data into a list format for processing and ultimately outputs a batch of MASK tensors.
Node Parameter Description - Float To Mask
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
input_values | FLOAT | Yes | 0 | - | : Input floating-point numbers used to generate mask grayscale values. Supports single values or lists of values. |
width | INT | Yes | 100 | - | : Sets the width of the generated mask. Minimum value is 1. |
height | INT | Yes | 100 | - | : Sets the height of the generated mask. Minimum value is 1. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| MASK | MASK | : Outputs a batch of grayscale mask tensors. |
Usage Scenarios
In practical workflows, you can connect this node to nodes that provide numerical values (such as mathematical operation nodes or values derived from image analysis) to quickly generate masks for controlling the opacity or intensity of image generation areas. For example, when you need to apply varying degrees of effects (such as blurring or blending) to multiple images based on a set of weight values, using this node to generate the corresponding mask sequence is highly efficient.
Float To Mask Node Source Code Link
The Float To Mask node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.