01.05.2024, 11:47
Man,.. why post the whole script, each time,..
Looking at you correct way:
load the source
converts '470bg' to '709'
remaps 16-235 to 0-255
repeats frame 187, 257 times, no clue why you do that,...
this tells Hybrid the source is limted, this seems wrong, since you just converted it to 'full' beforehand.
So now you change set the color range to 'full' again
now you apply DeOldify
So all in all up to this point (ignoring the frame duplication thing) you made sure that if YUV content was present it is converted to matrix bt709 and luma range full before converted to RGB and fed to DeOldify.
now you output full range.
Would have been way easier if you had spend the time to write down a few sentences of what you did or indented to do.
I write a test version which will make sure DeOldify is fed with 'bt709' and 'full' but will revert to the original values afterwards.
If you want 'bt709' and 'full' output, you should use Levels to convert the levels and ColorMatrix to change the matrix before feeding the source to DeOldify.
Cu Selur

Looking at you correct way:
# Source: 'TestClipSingerBW.mp4'
# Current color space: YUV420P8, bit depth: 8, resolution: 480x360, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg
# Loading TestClipSingerBW.mp4 using LWLibavSource
clip = core.lsmas.LWLibavSource(source="TestClipSingerBW.mp4", format="YUV420P8", stream_index=0, cache=0, fpsnum=25, prefer_hw=0)
clip = core.resize.Bicubic(clip=clip, matrix_in_s="470bg", matrix_s="709", range_in=0, range=0)
# changing range from limited to full range
clip = core.resize.Bicubic(clip, range_in_s="limited", range_s="full")
clip = core.std.Loop(clip=clip[185], times=257)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=1)
# setting color range to PC (full) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=0)
# adjusting color space from YUV420P8 to RGB24 for vsDeOldify
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_s="full", dither_type="error_diffusion")
# adding colors using DeOldify
from vsdeoldify import ddeoldify
clip = ddeoldify(clip=clip, method=0, deoldify_p=[0, 24, 1, 0])
So all in all up to this point (ignoring the frame duplication thing) you made sure that if YUV content was present it is converted to matrix bt709 and luma range full before converted to RGB and fed to DeOldify.
# adjusting output color from: RGB24 to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_s="full")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# output
clip.set_output()
Would have been way easier if you had spend the time to write down a few sentences of what you did or indented to do.

I write a test version which will make sure DeOldify is fed with 'bt709' and 'full' but will revert to the original values afterwards.
If you want 'bt709' and 'full' output, you should use Levels to convert the levels and ColorMatrix to change the matrix before feeding the source to DeOldify.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.