-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expanded IP Adapter modes. #8011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
64a2ded
to
28c864c
Compare
@psychedelicious -- I'm not entirely sure why the typegen checks are failing -- but i think i've worked with matt3o to get everything wired in correctly, and have tested vs main to confirm no regressions (although as a note, did just test the IP adapter plus models) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needed to re-gen the types, looks good now
ed99a28
to
349a109
Compare
349a109
to
97aab5a
Compare
This pull request introduces enhancements to the IP-Adapter functionality, including the addition of two new methods (
style_strong
andstyle_precise
) and corresponding updates across the backend and frontend to support these methods. Key changes include updates to data models, invocation logic, attention processing, and the user interface.Backend Enhancements to IP-Adapter:
New Methods and Logic:
style_strong
andstyle_precise
methods to theIPAdapterInvocation
class, with specific logic for determining target attention blocks based on the base type (e.g.,sd-1
,sdxl
). ([[1]](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-c63c2992c76f7ae765f25b13f9ecd2b8bb63eef5e5159dfa218a37926f95f980L97-R98)
,[[2]](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-c63c2992c76f7ae765f25b13f9ecd2b8bb63eef5e5159dfa218a37926f95f980R151-R182)
)Attention Processing Updates:
CustomAttnProcessor2_0
to handle negative attention blocks for thestyle_precise
method. This is, admittedly, less sophisticated than processing the entire negative block as a separate point of control, but the amount of work involved in that (and the likelihood of that being needed in the future, given this is for Diffusers/SDXL) seems low. ([invokeai/backend/stable_diffusion/diffusion/custom_atttention.pyR166-R169](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-2674cdb025f9eb53c71d878340376496d4f2cbf9d1ca77d7a048ea031124e8a2R166-R169)
)UNetAttentionPatcher
to mark specific blocks as negative when using thestyle_precise
method. ([invokeai/backend/stable_diffusion/diffusion/unet_attention_patcher.pyR43-R50](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-500c7c7bdd4c31b28a0bea8009cd83b12ccb32813cfef4a0db0024607d8a9062R43-R50)
)Frontend Updates for IP-Adapter Configuration:
UI Enhancements:
style_strong
andstyle_precise
options to the IP-Adapter method dropdown in the user interface, along with descriptions. ([invokeai/frontend/web/src/features/controlLayers/components/IPAdapter/IPAdapterMethod.tsxR38-R47](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-a8e1c058bc6b8e47c2b9d696b5fff027d12f45d755977add5ad779ac00254630R38-R47)
)Schema and Type Updates:
zIPMethodV2
and related schemas to include the new methods, ensuring validation and type safety. ([[1]](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-41b99074662523f313cc66e9d6ce8fa9067ac0a87dbf8bcd374554dc533fbcf9L53-R53)
,[[2]](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-21f94e3b560358a31df37b048dc4077c48c02f38c55068a6ffc4f11be239f07aL150-R150)
,[[3]](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-7000f59d98ff3b216f5408fecd7c6ff301af310cd1f6d8301d08553fc696d4c4L9173-R9173)
,[[4]](https://github.com/invoke-ai/InvokeAI/pull/8011/files#diff-7000f59d98ff3b216f5408fecd7c6ff301af310cd1f6d8301d08553fc696d4c4L9299-R9299)
)## SummaryQA Instructions
Should test all previous instances of IP Adapter vs new
Regression:
Functionality:
Merge Plan
Checklist
What's New
copy (if doing a release after this PR)