![]() |
|
Deoldify Vapoursynth filter - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html) +--- Forum: Small Talk (https://forum.selur.net/forum-7.html) +--- Thread: Deoldify Vapoursynth filter (/thread-3595.html) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
RE: Deoldify Vapoursynth filter - Dan64 - 23.05.2026 Hi NASS, Can you provide a small sample and the script used. Dan (23.05.2026, 14:35)Selur Wrote: updated Hybrid_havc_test, which should update the tool-tips. Now, it's Okay. It is missing only the too-tip for "Retry (threshold/model)" you can add: "If Retry (threshold) > 0, this value will be used to detect frames with insufficient permanent-memory coverage and in this case the frame with missing good references will be colorized on the fly, suggested value: 0 (disabled) or 0.20-0.35 . The colorization models can be: HAVC (Deoldify + DDColor) # fast, but the quality is not good if compared to DiT models DiT fp4/int4 (depending on GPU used) # very good quality but can slow-down the inference speed by about 40%-50%". Thanks, Dan RE: Deoldify Vapoursynth filter - NASS - 23.05.2026 Hi Dan. Thanks so much for your reply. Here's the script in dev version ( Motion Distortion + Color jump ): # Imports import sys import os import vapoursynth as vs # getting Vapoursynth core core = vs.core # Import scripts folder scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts' sys.path.insert(0, os.path.abspath(scriptPath)) # loading plugins core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll") # Import scripts import vsdeoldify as havc import validate # Source: 'C:\Users\NASS\Desktop\outestny_restoredcolor.mp4' # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 960x720, fps: 24, color matrix: 709, color primaries: Unspecific, color transfer: BT.709, yuv luminance scale: limited, scanorder: progressive, full height: true (Source) # Loading 'C:\Users\NASS\Desktop\outestny_restoredcolor.mp4Ä using LWLibavSource clip = core.lsmas.LWLibavSource(source="C:/Users/NASS/Desktop/outestny_restoredcolor.mp4", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0) frame = clip.get_frame(0) # setting color matrix to 709. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709) # setting color transfer (vs.TRANSFER_BT709), if it is not set. if validate.transferIsInvalid(clip): clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709) # setting color primaries info (to vs.PRIMARIES_BT709), if it is not set. if validate.primariesIsInvalid(clip): clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709) # setting color range to TV (limited) range. prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange' clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED}) # making sure frame rate is set to 24fps clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1) # making sure the detected scan type is set (detected: progressive) clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive # adjusting color space from YUV420P8 to RGB24 for vsColorAdjust clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full") # stabilize colors using ColorAdjust (HAVC) clip = havc.HAVC_ColorAdjust(clip, BlackWhiteTune="light", BlackWhiteMode=6) # adjusting output color from RGB24 to YUV420P8 for x264Model clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_in_s="full", range_s="limited") # set output frame rate to 24fps (progressive) clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1) # output clip.set_output() # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 960x720, fps: 24, color matrix: 709, color primaries: Unspecific, color transfer: BT.709, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta) # script was created by Hybrid 2026.05.22.1 It’s a shame because this is a really great feature, but Motion Distortion Issue + Color jump affects the final result. We definitely need to find a solution! Thanks so much Dan NASS In the original version (Hybrid_2026.03.21.1_SETUP) and VapoursynthR73_torch_2026.02.26 with the old colormnet, there is no color-jumping issue, but the major distortion problem remains. # Imports import vapoursynth as vs # getting Vapoursynth core import sys import os core = vs.core # Import scripts folder scriptPath = 'C:/Program Files/Hybrid2/64bit/vsscripts' sys.path.insert(0, os.path.abspath(scriptPath)) # loading plugins core.std.LoadPlugin(path="C:/Program Files/Hybrid2/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll") core.std.LoadPlugin(path="C:/Program Files/Hybrid2/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll") # Import scripts import vsdeoldify as havc import validate # Source: 'C:\Users\NASS\Desktop\LA\restoredcolor.mp4' # Current color space: YUV420P8, bit depth: 8, resolution: 938x698, frame rate: 24fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: AVC # Loading ' C:\Users\NASS\Desktop\LA\restoredcolor.mp4Ä using LWLibavSource clip = core.lsmas.LWLibavSource(source="C:\Users\NASS\Desktop\LA\restoredcolor.mp4 ", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0) frame = clip.get_frame(0) # setting color matrix to 709. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709) # setting color transfer (vs.TRANSFER_BT709), if it is not set. if validate.transferIsInvalid(clip): clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709) # setting color primaries info (to vs.PRIMARIES_BT709), if it is not set. if validate.primariesIsInvalid(clip): clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709) # setting color range to TV (limited) range. clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED) # making sure frame rate is set to 24fps clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1) # making sure the detected scan type is set (detected: progressive) clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive # adjusting color space from YUV420P8 to RGB24 for vsColorAdjust clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full") # stabilize colors using ColorAdjust (HAVC) clip = havc.HAVC_ColorAdjust(clip, BlackWhiteTune="strong", BlackWhiteMode=6, Strength=1) # adjusting output color from RGB24 to YUV420P8 for x264Model clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_in_s="full", range_s="limited") # additional resize to match target color sampling # set output frame rate to 24fps (progressive) clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1) # output clip.set_output() # script was created by Hybrid 2026.03.21.1 Here are a few photos of the result with the distortion problem https://drive.google.com/drive/folders/1x8YCKb2DdqQitxtM9gqNDYKwSv1D5ifD Best NASS RE: Deoldify Vapoursynth filter - safshe - 23.05.2026 (23.05.2026, 15:16)Dan64 Wrote: Hi NASS, Hi! Can you provide a step-by-step workflow for using DITserver-based colorization? Also, can DITserver colorize new characters that appear in the same shot without altering the colors of the already colorized areas? RE: Deoldify Vapoursynth filter - NASS - 23.05.2026 Hi Dan, thanks so much—with RC3, the colors are stable! Thanks. RE: Deoldify Vapoursynth filter - Dan64 - 23.05.2026 Hi Selur, I attached the new RC4, it fix a bug introduced in RC3. This should be the last RC before the official release. Dan RE: Deoldify Vapoursynth filter - Selur - 24.05.2026 Will test later and report back. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 24.05.2026 I performed a test by colorizing a full film (960x720, fps: 23.976) on my RTX5070 Ti. I obtained the following results: encoded 125236 frames in 22145.44s (5.66 fps), 2572.90 kb/s, Avg QP:24.47Using my previous pipeline: 1) Extraction of 3062 reference images (about 1 ref. every 41 frames): 7 min. 2) Colorization DiT: (3062*4)/60 = 204 min. 3) Encoding with CMNET2 at a speed of 12.8 fps: (125236/12.8)/60 = 163 min. Total Time: 374 min. (5.58 fps) So with direct encoding, the colorization speed improves by about 1.5% (mainly due to the skipped frame extraction phase and filesystem image access). The only problem is that in this way is not possible to see the colorized frames and eventually remove the ones with inconsistent colors. CMNET2 is already doing a good job in keeping the color consistency, but to obtain a perfect results it is necessary to manually analyze the colored reference frames and eventually remove the ones with inconsistent colors. But in my opinion the film colorized with the direct encoding is already very good, much, much better than using HAVC (DeOldify + DDColor). Dan RE: Deoldify Vapoursynth filter - Selur - 24.05.2026 What I did with the latest version cd F:\Hybrid\64bit\Vapoursynthclip = havc.HAVC_cmnet2dit(clip, encode_mode=1, dit_engine_params={"host": "127.0.0.1", "port": 8765, "model_precision": "int4"})"F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vapoursynth\vspipe.exe" "J:\tmp\2026-05-24@18_25_46_1110\encodingTempSynthSkript_2026-05-24@18_25_46_1110_0.vpy" - --outputindex 0 -c y4m |"F:\Hybrid\64bit\NVEncC.exe" --y4m -i - --fps 25.000 --codec av1 --sar 1:1 --lookahead 32 --output-depth 10 --vbr 0 --vbr-quality 23.00 --aq --aq-strength 5 --aq-temporal --gop-len 0 --ref 6 --multiref-l0 3 --multiref-l1 3 --bframes 3 --direct auto --bref-mode auto --no-b-adapt --mv-precision Q-pel --preset quality --colorrange limited --colormatrix smpte170m --colorrange limited --cuda-schedule sync --output "J:\tmp\2026-05-24@18_25_46_1110\test_1_2026-05-24@18_25_46_1110_02.av1"100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:03<00:00, 1.86s/it]So I tried it manually with the above call and got: C:\Users\Selur>"F:\Hybrid\64bit\Vapoursynth\Lib\site-packages\vapoursynth\vspipe.exe" "J:\tmp\2026-05-24@18_25_46_1110\encodingTempSynthSkript_2026-05-24@18_25_46_1110_0.vpy" - --outputindex 0 -c y4m |"F:\Hybrid\64bit\NVEncC.exe" --y4m -i - --fps 25.000 --codec av1 --sar 1:1 --lookahead 32 --output-depth 10 --vbr 0 --vbr-quality 23.00 --aq --aq-strength 5 --aq-temporal --gop-len 0 --ref 6 --multiref-l0 3 --multiref-l1 3 --bframes 3 --direct auto --bref-mode auto --no-b-adapt --mv-precision Q-pel --preset quality --colorrange limited --colormatrix smpte170m --colorrange limited --cuda-schedule sync --output "J:\tmp\2026-05-24@18_25_46_1110\test_1_2026-05-24@18_25_46_1110_02.av1"RE: Deoldify Vapoursynth filter - Dan64 - 24.05.2026 The memory requirements for running local version of CMNET2 are very high, try to pass max_memory_frames=2. I left the local version mainly to debug the code, the current limitation regarding the memory do not make it useful for an effective coloring. you should not get problems using encode_mode=0 Dan P.S. [WinError 10054] means that the client broken the connection probably crashed RE: Deoldify Vapoursynth filter - Selur - 24.05.2026 Ah, I missed that I use dencode_mode=1. Okay, the server python instance already eats ~22GB RAM. (got 64, no real problem) using clip = havc.HAVC_cmnet2dit(clip, dit_engine_params={"host": "127.0.0.1", "port": 8765, "model_precision": "int4"})But encoding is stuck: 100%|████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:03<00:00, 1.98s/it]Stopped the job, restarted the server (.venv) F:\Hybrid\64bit\Vapoursynth\DiTServerRPC-main>python dit_rpc_server.py --load-pipeline --pipeline-config qwen_config_int4.json100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:03<00:00, 1.75s/it]tried it again (server restart, job restart) This time it worked. Restarted the job and it worked again. But at the end of the encoding I always get: Exception occurred during processing of request from ('127.0.0.1', 5402)Hmm,.. I added AutoWhite after the coloring and now the encoding stopped after half of the frames,... (the ref frame coloring seemed to be finished,...) => restarted the server and the job, this time it looks like the client didn't connect to the server, restarting the job, still nothing happens. gpu: 0%) # colorize using CMNet with external DiT (HAVC)Cu Selur |