RTX Engine Dynamic Shape Config
The upscaler knob the original pack hid from you
- CONFIG
This node exists because somebody got annoyed. The original ComfyUI-Upscaler-Tensorrt hardcoded the resolution envelope its engines could handle - 256x256 up to 1280x1280, no questions asked. This fork, ComfyUI-Upscaler-TensorRT-RTX, exists specifically to hand you that knob back. RTX Engine Dynamic Shape Config is the knob.
Think of a TensorRT engine as a model compiled for your exact GPU and a range of input sizes. That range has three points per dimension: min (smallest it'll accept), opt (the size it's tuned for, where you get the best speed), and max (the biggest it'll take). The engine bakes this envelope in at build time - you can't change it afterward without rebuilding. The stock defaults are 256/512/1280, which covers most workflows but dies the moment you want a 1536-wide output.
What you actually set
Nine inputs, and honestly only two of them matter most of the time:
- width_max / height_max - this is the one people hit. These set the ceiling, and the ceiling is what decides VRAM during engine build. Widening them means the builder has to optimize kernels for bigger tensors, which is slower and hungrier. If a build fails with an out-of-memory error, this pair is your first lever.
- width_opt / height_opt - the resolution you actually upscale at most of the time. Set it to your typical output and the engine runs fastest there.
- width_min / height_min - lower bound. Leave at 256 unless you know why you're changing it.
- batch_min / batch_opt / batch_max - batch size, and here the truth is simple: this fork runs one image at a time anyway. Leave all three at 1.
The node validates that min ≤ opt ≤ max for every dimension, so you can't build a nonsense profile. All width/height values are clamped to 4096.
How it fits
The only output is CONFIG, a TRT_RTX_ENGINE_CONFIG struct. Wire it into the RTX Engine Loader's optional config input - the Loader reads these bounds, embeds them in the engine filename, and passes them to the TensorRT builder as the optimization profile. No config wired? The Loader silently uses these same defaults, so you only need this node when the defaults don't fit your output size.
Install & gotchas
Installation is the pack-wide story, covered on the other two nodes, but the short version: this pack isn't in the ComfyUI Manager registry yet, so you install via Manager's "Install via Git URL" button or git clone it into custom_nodes, then pip install -r requirements.txt with ComfyUI's Python. It needs a CUDA Toolkit install and an RTX-class GPU - Tensor Cores are non-negotiable.
Where people get burned: they widen width_max to 2048 for a big upscale, the engine build eats several GB of VRAM on top of whatever the diffusion model is holding, and the build fails. If that's you, either shrink the max back down or build the engine in an empty workflow first, then use the cached .trt. Remember every GPU driver or tensorrt_rtx update invalidates built engines, so a "suddenly rebuilding" run after an update is normal, not a bug.
This is a config node - it does nothing alone, and that's fine. It's the difference between a 1280px ceiling and output sizes you actually need, and it's the entire reason the fork exists.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| width_min | INT | 2561–4096 | — |
| width_opt | INT | 5121–4096 | — |
| width_max | INT | 12801–4096 | — |
| height_min | INT | 2561–4096 | — |
| height_opt | INT | 5121–4096 | — |
| height_max | INT | 12801–4096 | — |
| batch_min | INT | 1 | — |
| batch_opt | INT | 1 | — |
| batch_max | INT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONFIG | TRT_RTX_ENGINE_CONFIG | — |