Is your feature request related to a problem? Please describe.
I have a use-case where I need to use custom adapter together with instruct-pix2pix model, which requires passing custom cross_attention_kwargs into unet.
However, having ability to pass this parameter would allow other use-cases as well, like LoRAs. Basically any use-case where this parameter is used for StableDiffusionPipeline should also be relevant for StableDiffusionInstructPix2PixPipeline as well.
Describe the solution you'd like.
Add a new cross_attention_kwargs parameter to __call__ method of StableDiffusionInstructPix2PixPipeline. Pass this parameter to unet call inside the method.
Describe alternatives you've considered.
Other hacky solutions with context manager, which manipulate UNet tensors might work, but they would overcomplicate the code. Also it's hard to make such solutions work properly with torch.compile
Is your feature request related to a problem? Please describe. I have a use-case where I need to use custom adapter together with instruct-pix2pix model, which requires passing custom
cross_attention_kwargs
into unet. However, having ability to pass this parameter would allow other use-cases as well, like LoRAs. Basically any use-case where this parameter is used forStableDiffusionPipeline
should also be relevant forStableDiffusionInstructPix2PixPipeline
as well.Describe the solution you'd like. Add a new
cross_attention_kwargs
parameter to__call__
method ofStableDiffusionInstructPix2PixPipeline
. Pass this parameter tounet
call inside the method.Describe alternatives you've considered. Other hacky solutions with context manager, which manipulate UNet tensors might work, but they would overcomplicate the code. Also it's hard to make such solutions work properly with
torch.compile