Replies: 4 comments 7 replies
-
Really interesting, I did some test in diffusers and it works really good and sometimes not that much, still need to test it more when I have more time. I found that if I send as a negative the same image (with a little noise) it uses only the colors which is also nice. Because I'm lazy, I used your car image as an input: "a cat"
For example for this image taken from prompt: " a tiger"
It doesn't capture the style as good but probably I can play with something to get to that point. Thank you for this @cubiq , I will use it and it's really cool. As a side note, My knowledge of the unet is not that deep yet, why is that you say:
Is it that obvious that the Now I probably want a granular control over all of them if that's the case, the same as we have with LoRAs now. |
Beta Was this translation helpful? Give feedback.
-
super cool! can we add this as a community script for now? we can figure out if we can better support all these experimental IP-adpter features later when we have more of the examples you can make a custom attention processor like this, basically just copy-paste class StyleIPAdapterAttnProcessor2_0(torch.nn.Module):
def __init__(self):
...
def forward(self, ...):
... and then you can do something like this to set the processor from diffusers import DiffusionPipeline
from diffusers.models.attention_processor import IPAdapterAttnProcessor, IPAdapterAttnProcessor2_0
import torch
pipe = DiffusionPipeline.from_pretrained(...)
pipe.load_ip_adapter(...)
your_attn_processor = pipe.unet.attn_processors
for k, w in your_attn_processor.items():
if isinstance(w, (IPAdapterAttnProcessor, IPAdapterAttnProcessor2_0)):
your_attn_processor[k] = StyleIPAdapterAttnProcessor2_0()
pipe.unet.set_attn_processor(your_attn_processor) |
Beta Was this translation helpful? Give feedback.
-
About this question - "Is it that obvious that the transformers index 6 is the one responsible of the style? In that case which one(s) would be responsible for the composition?" I think this paper might explain? its the fifth transformer block index skipping the first block. |
Beta Was this translation helpful? Give feedback.
-
👋 @asomoza can you share the code please? 🙏 |
Beta Was this translation helpful? Give feedback.
-
In SDXL by applying the weights only to the transformer index 6 it is possible to get a very powerful style transfer tool guided by IPAdapter. I don't know why I haven't thought about it before... I implemented it in ComfyUI and I guess it would be a cool feature for diffusers.
Similarly I believe it's possible to do the same with the composition only (haven't worked on this yet)
In the corner you can see the reference image
"cyberpunk sports car"

"peaceful landscape in japan"

"woman daydreaming at the window"

"cyberpunk alley"

Beta Was this translation helpful? Give feedback.
All reactions