Currently I am just copy pasting the code for Inapinting using SDXL and IPAdapter as provided in the IPAdapter section. The code is:
Importing required packages
import torch
from diffusers import AutoPipelineForImage2Image
from PIL import Image
import matplotlib.pyplot as plt
print(âThe Libraries are loaded Successfullyâ)
Creating the pieline using SDXL and IPAdapter
pipeline = AutoPipelineForImage2Image.from_pretrained(
âstabilityai/stable-diffusion-xl-base-1.0â,
torch_dtype=torch.float16
).to(âcudaâ)
print(âThe Stable Diffusion XL pipeline created successfullyâ)
Attaching the IP Adapter pipeline
pipeline.load_ip_adapter(
âh94/IP-Adapterâ,
subfolder=âsdxl_modelsâ,
weight_name=âip-adapter_sdxl.binâ)
print(âThe IP Adapter is attached with the SDXL pipelineâ)
Setting the IP Adapter guidance scale
pipeline.set_ip_adapter_scale(0.6)
Setting the mask image, saree image and reference image for IP Adapter
mask_image = Image.open(r"C:\Users\Webbies\Jupyter_Notebooks\Titan_Saree_VTON\Inverted_Saree_Masks.png")
image = Image.open(r"C:\Users\Webbies\Jupyter_Notebooks\Titan_Saree_VTON\Source_Model.jpg")
ip_image = Image.open(r"C:\Users\Webbies\Jupyter_Notebooks\Titan_Saree_VTON\Control_Image.jpg")
print(âImages are read successfullyâ)
Get the output image
output = pipeline(
prompt=âA mature heavy weight plus sized indian womanâ,
image=image,
mask_image=mask_image,
ip_adapter_image=ip_image,).images[0]
print(âThe output image is generatedâ)
Visualize the output
print(âThe output image visualization process starts from hereâ)
plt.imshow(output)
plt.axis(âoffâ)
plt.show()
The above code gives me the error:
RuntimeError: Failed to import diffusers.pipelines.auto_pipeline because of the following error (look up to see its traceback):
Could not import module âAutoImageProcessorâ. Are this objectâs requirements defined correctly?
Is this the issue with the version of diffusers? Or what is the problem here? I have recently installed safetensors and xformers, can this be the problem?