mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
use zip to iterate over image prompts and adapters
This commit is contained in:
parent
93c9852142
commit
68d628dc14
@ -712,11 +712,11 @@ class DenoiseLatentsInvocation(BaseInvocation):
|
|||||||
"""If IP-Adapter is enabled, then this function loads the requisite models and adds the image prompt conditioning data."""
|
"""If IP-Adapter is enabled, then this function loads the requisite models and adds the image prompt conditioning data."""
|
||||||
ip_adapter_data_list = []
|
ip_adapter_data_list = []
|
||||||
assert len(ip_adapters) == len(image_prompts)
|
assert len(ip_adapters) == len(image_prompts)
|
||||||
for single_ip_adapter in ip_adapters:
|
for single_ip_adapter, (image_prompt_embeds, uncond_image_prompt_embeds) in zip(
|
||||||
|
ip_adapters, image_prompts, strict=False
|
||||||
|
):
|
||||||
ip_adapter_model = exit_stack.enter_context(context.models.load(single_ip_adapter.ip_adapter_model))
|
ip_adapter_model = exit_stack.enter_context(context.models.load(single_ip_adapter.ip_adapter_model))
|
||||||
|
|
||||||
image_prompt_embeds, uncond_image_prompt_embeds = image_prompts.pop(0)
|
|
||||||
|
|
||||||
mask_field = single_ip_adapter.mask
|
mask_field = single_ip_adapter.mask
|
||||||
mask = context.tensors.load(mask_field.tensor_name) if mask_field is not None else None
|
mask = context.tensors.load(mask_field.tensor_name) if mask_field is not None else None
|
||||||
mask = self._preprocess_regional_prompt_mask(mask, latent_height, latent_width, dtype=dtype)
|
mask = self._preprocess_regional_prompt_mask(mask, latent_height, latent_width, dtype=dtype)
|
||||||
|
Loading…
Reference in New Issue
Block a user