Skip to content

Commit

Permalink
fix(nodes): load IP Adapter images as RGB
Browse files Browse the repository at this point in the history
FLUX IP Adapter only works with RGB. Did the same for non-FLUX to be safe & consistent, though I don't think it's strictly necessary.
  • Loading branch information
psychedelicious committed Oct 22, 2024
1 parent ee89754 commit 61496fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion invokeai/app/invocations/denoise_latents.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ def prep_ip_adapter_image_prompts(
if not isinstance(single_ipa_image_fields, list):
single_ipa_image_fields = [single_ipa_image_fields]

single_ipa_images = [context.images.get_pil(image.image_name) for image in single_ipa_image_fields]
single_ipa_images = [
context.images.get_pil(image.image_name, mode="RGB") for image in single_ipa_image_fields
]
with image_encoder_model_info as image_encoder_model:
assert isinstance(image_encoder_model, CLIPVisionModelWithProjection)
# Get image embeddings from CLIP and ImageProjModel.
Expand Down
2 changes: 1 addition & 1 deletion invokeai/app/invocations/flux_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def _prep_ip_adapter_image_prompt_clip_embeds(
f"FLUX IP-Adapter only supports a single image prompt (received {len(ipa_image_fields)})."
)

ipa_images = [context.images.get_pil(image.image_name) for image in ipa_image_fields]
ipa_images = [context.images.get_pil(image.image_name, mode="RGB") for image in ipa_image_fields]

pos_images: list[npt.NDArray[np.uint8]] = []
neg_images: list[npt.NDArray[np.uint8]] = []
Expand Down

0 comments on commit 61496fd

Please sign in to comment.