tencent-ailab / IP-Adapter

The image prompt adapter is designed to enable a pretrained text-to-image diffusion model to generate images with image prompt.
Apache License 2.0
4.52k stars 298 forks source link

Update ip_adapter.py #220

Open salisbury-espinosa opened 6 months ago

salisbury-espinosa commented 6 months ago

fix:

File "/ip-adapter/env/lib/python3.10/site-packages/ip_adapter/ip_adapter.py", line 6, in <module>
    from diffusers.pipelines.controlnet import MultiControlNetModel
ImportError: cannot import name 'MultiControlNetModel' from 'diffusers.pipelines.controlnet' (ip-adapter/env/lib/python3.10/site-packages/diffusers/pipelines/controlnet/__init__.py)
xiaohu2015 commented 6 months ago

your diffusers version?

YZBPXX commented 6 months ago

I have also encountered this issue and resolved it by installing 'transformers.' Without it, even installing the recommended 'diffusers=0.22.1' unable to import successfully

xiaohu2015 commented 6 months ago

I have also encountered this issue and resolved it by installing 'transformers.' Without it, even installing the recommended 'diffusers=0.22.1' unable to import successfully

i think the current code has no problem

salisbury-espinosa commented 6 months ago

your diffusers version?

0.25.0

xiaohu2015 commented 6 months ago

your diffusers version?

0.25.0

but this version should work for "from diffusers.pipelines.controlnet import MultiControlNetModel" https://github.com/huggingface/diffusers/blob/v0.25.0/src/diffusers/pipelines/controlnet/__init__.py#L52