haofanwang / ControlNet-for-Diffusers

Transfer the ControlNet with any basemodel in diffusers🔥
MIT License
813 stars 48 forks source link

Acceptable image size of `controlnet_hint` is (512, 512) but is (1024, 512) #36

Closed sawyer7246 closed 1 year ago

sawyer7246 commented 1 year ago

Hi, I am using the StableDiffusionControlNetInpaintPipeline that you provided in this repo to inpaint an image of 1024x512. However, I encountered such an error:

File ~/.local/lib/python3.8/site-packages/diffusers-0.13.0.dev0-py3.8.egg/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet_inpaint.py:550, in StableDiffusionControlNetInpaintPipeline.controlnet_hint_conversion(self, controlnet_hint, height, width, num_images_per_prompt)
    548         return self.controlnet_hint_conversion(controlnet_hint, height, width, num_images_per_prompt)
    549     else:
--> 550         raise ValueError(
    551             f"Acceptable image size of `controlnet_hint` is ({width}, {height}) but is {controlnet_hint.size}"
    552         )
    553 else:
    554     raise ValueError(
    555         f"Acceptable type of `controlnet_hint` are any of torch.Tensor, np.ndarray, PIL.Image.Image but is {type(controlnet_hint)}"
    556     )

ValueError: Acceptable image size of `controlnet_hint` is (512, 512) but is (1024, 512)

pls. help!

sawyer7246 commented 1 year ago

All right, I noticed the height and width params...