Make IPAdapter compatible to `torch.compile`
What does this PR do?
Fixes #7985
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the contributor guideline?
- [ ] Did you read our philosophy doc (important for complex PRs)?
- [ ] Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [ ] Did you write any new necessary tests?
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
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.
cc @fabiorigano too
hi @yiyixuxu thanks for adding me here
IPAdapterPlusImageProjection was added some time ago, I am not sure why it has been implemented in this way
I think it would be nice to have a forward function that uses the https://github.com/huggingface/diffusers/blob/d6ca1209875b536937dfaa5293db732940ce0e0b/src/diffusers/models/embeddings.py#L892 that we introduced with the Face ID PR #7186
thanks @fabiorigano!
cc @rootonchair, does face id currently work with torch.compile?
@yiyixuxu yes it does. As @fabiorigano suggested, we could utilize IPAdapterPlusImageProjectionBlock however weight loading also need to be updated
This works for me. Thank you, @rootonchair!
Perhaps the use of IPAdapterPlusImageProjectionBlock could live in a different PR? @yiyixuxu WDYT?
I can open a new PR to use IPAdapterPlusImageProjectionBlock, if @rootonchair agrees
That would be great, thank you!
Sure @fabiorigano, thank you
@rootonchair does https://github.com/huggingface/diffusers/pull/7994 work for you?
@sayakpaul yes it does. Fantastic works
Fantastic. Would you mind closing the PR then? I am sorry about the inconvenience here.
Ah, no problem. I assume closing #7985 too?