Error while Using the Image2Image pipeline

#9
by aniket2025 - opened

I am trying to implement the Image2Image pipeline of the Kandinsky as:

from diffusers import AutoPipelineForImage2Image
from PIL import Image
import torch

pipe = AutoPipelineForImage2Image.from_pretrained("kandinsky-community/kandinsky-3", variant="fp16", torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

prompt = "Change the woman in the picture with healthy overweight mature Indian woman"
image = Image.open("/content/Source_Model.jpg").convert("RGB")

generator = torch.Generator(device="cpu").manual_seed(0)
image = pipe(prompt, image = image, strength = 0.75, num_inference_steps = 25, generator = generator).images[0]

image.show()
image.save("/content/Kandinsky_Image.jpg")

In the above process i am getting an error, that says:
partially initialized module 'torch._dynamo' has no attribute 'decorators' (most likely due to a circular import)

I tried to uninstall and then re-install the torch (2.7.1 with cuda 12.6), but the error persists

How to solve this issue?

Sign up or log in to comment