IPAdapter Mad Scientist(IPAdapterMS)
IPAdapter Mad Scientist node from ComfyUI-IPAdapter-plus.
IP Adapter MS
Description
IPAdapterMS (Mad Scientist) is an experimental IPAdapter application node in the ipadapter/dev category of ComfyUI-IPAdapter-plus. It attaches image prompt conditioning to a diffusion model while exposing controls that are normally hidden or fixed in simpler IPAdapter nodes, including per-layer weights, embedding combination modes, embedding scaling strategies, an active step range, an attention mask, and optional FaceID support.
This node is intended for users who want to tune how an IPAdapter influences a model beyond the standard weight and weight type controls. Because many of its parameters interact, small changes can produce noticeably different results. Use it when you need fine control over layer behavior, timestep range, or how multiple embeddings are combined.
Inputs
Required Inputs
| Input | Type | Default | Range | Description |
|---|---|---|---|---|
model | MODEL | The diffusion model that receives the IPAdapter conditioning. | ||
ipadapter | IPADAPTER | The IPAdapter model or adapter configuration to apply. | ||
image | IMAGE | The image prompt used to condition the model. | ||
weight | FLOAT | 1.0 | -1.0 to 5.0, step 0.05 | Overall strength of the image prompt. Values above 1 strengthen the effect, values below 1 weaken it, and negative values can invert the influence. |
weight_faceidv2 | FLOAT | 1.0 | -1.0 to 5.0, step 0.05 | Separate weight for FaceID v2 adapters. It controls the strength of the face identity contribution when an InsightFace provider and FaceID adapter are used. |
weight_type | COMBO | Selects the weighting behavior used when applying the image prompt across the model. The available choices are provided by the installed IPAdapter backend and affect how the weight is distributed. | ||
combine_embeds | COMBO | concat, add, subtract, average, norm average | Determines how multiple image embeddings are combined. concat keeps them as separate concatenated embeddings, add sums them, subtract subtracts them, average takes the mean, and norm average normalizes before averaging. | |
start_at | FLOAT | 0.0 | 0.0 to 1.0, step 0.001 | The diffusion step, expressed as a fraction from 0 to 1, at which IPAdapter influence begins. For example, a value of 0.2 starts the effect after the earliest steps. |
end_at | FLOAT | 1.0 | 0.0 to 1.0, step 0.001 | The diffusion step, expressed as a fraction from 0 to 1, at which IPAdapter influence ends. A value of 0.8 stops the effect before the final steps. |
embeds_scaling | COMBO | V only, K+V, K+V w/ C penalty, K+mean(V) w/ C penalty | Controls how IPAdapter embeddings are scaled in the attention mechanism. V only affects values only, K+V affects keys and values, and the variants with C penalty apply a contrastive penalty for stronger separation. This is an advanced experimental control. | |
layer_weights | STRING | "" (empty) | A string specifying per-layer multipliers for the IPAdapter attention layers. When empty, uniform default weighting is used. The expected syntax and number of entries depend on the loaded IPAdapter model, with entries generally corresponding to cross-attention layers in order. |
Optional Inputs
| Input | Type | Description |
|---|---|---|
image_negative | IMAGE | An optional negative image prompt. When connected, the model is conditioned away from this image as well as toward the main image. |
attn_mask | MASK | Restricts where the image prompt takes effect in the generated image. Regions with nonzero mask values receive the IPAdapter influence, which is useful for localized edits or subject placement. |
clip_vision | CLIP_VISION | An optional CLIP vision encoder used to encode the image prompt. When omitted, the node uses the encoder associated with the loaded IPAdapter. Providing one overrides that choice. |
insightface | INSIGHTFACE | An optional InsightFace provider used for FaceID adapters. This is required when applying a FaceID IPAdapter, since it supplies the face embeddings used for identity conditioning. |
Outputs
The current source definition for IPAdapterMS declares no outputs. Use the node according to the package's example workflows and the requirements of your installed IPAdapter version.
Usage Notes
- Start with a modest
weightsuch as 0.5 to 1.0, then adjust upward or downward. Negative weights can create contrast or inversion effects but often require careful tuning. start_atandend_atare useful for controlling where in the diffusion process the image prompt matters. Starting later can preserve more of the base model's composition, while ending earlier can reduce over-processing or artifacts.- Use
layer_weightsonly when you know the layer layout of the loaded IPAdapter. Leaving it empty is the safest default and produces uniform layer weighting. combine_embedsbecomes relevant when multiple image embeddings are present, such as with batched images or multiple conditioning inputs.concatpreserves more distinct information, while averaging modes can produce smoother, more blended results.embeds_scalingis an experimental control.V onlyis the least invasive choice, whileK+Vand theC penaltymodes can strengthen or sharpen the adapter's influence at the cost of stability.- For FaceID workflows, connect an
insightfaceprovider and useweight_faceidv2to tune the identity contribution independently of the overallweight. - Use
attn_maskto localize the image prompt to a specific region. This is helpful when the image prompt should affect only part of the canvas rather than the entire generation. image_negativecan help when the positive image prompt is producing unwanted traits. It pushes the result away from the negative image while still following the main image prompt.
Comments
Sign in with GitHub to join the discussion.