RedbeardNZ numz commited on
Commit
1b84191
Β·
verified Β·
0 Parent(s):

Duplicate from numz/SeedVR2_comfyUI

Browse files

Co-authored-by: NumZ <[email protected]>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: video-to-video
4
+ library_name: diffusers
5
+ tags:
6
+ - art
7
+ base_model:
8
+ - ByteDance-Seed/SeedVR2-7B
9
+ - ByteDance-Seed/SeedVR2-3B
10
+ ---
11
+
12
+ # ComfyUI-SeedVR2_VideoUpscaler
13
+
14
+ [![View Code](https://img.shields.io/badge/πŸ“‚_View_Code-GitHub-181717?style=for-the-badge&logo=github)](https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler)
15
+
16
+ Official release of [SeedVR2](https://github.com/ByteDance-Seed/SeedVR) for ComfyUI that enables Upscale Video/Images generation.
17
+
18
+ <img src="https://raw.githubusercontent.com/numz/ComfyUI-SeedVR2_VideoUpscaler/refs/heads/main/docs/demo_01.jpg">
19
+ <img src="https://raw.githubusercontent.com/numz/ComfyUI-SeedVR2_VideoUpscaler/refs/heads/main/docs/demo_02.jpg">
20
+
21
+ <img src="https://raw.githubusercontent.com/numz/ComfyUI-SeedVR2_VideoUpscaler/refs/heads/main/docs/usage.png">
22
+
23
+ ## πŸ“‹ Quick Access
24
+
25
+ - [πŸ†™ Note and futur releases](#-note-and-futur-releases)
26
+ - [πŸš€ Updates](#-updates)
27
+ - [🎯 Features](#-features)
28
+ - [πŸ”§ Requirements](#-requirements)
29
+ - [πŸ“¦ Installation](#-installation)
30
+ - [πŸ“– Usage](#-usage)
31
+ - [πŸ“Š Benchmarks](#-benchmarks)
32
+ - [⚠️ Limitations](#-Limitations)
33
+ - [🀝 Contributing](#-contributing)
34
+ - [πŸ™ Credits](#-credits)
35
+ - [πŸ“„ License](#-license)
36
+
37
+ ## πŸ†™ Note and futur releases
38
+
39
+ - Improve FP8 integration, we are loosing some FP8 advantages during the process.
40
+ - Tile-VAE integration if it works for video, I have test to do or if some dev want help, you are welcome.
41
+ - 7B FP8 model seems to have quality issues, use 7BFP16 instead (If FP8 don't give OOM then FP16 will works) I have to review this.
42
+
43
+ ## πŸš€ Updates
44
+
45
+ **2025.06.30**
46
+
47
+ - πŸš€ Speed Up the process and less VRAM used (see new benchmark).
48
+ - πŸ› οΈ Fixed leak memory on 3B models.
49
+ - ❌ Can now interrupt process if needed.
50
+ - βœ… refactored the code for better sharing with the community, feel free to propose pull requests.
51
+ - πŸ› οΈ Removed flash attention dependency
52
+
53
+ **2025.06.24**
54
+
55
+ - πŸš€ Speed up the process until x4 (see new benchmark)
56
+
57
+ **2025.06.22**
58
+
59
+ - πŸ’ͺ FP8 compatibility !
60
+ - πŸš€ Speed Up all Process
61
+ - πŸš€ less VRAM consumption (Stay high, batch_size=1 for RTX4090 max, I'm trying to fix that)
62
+ - πŸ› οΈ Better benchmark coming soon
63
+
64
+ **2025.06.20**
65
+
66
+ - πŸ› οΈ Initial push
67
+
68
+ ## 🎯 Features
69
+
70
+ - High-quality Upscaling
71
+ - Suitable for any video length once the right settings are found
72
+ - Model Will Be Download Automatically from [Models](https://huggingface.co/numz/SeedVR2_comfyUI/tree/main)
73
+
74
+ ## πŸ”§ Requirements
75
+
76
+ - A Huge VRAM capabilities is better, from my test, even the 3B version need a lot of VRAM at least 18GB.
77
+ - Last ComfyUI version with python 3.12.9 (may be works with older versions but I haven't test it)
78
+
79
+ ## πŸ“¦ Installation
80
+
81
+ 1. Clone this repository into your ComfyUI custom nodes directory:
82
+
83
+ ```bash
84
+ cd ComfyUI/custom_nodes
85
+ git clone https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler.git
86
+ ```
87
+
88
+ 2. Install the required dependencies:
89
+
90
+ load venv and :
91
+
92
+ ```bash
93
+ pip install -r ComfyUI-SeedVR2_VideoUpscaler/requirements.txt
94
+ ```
95
+
96
+ install flash_attn/triton, 6% faster on process, not a mandatory.
97
+
98
+ ```bash
99
+ pip install flash_attn
100
+ pip install triton
101
+ ```
102
+
103
+ or
104
+
105
+ ```bash
106
+ python_embeded\python.exe -m pip install -r flash_attn
107
+ ```
108
+
109
+ check here from https://github.com/loscrossos/lib_flashattention/releases and https://github.com/woct0rdho/triton-windows
110
+
111
+ 3. Models
112
+
113
+ Will be automtically download into :
114
+ `models/SEEDVR2`
115
+
116
+ or can be found here ([MODELS](https://huggingface.co/numz/SeedVR2_comfyUI/tree/main))
117
+
118
+ ## πŸ“– Usage
119
+
120
+ 1. In ComfyUI, locate the **SeedVR2 Video Upscaler** node in the node menu.
121
+
122
+ <img src="https://raw.githubusercontent.com/numz/ComfyUI-SeedVR2_VideoUpscaler/refs/heads/main/docs/node.png" width="100%">
123
+
124
+ 2. ⚠️ **THINGS TO KNOW !!**
125
+
126
+ **temporal consistency** : at least a **batch_size** of 5 is required to activate temporal consistency. SEEDVR2 need at least 5 frames to calculate it. A higher batch_size give better performances/results but need more than 24GB VRAM.
127
+
128
+ **VRAM usage** : The input video resolution impacts VRAM consumption during the process. The larger the input video, the more VRAM will consume during the process. So, if you experience OOMs with a batch_size of at least 5, try reducing the input video resolution until it resolves.
129
+
130
+ Of course, the output resolution also has an impact, so if your hardware doesn't allow it, reduce the output resolution.
131
+
132
+ 3. Configure the node parameters:
133
+
134
+ - `model`: Select your 3B or 7B model
135
+ - `seed`: a seed but it generate another seed from this one
136
+ - `new_resolution`: New desired short edge in px, will keep ratio on other edge
137
+ - `batch_size`: VERY IMPORTANT!, this model consume a lot of VRAM, All your VRAM, even for the 3B model, so for GPU under 24GB VRAM keep this value Low, good value is "1" without temporal consistency, "5" for temporal consistency, but higher is this value better is the result.
138
+ - `preserve_vram`: for VRAM < 24GB, If true, It will unload unused models during process, longer but works, otherwise probably OOM with
139
+
140
+ ## πŸ“Š Benchmarks
141
+
142
+ **7B models on NVIDIA H100 93GB VRAM** (values in parentheses are from the previous benchmark):
143
+
144
+ | nb frames | Resolution | Batch Size | execution time fp8 (s) | FPS fp8 | execution time fp16 (s) | FPS fp16 | perf progress since start |
145
+ | --------- | ------------------- | ---------- | ---------------------- | ----------- | ----------------------- | ------------------ | ------------------------- |
146
+ | 15 | 512Γ—768 β†’ 1080Γ—1620 | 5 | 23.75 (26.71) | 0.63 (0.56) | 24.23 (27.75) | 0.61 (0.54) (0.10) | x6.1 |
147
+ | 27 | 512Γ—768 β†’ 1080Γ—1620 | 9 | 27.75 (33.97) | 0.97 (0.79) | 28.48 (35.08) | 0.94 (0.77) (0.15) | x6.2 |
148
+ | 39 | 512Γ—768 β†’ 1080Γ—1620 | 13 | 32.02 (41.01) | 1.21 (0.95) | 32.62 (42.08) | 1.19 (0.93) (0.19) | x6.2 |
149
+ | 51 | 512Γ—768 β†’ 1080Γ—1620 | 17 | 36.39 (48.12) | 1.40 (1.06) | 37.30 (49.44) | 1.36 (1.03) (0.21) | x6.4 |
150
+ | 63 | 512Γ—768 β†’ 1080Γ—1620 | 21 | 40.80 (55.40) | 1.54 (1.14) | 41.32 (56.70) | 1.52 (1.11) (0.23) | x6.6 |
151
+ | 75 | 512Γ—768 β†’ 1080Γ—1620 | 25 | 45.37 (62.60) | 1.65 (1.20) | 45.79 (63.80) | 1.63 (1.18) (0.24) | x6.8 |
152
+ | 123 | 512Γ—768 β†’ 1080Γ—1620 | 41 | 62.44 (91.38) | 1.96 (1.35) | 62.28 (92.90) | 1.97 (1.32) (0.28) | x7.0 |
153
+ | 243 | 512Γ—768 β†’ 1080Γ—1620 | 81 | 106.13 (164.25) | 2.28 (1.48) | 104.68 (166.09) | 2.32 (1.46) (0.31) | x7.4 |
154
+ | 363 | 512Γ—768 β†’ 1080Γ—1620 | 121 | 151.01 (238.18) | 2.40 (1.52) | 148.67 (239.80) | 2.44 (1.51) (0.33) | x7.4 |
155
+ | 453 | 512Γ—768 β†’ 1080Γ—1620 | 151 | 186.98 (296.52) | 2.42 (1.53) | 184.11 (298.65) | 2.46 (1.52) (0.33) | x7.4 |
156
+ | 633 | 512Γ—768 β†’ 1080Γ—1620 | 211 | 253.77 (406.65) | 2.49 (1.56) | 249.43 (409.44) | 2.53 (1.55) (0.34) | x7.4 |
157
+ | 903 | 512Γ—768 β†’ 1080Γ—1620 | 301 | OOM (OOM) | (OOM) | OOM (OOM) | (OOM) (OOM) | |
158
+ | 149 | 854x480 β†’ 1920x1080 | 149 | | | 450.22 | 0.41 | |
159
+
160
+ **3B FP8 models on NVIDIA H100 93GB VRAM** (values in parentheses are from the previous benchmark):
161
+
162
+ | nb frames | Resolution | Batch Size | execution time fp8 (s) | FPS fp8 | execution time fp16 (s) | FPS fp16 |
163
+ | --------- | ------------------- | ---------- | ---------------------- | ------- | ----------------------- | -------- |
164
+ | 149 | 854x480 β†’ 1920x1080 | 149 | 361.22 | 0.41 | | |
165
+
166
+ **NVIDIA RTX4090 24GB VRAM**
167
+
168
+ | Model | nb frames | Resolution | Batch Size | execution time (seconds) | FPS | Note |
169
+ | ------- | --------- | ------------------- | ---------- | ------------------------ | ----------- | ---------------------------------------- |
170
+ | 3B fp8 | 5 | 512x768 β†’ 1080x1620 | 1 | 14.66 (22.52) | 0.34 (0.22) | |
171
+ | 3B fp16 | 5 | 512x768 β†’ 1080x1620 | 1 | 17.02 (27.84) | 0.29 (0.18) | |
172
+ | 7B fp8 | 5 | 512x768 β†’ 1080x1620 | 1 | 46.23 (75.51) | 0.11 (0.07) | preserve_memory=on |
173
+ | 7B fp16 | 5 | 512x768 β†’ 1080x1620 | 1 | 43.58 (78.93) | 0.11 (0.06) | preserve_memory=on |
174
+ | 3B fp8 | 10 | 512x768 β†’ 1080x1620 | 5 | 39.75 | 0.25 | preserve_memory=on |
175
+ | 3B fp8 | 100 | 512x768 β†’ 1080x1620 | 5 | 322.77 | 0.31 | preserve_memory=on |
176
+ | 3B fp8 | 1000 | 512x768 β†’ 1080x1620 | 5 | 3624.08 | 0.28 | preserve_memory=on |
177
+ | 3B fp8 | 20 | 512x768 β†’ 1080x1620 | 1 | 40.71 (65.40) | 0.49 (0.31) | |
178
+ | 3B fp16 | 20 | 512x768 β†’ 1080x1620 | 1 | 44.76 (91.12) | 0.45 (0.22) | |
179
+ | 3B fp8 | 20 | 512x768 β†’ 1280x1920 | 1 | 61.14 (89.10) | 0.33 (0.22) | |
180
+ | 3B fp8 | 20 | 512x768 β†’ 1480x2220 | 1 | 79.66 (136.08) | 0.25 (0.15) | |
181
+ | 3B fp8 | 20 | 512x768 β†’ 1620x2430 | 1 | 125.79 (191.28) | 0.16 (0.10) | preserve_memory=off (preserve_memory=on) |
182
+ | 3B fp8 | 149 | 854x480 β†’ 1920x1080 | 5 | 782.76 | 0.19 | preserve_memory=on |
183
+
184
+ ## ⚠️ Limitations
185
+
186
+ - Use a lot of VRAM, it will take all!!
187
+ - Processing speed depends on GPU capabilities
188
+
189
+ ## 🀝 Contributing
190
+
191
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
192
+
193
+ Please make sure to update tests as appropriate.
194
+
195
+ ### How to contribute:
196
+
197
+ 1. Fork the repository
198
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
199
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
200
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
201
+ 5. Open a Pull Request
202
+
203
+ ### Development Setup:
204
+
205
+ 1. Clone the repository
206
+ 2. Install dependencies
207
+ 3. Make your changes
208
+ 4. Test your changes
209
+ 5. Submit a pull request
210
+
211
+ ### Code Style:
212
+
213
+ - Follow the existing code style
214
+ - Add comments for complex logic
215
+ - Update documentation if needed
216
+ - Ensure all tests pass
217
+
218
+ ### Reporting Issues:
219
+
220
+ When reporting issues, please include:
221
+
222
+ - Your system specifications
223
+ - ComfyUI version
224
+ - Python version
225
+ - Error messages
226
+ - Steps to reproduce the issue
227
+
228
+ ## πŸ™ Credits
229
+
230
+ - Original [SeedVR2](https://github.com/ByteDance-Seed/SeedVR) implementation
231
+
232
+ # πŸ“œ License
233
+
234
+ - The code in this repository is released under the MIT license as found in the [LICENSE file](LICENSE).
config.json ADDED
File without changes
ema_vae_fp16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20678548f420d98d26f11442d3528f8b8c94e57ee046ef93dbb7633da8612ca1
3
+ size 501324814
seedvr2_ema_3b_fp16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fd0e03a3dad24e07086750360727ca437de4ecd456f769856e960ae93e2b304
3
+ size 6783018808
seedvr2_ema_3b_fp8_e4m3fn.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bf1e43ebedd570e7e7a0b1b60d6a02e105978f505c8128a241cde99a8240cff
3
+ size 3391544696
seedvr2_ema_7b_fp16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b8241aa957606ab6cfb66edabc96d43234f9819c5392b44d2492d9f0b0bbe4a
3
+ size 16479334424
seedvr2_ema_7b_fp8_e4m3fn.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fdbf3877b7d1eb266038d3a165a977f17dbb4daa4a0f0d334d5461476963037
3
+ size 8239729704
seedvr2_ema_7b_sharp_fp16.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20a93e01ff24beaeebc5de4e4e5be924359606c356c9c51509fba245bd2d77dd
3
+ size 16479334424
seedvr2_ema_7b_sharp_fp8_e4m3fn.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4261d18fd9c331f4c8f14b475c9148bd8c3f1512240ace55fe31a179e0a960b0
3
+ size 8239729704