huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
26.1k stars 5.38k forks source link

ip-adapter-full-face_sd15 load error #6149

Closed zhaoyun0071 closed 9 months ago

zhaoyun0071 commented 11 months ago

Describe the bug

pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter-full-face_sd15.bin")

diffusers\loaders\unet.py", line 711, in _load_ip_adapter_weights clip_embeddings_dim = state_dict["image_proj"]["proj.weight"].shape[-1] KeyError: 'proj.weight'

Reproduction


import torch
from diffusers import StableDiffusionPipeline, DDIMScheduler
from diffusers.utils import load_image

noise_scheduler = DDIMScheduler(
    num_train_timesteps=1000,
    beta_start=0.00085,
    beta_end=0.012,
    beta_schedule="scaled_linear",
    clip_sample=False,
    set_alpha_to_one=False,
    steps_offset=1
)

pipeline = StableDiffusionPipeline.from_single_file(r"braBeautifulRealistic_v40.safetensors", torch_dtype=torch.float16,
                                                    load_safety_checker=False).to("cuda")

pipeline.load_ip_adapter("h94/IP-Adapter", subfolder="models", weight_name="ip-adapter-full-face_sd15.bin")

Logs

No response

System Info

diffusers 0.24.0

Who can help?

No response

fabiorigano commented 11 months ago

IP Adapter Plus and IP Adapter Full are not supported in diffusers 0.24.0. If you want to use one of them, you can clone the repository and use the current version

sayakpaul commented 10 months ago

Or do pip install git+https://github.com/huggingface/diffusers.

github-actions[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.