huggingface / huggingface/controlnet_aux

Image resize issue

Open
#84 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
497
Forks
104
PR merge metrics
No merged PRs in 30d

Description

Hi,
I have an issue with my output image which does not have the same dimensions as the input one.
Original image: 640x480
Output image: 576x512
Do you know why ?

here the sample :
```python
import numpy

from controlnet_aux.processor import MidasDetector
from PIL import Image

image_path = "d:/temp/cat.png"
model_path = "d:/model/dreamshaper-v8.0"

convertedImage = Image.open(image_path)
resolution = min(convertedImage.size)

processor = MidasDetector.from_pretrained(model_path)
controlnet_image = processor(
input_image=convertedImage,
a=numpy.pi * 2.0,
bg_th=0.1,
depth_and_normal=False,
detect_resolution=resolution,
image_resolution=resolution,
output_type='pil'
)

controlnet_image.save("d:/temp/cat_result.png")
```

![cat](https://github.com/patrickvonplaten/controlnet_aux/assets/148432890/f2a0df9a-b383-4274-a0f7-34adba8ce6d4)
![cat_result](https://github.com/patrickvonplaten/controlnet_aux/assets/148432890/a543a4cc-cc79-4586-abf1-741ee8d817e1)

Thank you!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.