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
5.08k stars 331 forks source link

Can IP adapter faceid plus adapt to stablediffusion Img2Img pipeline? #282

Open bent1e opened 8 months ago

xiaohu2015 commented 8 months ago

yes, it should can

lixinjie97 commented 7 months ago

I tried it and it didn't work, How do you use it. image @xiaohu2015 @bent1e

aycaecemgul commented 6 months ago

Hi! I tried the same thing but got an error that i could not fix. RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1, 1, 512] because the unspecified dimension size -1 can be any value and is ambiguous Here's a notebook about it: https://colab.research.google.com/drive/1KpluifUCOxJbVl4rC4BoEBSRsyYfaDDh?usp=sharing

aycax commented 6 months ago

If anyone stumbles upon this error, i fixed it by using both pil_image and image parameters while generating images.

images = ip_model.generate(
     prompt=prompt, negative_prompt=negative_prompt, pil_image=image_resized, image=image_resized, face_image=face_image, guidance_scale=5,
     faceid_embeds=faceid_embeds, shortcut=True, s_scale=1.0,
     num_samples=4, width=512, height=512, num_inference_steps=40, seed=[1511,1621,1713,1814 ]
)