From d69ab7895b0b0735986182543ac4cfa30226b61e Mon Sep 17 00:00:00 2001 From: LightArrowsEXE Date: Wed, 26 Aug 2026 01:46:49 +0200 Subject: [PATCH 1/3] Add mvsfunc dependency --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b912b78..0a2b1a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,8 +13,13 @@ dependencies = [ "vapoursynth", "vsutil", "vapoursynth-adaptivegrain", + "mvsfunc", ] +[tool.uv.sources] +mvsfunc = { git = "https://github.com/HomeOfVapourSynthEvolution/mvsfunc.git" } + + [project.urls] Homepage = "https://github.com/Irrational-Encoding-Wizardry/kagefunc" From 6736feb1eae0e605fcf5a59747504a5e41e43f4d Mon Sep 17 00:00:00 2001 From: LightArrowsEXE Date: Wed, 26 Aug 2026 01:50:33 +0200 Subject: [PATCH 2/3] Increase python version requirement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Required because of adaptive-grain: ``` × No solution found when resolving dependencies for split (markers: python_full_version >= '3.8' and python_full_version < '3.12'): ╰─▶ Because the requested Python version (>=3.8) does not satisfy Python>=3.12 and all versions of vapoursynth-adaptivegrain depend on Python>=3.12, we can conclude that all versions of vapoursynth-adaptivegrain cannot be used. And because your project depends on vapoursynth-adaptivegrain, we can conclude that your project's requirements are unsatisfiable. ``` --- pyproject.toml | 2 +- uv.lock | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 uv.lock diff --git a/pyproject.toml b/pyproject.toml index 0a2b1a8..3d1e4a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.1" description = "kageru's collection of VapourSynth functions" readme = "README.md" license = { file = "LICENSE" } -requires-python = ">=3.8" +requires-python = ">=3.12" dependencies = [ "vapoursynth", "vsutil", diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..1bf40e1 --- /dev/null +++ b/uv.lock @@ -0,0 +1,73 @@ +version = 1 +revision = 3 +requires-python = ">=3.12" + +[[package]] +name = "kagefunc" +version = "1.0.1" +source = { editable = "." } +dependencies = [ + { name = "mvsfunc" }, + { name = "vapoursynth" }, + { name = "vapoursynth-adaptivegrain" }, + { name = "vsutil" }, +] + +[package.metadata] +requires-dist = [ + { name = "mvsfunc", git = "https://github.com/HomeOfVapourSynthEvolution/mvsfunc.git" }, + { name = "vapoursynth" }, + { name = "vapoursynth-adaptivegrain" }, + { name = "vsutil" }, +] + +[[package]] +name = "mvsfunc" +version = "11" +source = { git = "https://github.com/HomeOfVapourSynthEvolution/mvsfunc.git#865c7486ca860d323754ec4774bc4cca540a7076" } +dependencies = [ + { name = "vapoursynth" }, +] + +[[package]] +name = "vapoursynth" +version = "79" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/4d/bb7fcc7f304e7248cf6c83ec0c3c97ee4b4fa2e05bfbbe2a578a9b41fab9/vapoursynth-79.tar.gz", hash = "sha256:01311b79ef22334115f79a78a6d7548bd29f35cc903ee0cea12443d49e142eb1", size = 657038, upload-time = "2026-08-07T08:58:43.96Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/a3/24c2f637f79f41551c72b6505ba008ba229a1fd7869f102cc77b86ce7bd6/vapoursynth-79-cp312-abi3-macosx_13_0_arm64.whl", hash = "sha256:ea2750319e31d099b4652a4a63f47db2c297c307f7567e3e9352b75158c7b37c", size = 1367869, upload-time = "2026-08-07T08:58:29.308Z" }, + { url = "https://files.pythonhosted.org/packages/91/09/40354f2a95db5a6462a6ca7d66481bc4970c6d3147c547b1d45b5eb35205/vapoursynth-79-cp312-abi3-macosx_13_0_x86_64.whl", hash = "sha256:64eb7309439407fec0e0f6771c1b6f954d08355c46cf0c56fb55e1ba68bb7f79", size = 4483430, upload-time = "2026-08-07T08:58:31.846Z" }, + { url = "https://files.pythonhosted.org/packages/39/b5/d329a044564c22beda6b31cd47f1814cbad29e71a77af1b304715614e628/vapoursynth-79-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:50d031d07b1839ba362cf314e212edb0760c7ca2a7625a051a0bcbf22aaf9d1c", size = 1803612, upload-time = "2026-08-07T08:58:33.366Z" }, + { url = "https://files.pythonhosted.org/packages/c2/82/a4f5e879ff0bb6722ecbecf01482b0783ed05d42aefa7717e6a6f4f77180/vapoursynth-79-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f1e37f0ed8eb73e61c3c231fd7f7a0f7acfa893e98d026686e9c81e52c9ce06", size = 4536724, upload-time = "2026-08-07T08:58:35.38Z" }, + { url = "https://files.pythonhosted.org/packages/b7/6f/1546d68b3eac2e83b48da4f8e5272eaec6360f84c7adbaf4fc25e3bb44c8/vapoursynth-79-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a780f425f1f102ddb8dd36bc54743f5747d0e08b7cb93eacce8b55eaeb56d555", size = 2585590, upload-time = "2026-08-07T08:58:37.338Z" }, + { url = "https://files.pythonhosted.org/packages/82/e7/8ae84da0b7500c5ed30d02b1c90d3a1beb454ef1965e18b803c8224e8aba/vapoursynth-79-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:fd2172ecadbe79735c5068e65901d7a37c73488ead54880a305bc7866d2db9b7", size = 5363607, upload-time = "2026-08-07T08:58:39.15Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e4/e551a29871be0e2f0378232e7f347b944b632fa23a42c056cfec53485f95/vapoursynth-79-cp312-abi3-win_amd64.whl", hash = "sha256:643d9708df7e98807a66d4e8804e2e9a1380af22bea2873387d8af103e69aa5b", size = 15157546, upload-time = "2026-08-07T08:58:41.525Z" }, +] + +[[package]] +name = "vapoursynth-adaptivegrain" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "vapoursynth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6e/8a/aa50da0374b1339f5ce3c9a404c37b6e5f80fdf210d17b90bdf2d2550ae6/vapoursynth_adaptivegrain-0.5.0.tar.gz", hash = "sha256:9f68b2953f459d74bd31b4af4b308811917f70623f8bd40b30ab4664bd6d699f", size = 17431, upload-time = "2026-05-05T18:28:57.341Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/db/b9/55f5f08c46965448c3ab4bdc34d38e7ef5189f5120ba2398291c38c266a2/vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl", hash = "sha256:cf7c67edc1fac2a985ce3ba7436847a2ac375b6f1f96dd27e760dd6cab7535f0", size = 182776, upload-time = "2026-05-05T18:28:49.206Z" }, + { url = "https://files.pythonhosted.org/packages/5f/85/8259a8572717fcb0ddd5361564246e0f7ea4f0ac83f5e5dceaeae7643a20/vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl", hash = "sha256:974fe652716f6bcfdf6b03657cc905042bcaa6dec7aadb12acc45e6c7244a4f8", size = 370882, upload-time = "2026-05-05T18:28:50.755Z" }, + { url = "https://files.pythonhosted.org/packages/17/06/103226ffaaa3217c140de17eb2d00a7c515d173e65ca101925f998bae67b/vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:4a8b89a643b1710b6b6316bfec07fef9f1a4c727ddcae76bcbd7886fc2e43d78", size = 177335, upload-time = "2026-05-05T18:28:52.241Z" }, + { url = "https://files.pythonhosted.org/packages/a9/03/588328b944be32e270b24d6a94b06a6c4da200f0e8e22aba273cf24f554f/vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:f3df06e2f32239e20634c533145e977dc68a8fc62739ec4a7053e9e0d224f592", size = 553647, upload-time = "2026-05-05T18:28:54.001Z" }, + { url = "https://files.pythonhosted.org/packages/61/dc/1cf8ec79096ec83e2d6c223a44ece12ac2c5849f4c4b73f033ee2dea292d/vapoursynth_adaptivegrain-0.5.0-py3-none-win_amd64.whl", hash = "sha256:ba68c65cf62a96bc2990d78ba80f593b63b2f9baf83f48f51c319f75d095cedb", size = 258642, upload-time = "2026-05-05T18:28:55.871Z" }, +] + +[[package]] +name = "vsutil" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "vapoursynth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f2/dc/95df63612bd0a95d7a06a1c51dde3ca0f4ae697d9e231c2345390ff9638c/vsutil-0.8.0.tar.gz", hash = "sha256:e01831203dfb9c3af86a101fba5e7fe04e3686bddec94bb3057ca73e84c98768", size = 11380, upload-time = "2022-06-22T13:29:28.635Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/89/daadc3c87b3c0f1f5ca36fd900222ea4c023af6a4acefd033ef7f55df3b5/vsutil-0.8.0-py3-none-any.whl", hash = "sha256:b14751680f1aa47a8671a943932e160fc3b6029b3e60227875fd73d7a47dac86", size = 11825, upload-time = "2022-06-22T13:29:26.75Z" }, +] From baa509c1feb519550ed42ba72457cd57b57a17a5 Mon Sep 17 00:00:00 2001 From: LightArrowsEXE Date: Wed, 26 Aug 2026 01:54:08 +0200 Subject: [PATCH 3/3] Add fvsfunc lazy imports `fvsfunc` isn't on pypi and can't be installed via git, so lazyloading it so it doesn't throw errors when users install it through another package. --- kagefunc.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kagefunc.py b/kagefunc.py index 3a14bc2..24f06d5 100644 --- a/kagefunc.py +++ b/kagefunc.py @@ -2,10 +2,10 @@ kageru’s collection of vapoursynth functions. """ from functools import partial -from vsutil import * -import vapoursynth as vs + import mvsfunc as mvf -import fvsfunc as fvf +import vapoursynth as vs +from vsutil import * core = vs.core @@ -67,6 +67,11 @@ def inverse_scale( planes = _descale_chroma(planes, width, height) if mask_detail: + try: + import fvsfunc as fvf + except ImportError as e: + raise ImportError("Missing required dependency: `fvsfunc`") from e + upscaled = fvf.Resize(planes[0], source.width, source.height, kernel=kernel, taps=taps, a1=b, a2=c) planes[0] = mask_descale(get_y(source), planes[0], upscaled, zones=descale_mask_zones) scaled = join(planes) @@ -90,6 +95,11 @@ def mask_descale( zones: str = '', debug: bool = False, ): + try: + import fvsfunc as fvf + except ImportError as e: + raise ImportError("Missing required dependency: `fvsfunc`") from e + downscaled = core.resize.Spline36(original, descaled.width, descaled.height) assert get_depth(original) == get_depth(descaled), "Source and descaled clip need to have the same bitdepth" detail_mask = _generate_descale_mask(original, descaled, upscaled, threshold)