Skip to content

Commit 94e2b9e

Browse files
authored
TensorRT 10.13.3 OSS Release (#4570)
Signed-off-by: Kevin Chen <[email protected]>
1 parent a471b2a commit 94e2b9e

File tree

81 files changed

+1548
-699
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1548
-699
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# TensorRT OSS Release Changelog
22

3+
## 10.13.3 GA - 2025-9-8
4+
- Added support for TensorRT API Capture and Replay feature, see the [developer guide](https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/advanced.html) for more information.
5+
- Demo changes
6+
- Added support for Flux Kontext pipeline.
7+
8+
39
## 10.13.2 GA - 2025-8-18
410
- Added support for CUDA 13.0, dropped support for CUDA 11.X
511
- Dropped support for Ubuntu 20.04

CMakeLists.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,37 @@ endif()
6666

6767
set(CMAKE_SKIP_BUILD_RPATH True)
6868

69-
# Set CUDA architectures before enabling CUDA language to avoid detection issues in containers
70-
if (DEFINED GPU_ARCHS AND NOT GPU_ARCHS STREQUAL "")
71-
message(STATUS "GPU_ARCHS defined as ${GPU_ARCHS}. Setting CUDA architectures for SM ${GPU_ARCHS}")
69+
# CUDA targets
70+
71+
if (DEFINED GPU_ARCHS)
72+
message(STATUS "GPU_ARCHS defined as ${GPU_ARCHS}. Generating CUDA code for SM ${GPU_ARCHS}")
7273
separate_arguments(GPU_ARCHS)
7374
foreach(SM IN LISTS GPU_ARCHS)
7475
list(APPEND CMAKE_CUDA_ARCHITECTURES "${SM}")
7576
endforeach()
7677
else()
77-
# Set default architectures for container builds where auto-detection fails
78-
set(CMAKE_CUDA_ARCHITECTURES 75 80 86 87 89 90)
78+
list(APPEND CMAKE_CUDA_ARCHITECTURES 75 80 86 87 89 90)
7979

8080
if(CUDA_VERSION VERSION_GREATER_EQUAL 12.8)
8181
list(APPEND CMAKE_CUDA_ARCHITECTURES 100 120)
8282
endif()
8383

84-
message(STATUS "Setting default CUDA architectures for container build: ${CMAKE_CUDA_ARCHITECTURES}")
84+
message(STATUS "GPU_ARCHS is not defined. Generating CUDA code for default SMs: ${CMAKE_CUDA_ARCHITECTURES}")
85+
endif()
86+
set(BERT_GENCODES)
87+
# Generate SASS for each architecture
88+
foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
89+
if (${arch} GREATER_EQUAL 75)
90+
set(BERT_GENCODES "${BERT_GENCODES} -gencode arch=compute_${arch},code=sm_${arch}")
91+
endif()
92+
set(GENCODES "${GENCODES} -gencode arch=compute_${arch},code=sm_${arch}")
93+
endforeach()
94+
95+
# Generate PTX for the last architecture in the list.
96+
list(GET CMAKE_CUDA_ARCHITECTURES -1 LATEST_SM)
97+
set(GENCODES "${GENCODES} -gencode arch=compute_${LATEST_SM},code=compute_${LATEST_SM}")
98+
if (${LATEST_SM} GREATER_EQUAL 75)
99+
set(BERT_GENCODES "${BERT_GENCODES} -gencode arch=compute_${LATEST_SM},code=compute_${LATEST_SM}")
85100
endif()
86101

87102
project(TensorRT
@@ -195,21 +210,6 @@ endif()
195210
set(CUDA_LIBRARIES ${CUDART_LIB})
196211

197212
############################################################################################
198-
set(BERT_GENCODES)
199-
# Generate SASS for each architecture
200-
foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
201-
if (${arch} GREATER_EQUAL 75)
202-
set(BERT_GENCODES "${BERT_GENCODES} -gencode arch=compute_${arch},code=sm_${arch}")
203-
endif()
204-
set(GENCODES "${GENCODES} -gencode arch=compute_${arch},code=sm_${arch}")
205-
endforeach()
206-
207-
# Generate PTX for the last architecture in the list.
208-
list(GET CMAKE_CUDA_ARCHITECTURES -1 LATEST_SM)
209-
set(GENCODES "${GENCODES} -gencode arch=compute_${LATEST_SM},code=compute_${LATEST_SM}")
210-
if (${LATEST_SM} GREATER_EQUAL 75)
211-
set(BERT_GENCODES "${BERT_GENCODES} -gencode arch=compute_${LATEST_SM},code=compute_${LATEST_SM}")
212-
endif()
213213

214214
if(NOT MSVC)
215215
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr -Xcompiler -Wno-deprecated-declarations")

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To build the TensorRT-OSS components, you will first need the following software
3232

3333
**TensorRT GA build**
3434

35-
- TensorRT v10.13.2.6
35+
- TensorRT v10.13.3.9
3636
- Available from direct download links listed below
3737

3838
**System Packages**
@@ -86,24 +86,24 @@ To build the TensorRT-OSS components, you will first need the following software
8686

8787
Else download and extract the TensorRT GA build from [NVIDIA Developer Zone](https://developer.nvidia.com) with the direct links below:
8888

89-
- [TensorRT 10.13.2.6 for CUDA 13.0, Linux x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.2/tars/TensorRT-10.13.2.6.Linux.x86_64-gnu.cuda-13.0.tar.gz)
90-
- [TensorRT 10.13.2.6 for CUDA 12.9, Linux x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.2/tars/TensorRT-10.13.2.6.Linux.x86_64-gnu.cuda-12.9.tar.gz)
91-
- [TensorRT 10.13.2.6 for CUDA 13.0, Windows x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.2/zip/TensorRT-10.13.2.6.Windows.win10.cuda-13.0.zip)
92-
- [TensorRT 10.13.2.6 for CUDA 12.9, Windows x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.2/zip/TensorRT-10.13.2.6.Windows.win10.cuda-12.9.zip)
89+
- [TensorRT 10.13.3.9 for CUDA 13.0, Linux x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.3/tars/TensorRT-10.13.3.9.Linux.x86_64-gnu.cuda-13.0.tar.gz)
90+
- [TensorRT 10.13.3.9 for CUDA 12.9, Linux x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.3/tars/TensorRT-10.13.3.9.Linux.x86_64-gnu.cuda-12.9.tar.gz)
91+
- [TensorRT 10.13.3.9 for CUDA 13.0, Windows x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.3/zip/TensorRT-10.13.3.9.Windows.win10.cuda-13.0.zip)
92+
- [TensorRT 10.13.3.9 for CUDA 12.9, Windows x86_64](https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.13.3/zip/TensorRT-10.13.3.9.Windows.win10.cuda-12.9.zip)
9393

9494
**Example: Ubuntu 22.04 on x86-64 with cuda-13.0**
9595

9696
```bash
9797
cd ~/Downloads
98-
tar -xvzf TensorRT-10.13.2.6.Linux.x86_64-gnu.cuda-13.0.tar.gz
99-
export TRT_LIBPATH=`pwd`/TensorRT-10.13.2.6
98+
tar -xvzf TensorRT-10.13.3.9.Linux.x86_64-gnu.cuda-13.0.tar.gz
99+
export TRT_LIBPATH=`pwd`/TensorRT-10.13.3.9
100100
```
101101

102102
**Example: Windows on x86-64 with cuda-12.9**
103103

104104
```powershell
105-
Expand-Archive -Path TensorRT-10.13.2.6.Windows.win10.cuda-12.9.zip
106-
$env:TRT_LIBPATH="$pwd\TensorRT-10.13.2.6\lib"
105+
Expand-Archive -Path TensorRT-10.13.3.9.Windows.win10.cuda-12.9.zip
106+
$env:TRT_LIBPATH="$pwd\TensorRT-10.13.3.9\lib"
107107
```
108108

109109
## Setting Up The Build Environment
@@ -124,16 +124,16 @@ For Linux platforms, we recommend that you generate a docker container for build
124124
./docker/build.sh --file docker/rockylinux8.Dockerfile --tag tensorrt-rockylinux8-cuda12.9
125125
```
126126

127-
**Example: Ubuntu 22.04 cross-compile for Jetson (aarch64) with cuda-12.9 (JetPack SDK)**
127+
**Example: Ubuntu 24.04 cross-compile for Jetson (aarch64) with cuda-13.0 (JetPack SDK)**
128128

129129
```bash
130-
./docker/build.sh --file docker/ubuntu-cross-aarch64.Dockerfile --tag tensorrt-jetpack-cuda12.9
130+
./docker/build.sh --file docker/ubuntu-cross-aarch64.Dockerfile --tag tensorrt-jetpack-cuda13.0
131131
```
132132

133-
**Example: Ubuntu 22.04 on aarch64 with cuda-12.9**
133+
**Example: Ubuntu 24.04 on aarch64 with cuda-13.0**
134134

135135
```bash
136-
./docker/build.sh --file docker/ubuntu-22.04-aarch64.Dockerfile --tag tensorrt-aarch64-ubuntu22.04-cuda12.9
136+
./docker/build.sh --file docker/ubuntu-24.04-aarch64.Dockerfile --tag tensorrt-aarch64-ubuntu24.04-cuda13.0
137137
```
138138

139139
2. #### Launch the TensorRT-OSS build container.
@@ -146,12 +146,13 @@ For Linux platforms, we recommend that you generate a docker container for build
146146
> <br> 2. [NVIDIA Container Toolkit](#prerequisites) is required for GPU access (running TensorRT applications) inside the build container.
147147
> <br> 3. `sudo` password for Ubuntu build containers is 'nvidia'.
148148
> <br> 4. Specify port number using `--jupyter <port>` for launching Jupyter notebooks.
149+
> <br> 5. Write permission to this folder is required as this folder will be mounted inside the docker container for uid:gid of 1000:1000.
149150
150151
## Building TensorRT-OSS
151152

152153
- Generate Makefiles and build
153154

154-
**Example: Linux (x86-64) build with default cuda-12.9**
155+
**Example: Linux (x86-64) build with default cuda-13.0**
155156

156157
```bash
157158
cd $TRT_OSSPATH
@@ -160,7 +161,7 @@ For Linux platforms, we recommend that you generate a docker container for build
160161
make -j$(nproc)
161162
```
162163

163-
**Example: Linux (aarch64) build with default cuda-12.9**
164+
**Example: Linux (aarch64) build with default cuda-13.0**
164165

165166
```bash
166167
cd $TRT_OSSPATH
@@ -169,27 +170,27 @@ For Linux platforms, we recommend that you generate a docker container for build
169170
make -j$(nproc)
170171
```
171172

172-
**Example: Native build on Jetson (aarch64) with cuda-12.9**
173+
**Example: Native build on Jetson Thor (aarch64) with cuda-13.0**
173174

174175
```bash
175176
cd $TRT_OSSPATH
176177
mkdir -p build && cd build
177-
cmake .. -DTRT_LIB_DIR=$TRT_LIBPATH -DTRT_OUT_DIR=`pwd`/out -DTRT_PLATFORM_ID=aarch64 -DCUDA_VERSION=12.9
178+
cmake .. -DTRT_LIB_DIR=$TRT_LIBPATH -DTRT_OUT_DIR=`pwd`/out -DTRT_PLATFORM_ID=aarch64 -DGPU_ARCHS=110
178179
CC=/usr/bin/gcc make -j$(nproc)
179180
```
180181

181182
> NOTE: C compiler must be explicitly specified via CC= for native aarch64 builds of protobuf.
182183
183-
**Example: Ubuntu 22.04 Cross-Compile for Jetson (aarch64) with cuda-12.9 (JetPack)**
184+
**Example: Ubuntu 24.04 Cross-Compile for Jetson Thor (aarch64) with cuda-13.0 (JetPack)**
184185

185186
```bash
186187
cd $TRT_OSSPATH
187188
mkdir -p build && cd build
188-
cmake .. -DCMAKE_TOOLCHAIN_FILE=$TRT_OSSPATH/cmake/toolchains/cmake_aarch64.toolchain -DCUDA_VERSION=12.9 -DCUDNN_LIB=/pdk_files/cudnn/usr/lib/aarch64-linux-gnu/libcudnn.so -DCUBLAS_LIB=/usr/local/cuda-12.9/targets/aarch64-linux/lib/stubs/libcublas.so -DCUBLASLT_LIB=/usr/local/cuda-12.9/targets/aarch64-linux/lib/stubs/libcublasLt.so -DTRT_LIB_DIR=/pdk_files/tensorrt/lib
189+
cmake .. -DTRT_LIB_DIR=$TRT_LIBPATH -DCMAKE_TOOLCHAIN_FILE=$TRT_OSSPATH/cmake/toolchains/cmake_aarch64_cross.toolchain -DGPU_ARCHS=110
189190
make -j$(nproc)
190191
```
191192

192-
**Example: Native builds on Windows (x86) with cuda-12.9**
193+
**Example: Native builds on Windows (x86) with cuda-13.0**
193194

194195
```bash
195196
cd $TRT_OSSPATH

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.13.2.6
1+
10.13.3.9

demo/Diffusion/README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This demo application ("demoDiffusion") showcases the acceleration of Stable Dif
77
### Clone the TensorRT OSS repository
88

99
```bash
10-
git clone [email protected]:NVIDIA/TensorRT.git -b release/10.13.2 --single-branch
10+
git clone [email protected]:NVIDIA/TensorRT.git -b release/10.13.3 --single-branch
1111
cd TensorRT
1212
```
1313

@@ -16,45 +16,37 @@ cd TensorRT
1616
Install nvidia-docker using [these intructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker).
1717

1818
```bash
19-
docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:25.01-py3 /bin/bash
19+
docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:25.08-py3 /bin/bash
2020
```
2121

22-
NOTE: The demo supports CUDA>=12
22+
NOTE: The demo supports CUDA>=12.0
2323

24-
### Install latest TensorRT release
24+
### Install the required packages
2525

2626
```bash
27-
python3 -m pip install --upgrade pip
28-
pip install --pre tensorrt-cu12
27+
source setup.sh
2928
```
3029

3130
Check your installed version using:
3231
`python3 -c 'import tensorrt;print(tensorrt.__version__)'`
3332

3433
> NOTE: Alternatively, you can download and install TensorRT packages from [NVIDIA TensorRT Developer Zone](https://developer.nvidia.com/tensorrt).
3534
36-
### Install required packages
37-
38-
```bash
39-
export TRT_OSSPATH=/workspace
40-
cd $TRT_OSSPATH/demo/Diffusion
41-
pip3 install -r requirements.txt
42-
```
4335

4436
> NOTE: demoDiffusion has been tested on systems with NVIDIA H100, A100, L40, T4, and RTX4090 GPUs, and the following software configuration.
4537
4638
```
47-
diffusers 0.31.0
48-
onnx 1.15.0
39+
diffusers 0.35.0
40+
onnx 1.18.0
4941
onnx-graphsurgeon 0.5.2
50-
onnxruntime 1.16.3
51-
polygraphy 0.49.9
52-
tensorrt 10.13.2.6
42+
onnxruntime 1.19.2
43+
polygraphy 0.49.22
44+
tensorrt 10.13.3.9
5345
tokenizers 0.13.3
54-
torch 2.2.0
55-
transformers 4.42.2
46+
torch 2.8.0a0+5228986c39.nv25.6
47+
transformers 4.52.4
5648
controlnet-aux 0.0.6
57-
nvidia-modelopt 0.15.1
49+
nvidia-modelopt 0.31.0
5850
```
5951

6052
# Running demoDiffusion
@@ -210,7 +202,7 @@ Run the command below to generate an image using Stable Diffusion 3 and Stable D
210202
python3 demo_txt2img_sd3.py "A vibrant street wall covered in colorful graffiti, the centerpiece spells \"SD3 MEDIUM\", in a storm of colors" --version sd3 --hf-token=$HF_TOKEN
211203

212204
# Stable Diffusion 3.5-medium
213-
python3 demo_txt2img_sd35.py "a beautiful photograph of Mt. Fuji during cherry blossom" --version=3.5-medium --denoising-steps=30 --guidance-scale 3.5 --hf-token=$HF_TOKEN --bf16
205+
python3 demo_txt2img_sd35.py "a beautiful photograph of Mt. Fuji during cherry blossom" --version=3.5-medium --denoising-steps=30 --guidance-scale 3.5 --hf-token=$HF_TOKEN --bf16 --download-onnx-models
214206

215207
# Stable Diffusion 3.5-large
216208
python3 demo_txt2img_sd35.py "a beautiful photograph of Mt. Fuji during cherry blossom" --version=3.5-large --denoising-steps=30 --guidance-scale 3.5 --hf-token=$HF_TOKEN --bf16 --download-onnx-models
@@ -234,13 +226,13 @@ Note that a denosing-percentage is applied to the number of denoising-steps when
234226

235227
```bash
236228
# Depth
237-
python3 demo_controlnet_sd35.py "a photo of a man" --controlnet-type depth --hf-token=$HF_TOKEN --denoising-steps 40 --guidance-scale 4.5 --bf16
229+
python3 demo_controlnet_sd35.py "a photo of a man" --controlnet-type depth --hf-token=$HF_TOKEN --denoising-steps 40 --guidance-scale 4.5 --bf16 --download-onnx-models
238230

239231
# Canny
240-
python3 demo_controlnet_sd35.py "A Night time photo taken by Leica M11, portrait of a Japanese woman in a kimono, looking at the camera, Cherry blossoms" --controlnet-type canny --hf-token=$HF_TOKEN --denoising-steps 60 --guidance-scale 3.5 --bf16
232+
python3 demo_controlnet_sd35.py "A Night time photo taken by Leica M11, portrait of a Japanese woman in a kimono, looking at the camera, Cherry blossoms" --controlnet-type canny --hf-token=$HF_TOKEN --denoising-steps 60 --guidance-scale 3.5 --bf16 --download-onnx-models
241233

242234
# Blur
243-
python3 demo_controlnet_sd35.py "generated ai art, a tiny, lost rubber ducky in an action shot close-up, surfing the humongous waves, inside the tube, in the style of Kelly Slater" --controlnet-type blur --hf-token=$HF_TOKEN --denoising-steps 60 --guidance-scale 3.5 --bf16
235+
python3 demo_controlnet_sd35.py "generated ai art, a tiny, lost rubber ducky in an action shot close-up, surfing the humongous waves, inside the tube, in the style of Kelly Slater" --controlnet-type blur --hf-token=$HF_TOKEN --denoising-steps 60 --guidance-scale 3.5 --bf16 --download-onnx-models
244236
```
245237

246238
### Generate a video guided by an initial image using Stable Video Diffusion
@@ -414,6 +406,21 @@ python3 demo_txt2img_flux.py "A painting of a barista creating an intricate latt
414406
# FP8
415407
python3 demo_txt2img_flux.py "A painting of a barista creating an intricate latte art design, with the 'Coffee Creations' logo skillfully formed within the latte foam. In a watercolor style, AQUACOLTOK. White background." --hf-token=$HF_TOKEN --lora-path "SebastianBodza/flux_lora_aquarel_watercolor" --lora-weight 1.0 --onnx-dir=onnx-flux-lora --engine-dir=engine-flux-lora --fp8
416408
```
409+
410+
#### 5. Edit an Image using Flux Kontext
411+
412+
```bash
413+
wget https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png
414+
415+
# BF16
416+
python3 demo_img2img_flux.py "Add a hat to the cat" --version="flux.1-kontext-dev" --hf-token=$HF_TOKEN --guidance-scale 2.5 --kontext-image cat.png --denoising-steps 28 --bf16 --onnx-dir onnx-kontext --engine-dir engine-kontext --download-onnx-models
417+
418+
# FP8
419+
python3 demo_img2img_flux.py "Add a hat to the cat" --version="flux.1-kontext-dev" --hf-token=$HF_TOKEN --guidance-scale 2.5 --kontext-image cat.png --denoising-steps 28 --fp8 --onnx-dir onnx-kontext-fp8 --engine-dir engine-kontext-fp8 --download-onnx-models --quantization-level 4
420+
421+
# FP4
422+
python3 demo_img2img_flux.py "Add a hat to the cat" --version="flux.1-kontext-dev" --hf-token=$HF_TOKEN --guidance-scale 2.5 --kontext-image cat.png --denoising-steps 28 --fp4 --onnx-dir onnx-kontext-fp4 --engine-dir engine-kontext-fp4 --download-onnx-models
423+
```
417424
---
418425

419426
#### 5. Export ONNX Models Only (Skip Inference)

demo/Diffusion/demo_controlnet.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,49 +78,49 @@ def parseArgs():
7878
raise ValueError(
7979
f"This demo supports ControlNets for v1.5 and SDXL base pipelines only. Version provided: {args.version}"
8080
)
81-
input_images.append(canny_image.resize((args.height, args.width)))
81+
input_images.append(canny_image.resize((args.width, args.height)))
8282
elif controlnet == "normal":
8383
normal_image = image_module.download_image(
8484
"https://huggingface.co/lllyasviel/sd-controlnet-normal/resolve/main/images/toy.png"
8585
)
8686
normal_image = controlnet_aux.NormalBaeDetector.from_pretrained("lllyasviel/Annotators")(normal_image)
87-
input_images.append(normal_image.resize((args.height, args.width)))
87+
input_images.append(normal_image.resize((args.width, args.height)))
8888
elif controlnet == "depth":
8989
depth_image = image_module.download_image(
9090
"https://huggingface.co/lllyasviel/sd-controlnet-depth/resolve/main/images/stormtrooper.png"
9191
)
9292
depth_image = controlnet_aux.LeresDetector.from_pretrained("lllyasviel/Annotators")(depth_image)
93-
input_images.append(depth_image.resize((args.height, args.width)))
93+
input_images.append(depth_image.resize((args.width, args.height)))
9494
elif controlnet == "hed":
9595
hed_image = image_module.download_image(
9696
"https://huggingface.co/lllyasviel/sd-controlnet-hed/resolve/main/images/man.png"
9797
)
9898
hed_image = controlnet_aux.HEDdetector.from_pretrained("lllyasviel/Annotators")(hed_image)
99-
input_images.append(hed_image.resize((args.height, args.width)))
99+
input_images.append(hed_image.resize((args.width, args.height)))
100100
elif controlnet == "mlsd":
101101
mlsd_image = image_module.download_image(
102102
"https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png"
103103
)
104104
mlsd_image = controlnet_aux.MLSDdetector.from_pretrained("lllyasviel/Annotators")(mlsd_image)
105-
input_images.append(mlsd_image.resize((args.height, args.width)))
105+
input_images.append(mlsd_image.resize((args.width, args.height)))
106106
elif controlnet == "openpose":
107107
openpose_image = image_module.download_image(
108108
"https://huggingface.co/lllyasviel/sd-controlnet-openpose/resolve/main/images/pose.png"
109109
)
110110
openpose_image = controlnet_aux.OpenposeDetector.from_pretrained("lllyasviel/Annotators")(openpose_image)
111-
input_images.append(openpose_image.resize((args.height, args.width)))
111+
input_images.append(openpose_image.resize((args.width, args.height)))
112112
elif controlnet == "scribble":
113113
scribble_image = image_module.download_image(
114114
"https://huggingface.co/lllyasviel/sd-controlnet-scribble/resolve/main/images/bag.png"
115115
)
116116
scribble_image = controlnet_aux.HEDdetector.from_pretrained("lllyasviel/Annotators")(scribble_image, scribble=True)
117-
input_images.append(scribble_image.resize((args.height, args.width)))
117+
input_images.append(scribble_image.resize((args.width, args.height)))
118118
elif controlnet == "seg":
119119
seg_image = image_module.download_image(
120120
"https://huggingface.co/lllyasviel/sd-controlnet-seg/resolve/main/images/house.png"
121121
)
122122
seg_image = controlnet_aux.SamDetector.from_pretrained("ybelkada/segment-anything", subfolder="checkpoints")(seg_image)
123-
input_images.append(seg_image.resize((args.height, args.width)))
123+
input_images.append(seg_image.resize((args.width, args.height)))
124124
else:
125125
raise ValueError(f"You should implement the conditonal image of this controlnet: {controlnet}")
126126
assert len(input_images) > 0

0 commit comments

Comments
 (0)