KJNodes/masking/conditioninggenerated

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

positive_1
negative_1
positive_2
negative_2
mask_1
mask_2
combined_positive
combined_negative
mask_1_strength
1.00
mask_2_strength
1.00
set_cond_area
COMBO
KJNodes

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 NameData TypeRequiredDefault ValueRange/OptionsDescription
positive_1CONDITIONINGYes--positive_1 (input parameter): Input the conditioning data for the first set of positive generation prompts.
negative_1CONDITIONINGYes--negative_1 (input parameter): Input the conditioning data for the first set of negative generation prompts.
positive_2CONDITIONINGYes--positive_2 (input parameter): Input the conditioning data for the second set of positive generation prompts.
negative_2CONDITIONINGYes--negative_2 (input parameter): Input the conditioning data for the second set of negative generation prompts.
mask_1MASKYes--mask_1 (input parameter): Input the mask associated with the first set of conditioning data, used to define its effective area.
mask_2MASKYes--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 NameData TypeRequiredDefault ValueRange/OptionsDescription
set_cond_areaCOMBOYesdefault"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_strengthFLOATYes1.00.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_strengthFLOATYes1.00.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 NameData TypeDescription
combined_positiveCONDITIONINGcombined_positive (output parameter): The output combined positive conditioning data.
combined_negativeCONDITIONINGcombined_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.

The ConditioningSetMaskAndCombine node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…