2025-02-05 01:49:26 +01:00
2025-02-05 01:34:37 +01:00
2025-02-05 01:49:26 +01:00
2025-02-05 01:34:37 +01:00
2025-02-05 01:49:10 +01:00

Negative-attention-for-ComfyUI-

Takes the difference in between the positive and negative conditioning at the cross attention.

A proof of concept which demonstrates that a negative influence can be obtained by taking the difference at the output of the cross attention.

In order to do this for now the negative conditioning is sneaked to the attention by being concatenated to the positive by using a special node.

image

They are then split at the half before the cross attention.

Like any model patcher, it is to be plugged right after the model loader:

image

An example workflow is provided.

Example:

No modification:

01310UI_00001_

Strength at 2, rescale after ON:

01309UI_00001_

Strength at 2, rescale after OFF:

example workflow

Note

I haven't managed to make this work with anything but SDXL / SD1.5

I did spend two hours looking for how to patch the equivalent of the cross attention for Flux but did not find how (like the keywords for the patch or something).

Any help appreciated!

S
Description
No description provided
Readme
4.2 MiB
Languages
Python 100%