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.5k stars 296 forks source link

IPAdaptor for MultiControlNet #22

Open 0sparsh2 opened 10 months ago

0sparsh2 commented 10 months ago

First of all, this work is amazing truly! Could there also be a support for multicontrol in ipadapters. I was trying canny and inpaint controlnets and faced errors.

xiaohu2015 commented 10 months ago

@0sparsh2 hi, can you show you error message?

seakforzq commented 9 months ago

ImportError: cannot import name 'MultiControlNetModel' from 'diffusers.pipelines.controlnet' (/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/controlnet/init.py) when I try the ip_adapter_demo

xiaohu2015 commented 9 months ago

@seakforzq maybe you can update the version of diffusers?

Ragunath-planetre commented 9 months ago

Here also same issue, I have tried with latest version of diffusers 0.21.2 and tried recommended version too 0.19.3. but still issue exists.

StiflerDante commented 9 months ago

@seakforzq @Ragunath-planetre

You can try this one instead, worked for me: from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel

davidco commented 8 months ago

I found that this import error also occurs if you have not installed transformers. Try:

pip install transformers

(Several items are imported from transformers in ip_adapter.py.)

niuniulla commented 7 months ago

You have to install torch and transformers before installing diffusers. You can refer to the diffusers project (https://github.com/huggingface/diffusers), in the init file under "diffusers/src/diffusers/pipelines/controlnet" folder, from the 17th line wrote:

try:
    if not (is_transformers_available() and is_torch_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from ...utils import dummy_torch_and_transformers_objects  # noqa F403