KJNodes/masking/generategenerated

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

MASK
input_values
0
width
100
height
100
KJNodes

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 NameData TypeRequiredDefault ValueRange/OptionsDescription
input_valuesFLOATYes0-: Input floating-point numbers used to generate mask grayscale values. Supports single values or lists of values.
widthINTYes100-: Sets the width of the generated mask. Minimum value is 1.
heightINTYes100-: Sets the height of the generated mask. Minimum value is 1.

Output

Parameter NameData TypeDescription
MASKMASK: 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.

The Float To Mask node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…