Instructions to use ussoewwin/CCSR-TensorRT-Engine with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use ussoewwin/CCSR-TensorRT-Engine with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -8,19 +8,16 @@ tags:
|
|
| 8 |
- controlnet
|
| 9 |
- tensorrt
|
| 10 |
- rtx
|
| 11 |
-
- convrot
|
| 12 |
-
- int8
|
| 13 |
-
- quantized
|
| 14 |
- comfyui
|
| 15 |
pipeline_tag: image-to-image
|
| 16 |
---
|
| 17 |
|
| 18 |
-
# CCSR:
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
> π¦ **ComfyUI Loader & Upscaler Extension:**
|
| 23 |
-
> All nodes supporting
|
| 24 |
> π **[https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker](https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker)**
|
| 25 |
|
| 26 |
---
|
|
@@ -29,28 +26,24 @@ High-fidelity **ConvRot INT8** quantized weights and ultra-fast **TensorRT RTX**
|
|
| 29 |
|
| 30 |
Creative Content Super-Resolution (CCSR) is a diffusion-based super-resolution framework leveraging a Controlled UNet and ControlNet structure to synthesize rich photorealistic textures and fine details.
|
| 31 |
|
| 32 |
-
This repository provides
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
- Fuses the ControlNet and Controlled UNet denoising computation into an optimized NVIDIA TensorRT RTX engine.
|
| 42 |
-
- Fixed 512px tile resolution (64Γ64 latent tile) executing at ~**24 ms/step** (~**4.7Γ speedup** over PyTorch FP16 at ~113 ms/step on modern RTX GPUs).
|
| 43 |
-
- Engine-only operation via companion auxiliary weights (`ccsr_trt_aux.safetensors`, VAE + condition encoder), requiring no full checkpoint download.
|
| 44 |
|
| 45 |
---
|
| 46 |
|
| 47 |
## π¦ Available Files
|
| 48 |
|
| 49 |
-
| Filename | Description |
|
| 50 |
| :--- | :--- | :--- | :--- | :--- | :--- |
|
| 51 |
-
| `
|
| 52 |
-
| `
|
| 53 |
-
| `ccsr_trt_aux.safetensors` | Auxiliary Weights for TRT Engine | FP16 VAE AutoencoderKL + Condition Encoder | ~450 MB | `custom_nodes/.../nodes/CCSR/trt_engines/` | Apache-2.0 |
|
| 54 |
|
| 55 |
---
|
| 56 |
|
|
@@ -58,53 +51,48 @@ This repository provides two high-performance deployment options for CCSR:
|
|
| 58 |
|
| 59 |
Measurements conducted on an NVIDIA RTX 4090 / RTX 5090 environment:
|
| 60 |
|
| 61 |
-
| Execution Mode |
|
| 62 |
| :--- | :--- | :--- | :--- | :--- |
|
| 63 |
-
| **Stock CCSR (FP16 PyTorch)** | ~3.2 GB | ~3.8 GiB | ~113 ms / step | Baseline
|
| 64 |
-
| **CCSR
|
| 65 |
-
| **CCSR TensorRT RTX** | ~1.4 GB (+ 0.45 GB aux) | ~2.2 GiB | ~**24 ms / step** (**~4.7Γ faster**) | ControlNet + UNet fused TRT engine |
|
| 66 |
|
| 67 |
---
|
| 68 |
|
| 69 |
## π Usage in ComfyUI
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
* **ComfyUI Extension / Loader Repository:** [https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker](https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker)
|
| 74 |
-
|
| 75 |
-
### Installation
|
| 76 |
-
|
| 77 |
-
Clone the extension repository into your `ComfyUI/custom_nodes` directory:
|
| 78 |
-
|
| 79 |
-
```bash
|
| 80 |
-
cd ComfyUI/custom_nodes
|
| 81 |
-
git clone https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker.git
|
| 82 |
-
```
|
| 83 |
-
|
| 84 |
-
### Method 1: ConvRot INT8 (PyTorch Execution)
|
| 85 |
-
|
| 86 |
-
<p align="center">
|
| 87 |
-
<img src="https://huggingface.co/ussoewwin/CCSR-ConvRot-INT8-and-TensorRT-Engine/resolve/main/png/ccsr.png" alt="CCSR PyTorch / ConvRot INT8 Workflow in ComfyUI" width="800">
|
| 88 |
-
</p>
|
| 89 |
-
|
| 90 |
-
1. Place `real-world_ccsr_convrot_int8.safetensors` in:
|
| 91 |
-
- `ComfyUI/models/checkpoints/` (for `CCSR_Model_Select`) or
|
| 92 |
-
- `ComfyUI/models/CCSR/` (for `DownloadAndLoadCCSRModel`)
|
| 93 |
-
2. In ComfyUI, add **`CCSR_Model_Select`** or **`DownloadAndLoad CCSRModel`**. The node automatically detects the `comfy_quant` INT8 markers and activates quantized ops (`QuantConv2d` & `mixed_precision_ops`).
|
| 94 |
-
3. Connect the output `ccsr_model` to **`CCSR_Upscale`**.
|
| 95 |
-
4. Configure upscale parameters (`scale_by`, `tile_size=512`, `tile_stride=256`, color correction `adain`/`wavelet`).
|
| 96 |
|
| 97 |
-
###
|
| 98 |
|
| 99 |
<p align="center">
|
| 100 |
-
<img src="https://huggingface.co/ussoewwin/CCSR-
|
| 101 |
</p>
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
---
|
| 110 |
|
|
@@ -113,5 +101,5 @@ git clone https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker.git
|
|
| 113 |
- **Original CCSR Implementation & Weights**: [csslc/CCSR](https://github.com/csslc/CCSR) (Apache-2.0 License)
|
| 114 |
- **Research Paper**: *"Creative Content Super-Resolution with Pre-trained Diffusion Model"* by Liang et al.
|
| 115 |
- **ComfyUI CCSR Node Foundation**: [kijai/ComfyUI-CCSR](https://github.com/kijai/ComfyUI-CCSR) & [Kijai/ccsr-safetensors](https://huggingface.co/Kijai/ccsr-safetensors) (Apache-2.0 License)
|
| 116 |
-
- **
|
| 117 |
- **License**: **Apache-2.0**
|
|
|
|
| 8 |
- controlnet
|
| 9 |
- tensorrt
|
| 10 |
- rtx
|
|
|
|
|
|
|
|
|
|
| 11 |
- comfyui
|
| 12 |
pipeline_tag: image-to-image
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# CCSR: TensorRT RTX Acceleration Engine
|
| 16 |
|
| 17 |
+
Ultra-fast **TensorRT RTX** execution engine and auxiliary modules for **CCSR (Creative Content Super-Resolution)**, designed for real-time generative image upscaling in **ComfyUI**.
|
| 18 |
|
| 19 |
> π¦ **ComfyUI Loader & Upscaler Extension:**
|
| 20 |
+
> All nodes supporting TensorRT engine execution are available in:
|
| 21 |
> π **[https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker](https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker)**
|
| 22 |
|
| 23 |
---
|
|
|
|
| 26 |
|
| 27 |
Creative Content Super-Resolution (CCSR) is a diffusion-based super-resolution framework leveraging a Controlled UNet and ControlNet structure to synthesize rich photorealistic textures and fine details.
|
| 28 |
|
| 29 |
+
This repository provides an optimized **NVIDIA TensorRT RTX Engine** implementation for CCSR:
|
| 30 |
|
| 31 |
+
- **Fused Denoising Engine (`ccsr_apply_f16io.rtxplan`)**:
|
| 32 |
+
- Fuses the ControlNet and Controlled UNet denoising computation into a single compiled TensorRT engine.
|
| 33 |
+
- Fixed 512px tile resolution (64Γ64 latent tile) executing at ~**24 ms/step** (~**4.7Γ speedup** over PyTorch FP16 at ~113 ms/step on modern RTX GPUs).
|
| 34 |
+
- Synchronized stream execution on current PyTorch CUDA streams to eliminate race conditions and deadlocks.
|
| 35 |
+
- **Engine-Only Deployment (`ccsr_trt_aux.safetensors`)**:
|
| 36 |
+
- Contains only the essential companion modules: FP16 AutoencoderKL (VAE encoder/decoder) and condition encoder.
|
| 37 |
+
- Automatically loaded alongside the engine, eliminating the need to download large full checkpoints (~3.2 GB saved).
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
---
|
| 40 |
|
| 41 |
## π¦ Available Files
|
| 42 |
|
| 43 |
+
| Filename | Description | Architecture / Components | File Size | Recommended Location | License |
|
| 44 |
| :--- | :--- | :--- | :--- | :--- | :--- |
|
| 45 |
+
| `ccsr_apply_f16io.rtxplan` | TensorRT Fused Denoising Engine | ControlNet + UNet fused RTX Engine (Tile 512px / Latent 64Γ64) | ~1.4 GB | `custom_nodes/.../nodes/CCSR/trt_engines/` | Apache-2.0 |
|
| 46 |
+
| `ccsr_trt_aux.safetensors` | TRT Auxiliary Weights | FP16 VAE AutoencoderKL + Condition Encoder | ~450 MB | `custom_nodes/.../nodes/CCSR/trt_engines/` | Apache-2.0 |
|
|
|
|
| 47 |
|
| 48 |
---
|
| 49 |
|
|
|
|
| 51 |
|
| 52 |
Measurements conducted on an NVIDIA RTX 4090 / RTX 5090 environment:
|
| 53 |
|
| 54 |
+
| Execution Mode | Files Required | VRAM Overhead (Denoising) | Step Latency (Tile 512) | Speedup |
|
| 55 |
| :--- | :--- | :--- | :--- | :--- |
|
| 56 |
+
| **Stock CCSR (FP16 PyTorch)** | Full Checkpoint (~3.2 GB) | ~3.8 GiB | ~113 ms / step | 1.0Γ (Baseline) |
|
| 57 |
+
| **CCSR TensorRT RTX** | Engine + Aux (~1.85 GB total) | ~2.2 GiB | ~**24 ms / step** | **~4.7Γ faster** |
|
|
|
|
| 58 |
|
| 59 |
---
|
| 60 |
|
| 61 |
## π Usage in ComfyUI
|
| 62 |
|
| 63 |
+
TensorRT engine execution for CCSR is integrated natively into the **[ComfyUI-NunchakuFluxLoraStacker](https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker)** custom-node pack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
### Workflow Example
|
| 66 |
|
| 67 |
<p align="center">
|
| 68 |
+
<img src="https://huggingface.co/ussoewwin/CCSR-TensorRT-Engine/resolve/main/png/ccsrtensor.png" alt="CCSR TensorRT RTX Engine Workflow in ComfyUI" width="800">
|
| 69 |
</p>
|
| 70 |
|
| 71 |
+
### Installation & Setup
|
| 72 |
+
|
| 73 |
+
1. **Install the Custom Node Pack**:
|
| 74 |
+
```bash
|
| 75 |
+
cd ComfyUI/custom_nodes
|
| 76 |
+
git clone https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker.git
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
2. **Place Engine & Aux Files**:
|
| 80 |
+
Download both `ccsr_apply_f16io.rtxplan` and `ccsr_trt_aux.safetensors` and place them directly into the engine directory:
|
| 81 |
+
```
|
| 82 |
+
ComfyUI/custom_nodes/ComfyUI-NunchakuFluxLoraStacker/nodes/CCSR/trt_engines/
|
| 83 |
+
βββ ccsr_apply_f16io.rtxplan
|
| 84 |
+
βββ ccsr_trt_aux.safetensors
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
3. **In ComfyUI**:
|
| 88 |
+
- Add **`Load CCSR Model (TensorRT)`** (`LoadCCSRModelTensorRT`). The node automatically discovers `.rtxplan` files in `trt_engines/` and loads the companion `ccsr_trt_aux.safetensors`.
|
| 89 |
+
- Connect the `ccsr_model` output to **`CCSR Upscale (TRT)`** (`CCSR_Upscale_TRT`).
|
| 90 |
+
- Connect an input image to `image`.
|
| 91 |
+
- Configure upscale parameters:
|
| 92 |
+
- `tile_size`: 512 (fixed to match the compiled static engine shape)
|
| 93 |
+
- `tile_stride`: 256 (recommended for seamless blending)
|
| 94 |
+
- `color_fix_type`: `adain` (or `wavelet` / `none`)
|
| 95 |
+
- `steps`: Effective diffusion step count (densified schedule guarantees exact execution of requested step count)
|
| 96 |
|
| 97 |
---
|
| 98 |
|
|
|
|
| 101 |
- **Original CCSR Implementation & Weights**: [csslc/CCSR](https://github.com/csslc/CCSR) (Apache-2.0 License)
|
| 102 |
- **Research Paper**: *"Creative Content Super-Resolution with Pre-trained Diffusion Model"* by Liang et al.
|
| 103 |
- **ComfyUI CCSR Node Foundation**: [kijai/ComfyUI-CCSR](https://github.com/kijai/ComfyUI-CCSR) & [Kijai/ccsr-safetensors](https://huggingface.co/Kijai/ccsr-safetensors) (Apache-2.0 License)
|
| 104 |
+
- **TensorRT Engine & ComfyUI Loader**: [ussoewwin/ComfyUI-NunchakuFluxLoraStacker](https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker) (CCSR nodes located under `nodes/CCSR/`)
|
| 105 |
- **License**: **Apache-2.0**
|