ConditioningSetMaskAndCombine4
This node technically replicates the functionality of multiple native ComfyUI 'Set Mask and Combine' nodes and integrates them into a single node.
Conditioning Set Mask And Combine4
The ConditioningSetMaskAndCombine4 node technically replicates the functionality of multiple native ComfyUI "Set Mask and Combine" nodes and integrates them into a single node.
ConditioningSetMaskAndCombine4 is a powerful combination node for image generation, capable of combining up to four distinct sets of positive and negative prompts (Conditioning) with their corresponding masks. Its core functionality allows users to apply different generation guidance conditions to different areas of the same image, enabling complex local control and editing.
Node Functionality
This node technically replicates the functionality of multiple native ComfyUI "Set Mask and Combine" nodes and integrates them into a single node. It accepts four independent sets of Conditioning inputs (each containing positive and negative prompts) along with four corresponding MASK inputs, and allows setting individual strength for each mask. Internally, the node handles mask dimensions and determines the area where conditions are applied based on the set_cond_area parameter, ultimately outputting merged positive and negative Conditioning data streams.
Node Parameter Description - ConditioningSetMaskAndCombine4
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
positive_1 | CONDITIONING | Yes | - | - | positive_1 (Input Parameter): The first set of positive prompts (Conditioning), describing the content you wish to generate within the corresponding mask area. |
negative_1 | CONDITIONING | Yes | - | - | negative_1 (Input Parameter): The first set of negative prompts (Conditioning), describing the content you wish to avoid within the corresponding mask area. |
positive_2 | CONDITIONING | Yes | - | - | positive_2 (Input Parameter): The second set of positive prompts (Conditioning), for the second mask area. |
negative_2 | CONDITIONING | Yes | - | - | negative_2 (Input Parameter): The second set of negative prompts (Conditioning), for the second mask area. |
positive_3 | CONDITIONING | Yes | - | - | positive_3 (Input Parameter): The third set of positive prompts (Conditioning), for the third mask area. |
negative_3 | CONDITIONING | Yes | - | - | negative_3 (Input Parameter): The third set of negative prompts (Conditioning), for the third mask area. |
positive_4 | CONDITIONING | Yes | - | - | positive_4 (Input Parameter): The fourth set of positive prompts (Conditioning), for the fourth mask area. |
negative_4 | CONDITIONING | Yes | - | - | negative_4 (Input Parameter): The fourth set of negative prompts (Conditioning), for the fourth mask area. |
mask_1 | MASK | Yes | - | - | mask_1 (Input Parameter): The first mask, used to define the image area where the first set of conditions takes effect. White areas indicate effect. |
mask_2 | MASK | Yes | - | - | mask_2 (Input Parameter): The second mask, used to define the image area where the second set of conditions takes effect. |
mask_3 | MASK | Yes | - | - | mask_3 (Input Parameter): The third mask, used to define the image area where the third set of conditions takes effect. |
mask_4 | MASK | Yes | - | - | mask_4 (Input Parameter): The fourth mask, used to define the image area where the fourth set of conditions takes effect. |
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 application scope of the conditions (prompts). Options are "default" (entire image by default) or "mask bounds" (only within the mask bounding box). |
mask_1_strength | FLOAT | Yes | 1.0 | 0.0 - 10.0 (Step: 0.01) | mask_1_strength (Input Parameter): Controls the strength coefficient for the first mask condition. 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 strength coefficient for the second mask condition. Range 0.0 to 10.0, step 0.01. |
mask_3_strength | FLOAT | Yes | 1.0 | 0.0 - 10.0 (Step: 0.01) | mask_3_strength (Input Parameter): Controls the strength coefficient for the third mask condition. Range 0.0 to 10.0, step 0.01. |
mask_4_strength | FLOAT | Yes | 1.0 | 0.0 - 10.0 (Step: 0.01) | mask_4_strength (Input Parameter): Controls the strength coefficient for the fourth mask condition. Range 0.0 to 10.0, step 0.01. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| combined_positive | CONDITIONING | combined_positive (Output Parameter): The output after merging all four sets of positive conditions, to be connected to the sampler. |
| combined_negative | CONDITIONING | combined_negative (Output Parameter): The output after merging all four sets of negative conditions, to be connected to the sampler. |
Usage Scenarios
In practical workflows, you can use it to create a scene image containing multiple independent elements. For example, you could use one set of prompts and a mask for the "sky" area, another set for a "foreground character", a third set for "background architecture", and a fourth set for a "decorative object" requiring a specific style. By connecting different text prompts and precisely drawn masks, this node can guide the AI to generate distinctly different content in specific parts of the image.
Notes
When using this node, ensure that the input masks (MASK) match the dimensions of the target image. It is also advisable for the masks to be non-overlapping or carefully designed in terms of spatial arrangement to avoid conflicting conditions leading to unpredictable generation results. The mask strength parameters can amplify or weaken the influence of the corresponding conditions.
ConditioningSetMaskAndCombine4 Node Source Code Link
ConditioningSetMaskAndCombine4 node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.