cubiq / ComfyUI_IPAdapter_plus

GNU General Public License v3.0
3.17k stars 238 forks source link

[Feature Request] Automatically ignore empty attention mask #503

Open alessandroperilli opened 2 months ago

alessandroperilli commented 2 months ago

Hi Matteo. Thanks for all the work done so far. Amazing contribution to the AI community.

I'm try to control the activation of the attention mask for IPAdapter nodes via a control panel, but I struggling.

By default, at least from what I can see in my system, IPAdapter nodes (e.g., IPAdapterStyleComposition) always look into at the attention mask input. If I define NO mask in the mask editor, the IPAdapter nodes receive a black (or empty?) 64x64px square.

When that happens, IPAdapter simply refuses to work. It does not condition the image generation as usual.

The same is true if I place the mask input in a dedicated group and I disable that group. When I do that, the IPAdapter nodes receive no attention mask and do not do their job:

Screenshot 2024-04-23 at 12 07 29

All of this is probably by design. But this also means that we always need to manually connect/disconnect the link to the attention mask input. This is tedious and complex to do when you deal with a very large workflow.

Would it be possible to change the behavior of the IPAdapter nodes so that when they receive an empty attention mask (or a 64x64px black square) they ignore it and carry on as if no attention mask input was linked?

Thank you for any time you'll dedicate to this.

cubiq commented 2 months ago

I'll check it out but it has a very low priority