[Core] Refactor `IPAdapterPlusImageProjection` a bit
What does this PR do?
Refer to https://github.com/huggingface/diffusers/pull/7988/#issuecomment-2120785867, thanks to @fabiorigano for the suggestion. Even though Fabio mentioned working on a PR for this, I had some free-time and thought I would do it. I hope that's okay with you, @fabiorigano?
In any case, would really appreciate your reviews here and if you could test this if you find some time, that would be of great help.
@rootonchair feel free to give it a look as well.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
@sayakpaul no problem, it looks really good and neat to me now! I will do some testing as soon as I can, but maybe https://github.com/huggingface/diffusers/blob/e1df77ee1ec0400195ad8dcb2099d137b34c9b9f/tests/models/unets/test_models_unet_2d_condition.py#L114 should be updated too, right?
@sayakpaul I tested both simple inference and the test_ip_adapter_plus function in the test suite with the command python -m pytest -s -v tests/models -k test_ip_adapter_plus. Everything works as expected, even the test because some keys are not updated and the loading process doesn't fail. The following conditions are never true because of the new architecture of the class:
https://github.com/huggingface/diffusers/blob/e1df77ee1ec0400195ad8dcb2099d137b34c9b9f/tests/models/unets/test_models_unet_2d_condition.py#L162-L175
IMO they should be either removed or updated. WDYT?
Thanks for catching this, @fabiorigano! I just updated it in 9ebacf3. WDYT?
Looks great! @sayakpaul
Thanks to @fabiorigano once again for the suggestion and kind help.