feat: support SD1.5

This commit is contained in:
blessedcoolant 2024-04-13 12:30:39 +05:30
parent d4393e4170
commit 9fc73743b2

View File

@ -116,11 +116,17 @@ class IPAdapterInvocation(BaseInvocation):
image_encoder_model = self._get_image_encoder(context, image_encoder_model_name)
target_blocks = ["up_blocks.0.attentions.1", "down_blocks.2.attentions.1"]
target_blocks = ["block"]
if self.method == "style":
target_blocks = ["up_blocks.0.attentions.1"]
if ip_adapter_info.base == "sd-1":
target_blocks = ["up_blocks.1"]
if ip_adapter_info.base == "sdxl":
target_blocks = ["up_blocks.0.attentions.1"]
elif self.method == "composition":
target_blocks = ["down_blocks.2.attentions.1"]
if ip_adapter_info.base == "sd1":
target_blocks = ["down_blocks.2", "mid_block", "up_blocks.1"]
if ip_adapter_info.base == "sdxl":
target_blocks = ["down_blocks.2.attentions.1"]
return IPAdapterOutput(
ip_adapter=IPAdapterField(