TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Diffusion-ControlNet Bug: Incorrect Image Resizing for Non-Square Image Generation

Open cha-noong opened this issue 1 year ago • 1 comments

Description

TensorRT diffusion-controlnet bug report

Environment

TensorRT Version: 10.4 (jetpack 6.1)

NVIDIA GPU: Jetson AGX Orin

NVIDIA Driver Version:

CUDA Version:

CUDNN Version:

Steps To Reproduce

I encountered a bug while running ControlNet in the Diffusion demo. The issue does not occur when generating square images like 512x512, but it arises when generating non-square images such as 512x768.

The root cause seems to be the PIL resize function in TensorRT/demo/Diffusion/demo_controlnet.py at lines 66, 74, 78, 82, 86, 90, and 94, where the width and height are swapped. The line:

input_images.append(canny_image.resize((args.height, args.width)))

should be corrected to:

input_images.append(canny_image.resize((args.width, args.height)))

After fixing this, the issue persists, which suggests that further code modifications might be needed for image preprocessing and export handling.

cha-noong avatar Oct 10 '24 02:10 cha-noong

cc @asfiyab-nvidia

yuanyao-nv avatar Oct 10 '24 17:10 yuanyao-nv