handle case of no IP adapters requested

This commit is contained in:
Lincoln Stein 2024-05-28 22:57:01 -04:00 committed by Kent Keirsey
parent 1c59fce6ad
commit 7391c126d3

View File

@ -678,6 +678,9 @@ class DenoiseLatentsInvocation(BaseInvocation):
) -> List[Tuple[torch.Tensor, torch.Tensor]]:
"""Run the IPAdapter CLIPVisionModel, returning image prompt embeddings."""
# ip_adapter could be a list or a single IPAdapterField. Normalize to a list here.
if ip_adapter is None:
return []
if not isinstance(ip_adapter, list):
ip_adapter = [ip_adapter]