Diffusion-ControlNet Bug: Incorrect Image Resizing for Non-Square Image Generation
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.
cc @asfiyab-nvidia