ussoewwin commited on
Commit
d80bb29
Β·
verified Β·
1 Parent(s): 770c352

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +46 -58
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: ConvRot INT8 & TensorRT RTX Acceleration
19
 
20
- High-fidelity **ConvRot INT8** quantized weights and ultra-fast **TensorRT RTX** execution engines for **CCSR (Creative Content Super-Resolution)**, designed for low-VRAM and real-time generative image upscaling in **ComfyUI**.
21
 
22
  > πŸ“¦ **ComfyUI Loader & Upscaler Extension:**
23
- > All nodes supporting both ConvRot INT8 and TensorRT execution are hosted in:
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 two high-performance deployment options for CCSR:
33
 
34
- 1. **ConvRot INT8 Checkpoint (`real-world_ccsr_convrot_int8.safetensors`)**:
35
- - Applies orthogonal Hadamard rotation matrices to UNet linear layers to eliminate activation outlier spikes prior to per-channel INT8 quantization.
36
- - Quantizes ControlNet convolutional layers to INT8 Conv2d.
37
- - Preserves high-precision FP16 weights for VAE autoencoders and condition encoders.
38
- - Cuts checkpoint size from **3.2 GB to ~2.0 GB** and saves **~1.1 GiB VRAM** while maintaining full super-resolution quality.
39
-
40
- 2. **TensorRT RTX Engine (`ccsr_apply_f16io.rtxplan` + `ccsr_trt_aux.safetensors`)**:
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 | Quantization / Engine | File Size | Recommended Location | License |
50
  | :--- | :--- | :--- | :--- | :--- | :--- |
51
- | `real-world_ccsr_convrot_int8.safetensors` | Full CCSR Checkpoint | ConvRot INT8 (UNet/ControlNet) + FP16 (VAE/Encoder) | ~2.0 GB | `ComfyUI/models/checkpoints/` or `models/CCSR/` | Apache-2.0 |
52
- | `ccsr_apply_f16io.rtxplan` | TensorRT Fused Denoising Engine | TensorRT RTX Engine (Tile 512px / Latent 64Γ—64) | ~1.4 GB | `custom_nodes/.../nodes/CCSR/trt_engines/` | Apache-2.0 |
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 | Checkpoint / Engine Size | VRAM Overhead (Denoising) | Step Latency (Tile 512) | Notes |
62
  | :--- | :--- | :--- | :--- | :--- |
63
- | **Stock CCSR (FP16 PyTorch)** | ~3.2 GB | ~3.8 GiB | ~113 ms / step | Baseline PyTorch execution |
64
- | **CCSR ConvRot INT8** | ~2.0 GB | ~2.7 GiB (**~1.1 GiB saved**) | ~105 ms / step | Quantized weights kept in VRAM, full fidelity |
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
- Support for both **ConvRot INT8** and **TensorRT Engine** execution is integrated natively into the dedicated loader extension:
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
- ### Method 2: TensorRT RTX Engine (Ultra-Fast Execution)
98
 
99
  <p align="center">
100
- <img src="https://huggingface.co/ussoewwin/CCSR-ConvRot-INT8-and-TensorRT-Engine/resolve/main/png/ccsrtensor.png" alt="CCSR TensorRT RTX Engine Workflow in ComfyUI" width="800">
101
  </p>
102
 
103
- 1. Place both `ccsr_apply_f16io.rtxplan` and `ccsr_trt_aux.safetensors` into:
104
- - `ComfyUI/custom_nodes/ComfyUI-NunchakuFluxLoraStacker/nodes/CCSR/trt_engines/`
105
- 2. In ComfyUI, add **`Load CCSR Model (TensorRT)`** (`LoadCCSRModelTensorRT`). The node populates the dropdown with available `.rtxplan` engines and automatically loads the companion `ccsr_trt_aux.safetensors`.
106
- 3. Connect the `ccsr_model` output to **`CCSR Upscale (TRT)`** (`CCSR_Upscale_TRT`).
107
- 4. Execute upscaling at tile size 512. The engine processes tiles at ~24 ms/step with stream-synchronized CUDA execution.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- - **ComfyUI Loader & TRT Integration**: [ussoewwin/ComfyUI-NunchakuFluxLoraStacker](https://github.com/ussoewwin/ComfyUI-NunchakuFluxLoraStacker) (CCSR nodes located under `nodes/CCSR/`)
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**