mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Added IP-Adapter SDXL support. Added IP-Adapter "Plus" (more detail) model support.
This commit is contained in:
parent
74bfb5e1f9
commit
fb1b03960e
@ -34,7 +34,7 @@ from .diffusion import (
|
|||||||
BasicConditioningInfo,
|
BasicConditioningInfo,
|
||||||
)
|
)
|
||||||
from ..util import normalize_device, auto_detect_slice_size
|
from ..util import normalize_device, auto_detect_slice_size
|
||||||
from invokeai.backend.ip_adapter.ip_adapter import IPAdapter
|
from invokeai.backend.ip_adapter.ip_adapter import IPAdapter, IPAdapterPlus, IPAdapterXL
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -467,6 +467,21 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
|
|||||||
# and how to undo if ip_adapter_image is removed
|
# and how to undo if ip_adapter_image is removed
|
||||||
# Should reimplement to use existing model management context etc.
|
# Should reimplement to use existing model management context etc.
|
||||||
#
|
#
|
||||||
|
if "sdxl" in ip_adapter_info.ip_adapter_model:
|
||||||
|
print("using IPAdapterXL")
|
||||||
|
ip_adapter = IPAdapterXL(self,
|
||||||
|
ip_adapter_info.image_encoder_model,
|
||||||
|
ip_adapter_info.ip_adapter_model,
|
||||||
|
self.unet.device)
|
||||||
|
elif "plus" in ip_adapter_info.ip_adapter_model:
|
||||||
|
print("using IPAdapterPlus")
|
||||||
|
ip_adapter = IPAdapterPlus(self, # IPAdapterPlus first arg is StableDiffusionPipeline
|
||||||
|
ip_adapter_info.image_encoder_model,
|
||||||
|
ip_adapter_info.ip_adapter_model,
|
||||||
|
self.unet.device,
|
||||||
|
num_tokens=16)
|
||||||
|
else:
|
||||||
|
print("using IPAdapter")
|
||||||
ip_adapter = IPAdapter(self, # IPAdapter first arg is StableDiffusionPipeline
|
ip_adapter = IPAdapter(self, # IPAdapter first arg is StableDiffusionPipeline
|
||||||
ip_adapter_info.image_encoder_model,
|
ip_adapter_info.image_encoder_model,
|
||||||
ip_adapter_info.ip_adapter_model,
|
ip_adapter_info.ip_adapter_model,
|
||||||
|
Loading…
Reference in New Issue
Block a user