Uh oh!
There was an error while loading. Please reload this page.
Support InstantStyle - #7586
Conversation
yiyixuxu
left a comment
There was a problem hiding this comment.
looking great!
left one comment. Thanks!
| selected = False | ||
| for block_name in target_blocks: | ||
| if block_name in name: | ||
| selected = True | ||
| break |
There was a problem hiding this comment.
does this work?
| selected=False | |
| forblock_nameintarget_blocks: | |
| ifblock_nameinname: | |
| selected=True | |
| break | |
| selected=any( block_nameinnameforblock_nameintarget_blocks) |
There was a problem hiding this comment.
Yes, it is much clearer. Updated.
HuggingFaceDocBuilderDev
commented
Apr 5, 2024
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. |
yiyixuxu
commented
Apr 5, 2024
@asomoza can you do a final review and test this out? |
Nice, it works as intended and I really like the skip functionality, thank you for your work. But I want to give my opinion here and open a discussion on about how is this implemented. Diffusers is used as a backend for UIs, for advanced users and also not for that advanced that knows all the diffusers naming for the blocks and layers, so I think we need to take this into consideration:
I really like to be able to use the same dict as the LoRAs for example.: {
"down": {"block_1": [0.0, 0.0], "block_2": [0.0, 0.0]},
"mid": 0.0,
"up": {"block_0": 1.0, "block_1": [0.0, 0.0, 0.0]},
},on the other side, I really like the simplicity of this PR, if we go with the other implementation it will probably make the code a lot more complex. |
haofanwang
commented
Apr 5, 2024
I believe we can set different weights for each block just like LoRA dict, in this case, we don't need to reload modules. Will update soon. |
ivanprado
commented
Apr 8, 2024
Cool @haofanwang! What would be the mechanism to subtract the CLIP text embedding from the image embedding with diffusers? This is done here in the original implementation. |
yiyixuxu
commented
Apr 8, 2024
we will merge this one soon #7499 |
haofanwang
commented
Apr 9, 2024
Will rebase on #7499. |
okaris
commented
Apr 12, 2024
Is it possible to load multiple ip adapters at the same time? I would appreciate an example that shows how we could load/unload different adapters seperately or together. Thanks! |
haofanwang
commented
Apr 14, 2024
haofanwang
commented
Apr 14, 2024
This is another problem. We can support it later. |
haofanwang
commented
Apr 14, 2024
This can be natively achieved already. We will show how to do it once this PR merged. |
This PR supports for our recent work InstantStyle in native diffusers API. The idea has also been discussed at #7534 .
The modifications are mainly about IP-Adapter loader, allowing users to specify target blocks used for image feature injection. After merged, InstantStyle can be achieved via following way