ConditioningSetMaskAndCombine
From a technical implementation perspective, this node receives two positive and two negative CONDITIONING inputs, along with two corresponding MASK inputs.
Conditioning Set Mask And Combine
From a technical implementation perspective, the ConditioningSetMaskAndCombine node receives two positive and two negative CONDITIONING inputs, along with two corresponding MASK inputs.
The ConditioningSetMaskAndCombine node is a tool for combining masks and conditioning in image generation. It merges two sets of positive and negative prompts (Conditioning) with their corresponding masks, allowing adjustment of the mask's influence strength, and ultimately outputs the fused positive and negative conditioning data. This node packages multiple native functions, simplifying the handling of complex regional control in workflows.
Node Functionality
From a technical implementation perspective, this node receives two positive and two negative CONDITIONING inputs, along with two corresponding MASK inputs. Its core mechanism uses the append_helper function (typically from within ComfyUI) to associate each conditioning data with the specified mask and its strength parameter. It supports selecting the area where the conditioning is applied, either the default area or strictly within the mask boundaries, ensuring operational precision.
Node Parameter Description - ConditioningSetMaskAndCombine
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
positive_1 | CONDITIONING | Yes | - | - | positive_1 (input parameter): Input the conditioning data for the first set of positive generation prompts. |
negative_1 | CONDITIONING | Yes | - | - | negative_1 (input parameter): Input the conditioning data for the first set of negative generation prompts. |
positive_2 | CONDITIONING | Yes | - | - | positive_2 (input parameter): Input the conditioning data for the second set of positive generation prompts. |
negative_2 | CONDITIONING | Yes | - | - | negative_2 (input parameter): Input the conditioning data for the second set of negative generation prompts. |
mask_1 | MASK | Yes | - | - | mask_1 (input parameter): Input the mask associated with the first set of conditioning data, used to define its effective area. |
mask_2 | MASK | Yes | - | - | mask_2 (input parameter): Input the mask associated with the second set of conditioning data, used to define its effective area. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
set_cond_area | COMBO | Yes | default | "default", "mask bounds" | set_cond_area (input parameter): Sets the area where the conditioning takes effect. Options are "default" (entire image by default) or "mask bounds" (strictly limited to within the mask boundaries). |
mask_1_strength | FLOAT | Yes | 1.0 | 0.0 - 10.0 (step: 0.01) | mask_1_strength (input parameter): Controls the influence strength of the first mask on the conditioning data, range 0.0 to 10.0, step 0.01. |
mask_2_strength | FLOAT | Yes | 1.0 | 0.0 - 10.0 (step: 0.01) | mask_2_strength (input parameter): Controls the influence strength of the second mask on the conditioning data, range 0.0 to 10.0, step 0.01. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| combined_positive | CONDITIONING | combined_positive (output parameter): The output combined positive conditioning data. |
| combined_negative | CONDITIONING | combined_negative (output parameter): The output combined negative conditioning data. |
Usage Scenarios
In practical applications, this node is commonly used in scenarios where different prompts need to be precisely applied to different areas of an image. For example, in a portrait generation workflow, you could use mask_1 with the prompt "golden long hair" to control the hair area, while using mask_2 with the prompt "blue eyes" to control the eye area, then merge and output them to achieve independent control of multiple features in a single image.
Notes
Please note that the input masks need to be compatible with the dimensions of the generated image. Although the node internally handles mask dimensions, ensuring the masks correctly correspond to the canvas area is a prerequisite for achieving the expected results. The strength parameters should not be set too high to avoid unnatural transitions or artifacts in the generated image.
ConditioningSetMaskAndCombine Node Source Code Link
The ConditioningSetMaskAndCombine node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.