-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add IP Adapter Style & Composition Modes #6213
Add IP Adapter Style & Composition Modes #6213
Conversation
4e9ddeb
to
d4393e4
Compare
6dbd83f
to
27466ff
Compare
0de301e
to
2d5786d
Compare
…th mismatch Pushing this so people can test it out and see if this needs to be handled in a different way.
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.
Couple small comments, ML logic itself looks fine to me but probably best to get @RyanJDick to review that too.
invokeai/backend/stable_diffusion/diffusion/custom_atttention.py
Outdated
Show resolved
Hide resolved
invokeai/backend/stable_diffusion/diffusion/custom_atttention.py
Outdated
Show resolved
Hide resolved
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.
I've found what I think are some significant bugs in the current implementation. I haven't taken a close look at custom_attention.py yet - I expect that fixing these bugs will have lots of trickle-down effects there.
invokeai/backend/stable_diffusion/diffusion/custom_atttention.py
Outdated
Show resolved
Hide resolved
invokeai/backend/stable_diffusion/diffusion/unet_attention_patcher.py
Outdated
Show resolved
Hide resolved
They were being overwritten rather than being appended
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 a few small things to fix, otherwise looks good to me.
invokeai/backend/stable_diffusion/diffusion/unet_attention_patcher.py
Outdated
Show resolved
Hide resolved
invokeai/backend/stable_diffusion/diffusion/custom_atttention.py
Outdated
Show resolved
Hide resolved
invokeai/backend/stable_diffusion/diffusion/custom_atttention.py
Outdated
Show resolved
Hide resolved
invokeai/backend/stable_diffusion/diffusion/custom_atttention.py
Outdated
Show resolved
Hide resolved
The InstantStyle paper also suggested using embedding subtraction to isolate the style. Out of curiosity, did you try that at all? |
No. Didn't check that. I'll take a look. |
Pushed the changes you requested. Let me know if anything else needs changing. |
Summary
Until now IP Adapter had complete control on the contents of the output. With this PR, users are now able to select "Style Only" or "Composition Only" to draw just the style or layout of the reference image.
Based off: https://arxiv.org/abs/2404.02733
New IP Method Option
Full
- Both style and layout of the refence image are used.Style Only
- Only the style of the image is usedComposition Only
- Only the composition of the image is used.Example Result
Notes
Testing
Merge Plan
Good to merge once tested for all edge cases.