huggingface / controlnet_aux

Apache License 2.0
371 stars 82 forks source link

processor = Processor('depth_zoe'), processed_image = processor(init_image, to_pil=True) error #111

Open sanerone695 opened 1 month ago

sanerone695 commented 1 month ago

import requests from PIL import Image from io import BytesIO

from controlnet_aux.processor import Processor

url = "https://huggingface.co/lllyasviel/sd-controlnet-openpose/resolve/main/images/pose.png" response = requests.get(url) img = Image.open(BytesIO(response.content)).convert("RGB")

processor_id = 'depth_zoe' processor = Processor(processor_id)

processed_image = processor(img, to_pil=True)

TypeError: expected size to be one of int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int], but got size with types [<class 'numpy.int64'>, <class 'numpy.int64'>]

asomoza commented 1 month ago

this is a numpy known problem, the only fix right now is to downgrade numpy to a < 2.0 version

sanerone695 commented 1 month ago

The current numpy version is 1.26.2

asomoza commented 1 month ago

I can't reproduce your error then, with just a copy & paste of your exact code and with numpy 1.26.4 it works without any issue.