Skip to content

Cant load IP Adapter to FLUX #11442

Answered by AeroDEmi
AeroDEmi asked this question in Q&A
Apr 28, 2025 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

I fixed with this:

import torch
from diffusers import FluxPipeline, LCMScheduler
from transformers import CLIPVisionModelWithProjection

image_encoder = CLIPVisionModelWithProjection.from_pretrained(
    "openai/clip-vit-large-patch14",
    torch_dtype=torch.bfloat16
)

pipe: FluxPipeline = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    image_encoder=image_encoder,
    torch_dtype=torch.bfloat16,
).to("cuda")

pipe.load_ip_adapter("XLabs-AI/flux-ip-adapter", weight_name="ip_adapter.safetensors")

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@AeroDEmi
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by AeroDEmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant