AI resizing for VapourSynth using LIIF
Up- or downscaling to arbitrary resolutions and aspect ratios. For example to go from 720x480 to 720x540, or to remove small black borders and stretch, or to downscale with less detail loss. For large upscaling factors dedicated upscaling models are usually better and faster.
Installation
pip install -U vs_liif
- This package requires PyTorch with CUDA.
Usage
import vs_liif
clip = vs_liif.resize(clip, width=None, height=None, src_left=0.0, src_top=0.0, src_width=None, src_height=None, batch_size=100000, backend="cuda")
clip
Input clip must be in RGB format.
width, height (optional)
Output width and height in pixel.
src_width, src_height (optional)
Selects a window from the source frame to resize starting from top left. Works like vapoursynths built-in resizers.
src_left, src_top (optional)
Shifts the entire frame, or the window selected by src_width and src_height.
Allows for subpixel and negative shift. Works like vapoursynths built-in resizers.
batch_size (optional)
The amount of pixels to process at once. Lower reduces VRAM usage, but may be slower.
There seems to be a goldilock zone for speed. To find it go up/down in 50000 steps.
backend (optional)
The backend used to run the LIIF model:
cpuCPU mode (very slow).cudaGPU mode. Requires an Nvidia GPU (fast).
[!TIP] With large resize factors, the model sometimes exhibits a color shift. To fix this try vs_colorfix.
Benchmarks
Benchmarks were done on a RTX 4090 GPU.
|
|
Acknowledgements
Orignal code from "Learning Continuous Image Representation with Local Implicit Image Function" or LIIF.
VapourSynth functions created with the help of ViktorThink.
Metadata
Release files for vs-liif 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vs_liif-1.2.0.tar.gz | 17.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vs_liif-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.9 MB
Release files / vs_liif-1.2.0.tar.gz
| Download URL | vs_liif-1.2.0.tar.gz |
|---|---|
| Size | 17.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ca2754d090da740dd51469aa90153c0152e58586cdbfd338d655b4d8c49995c
|
|
BLAKE2b-256 checksum How to use checksums |
b45b28de37490e7d8dbd743da2dfcebbf285a4ba5716ba3e4bdad0c99bcf5a1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency logRelease files / vs_liif-1.2.0-py3-none-any.whl
| Download URL | vs_liif-1.2.0-py3-none-any.whl |
|---|---|
| Size | 17.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c82d3081ae814dbfe75a3357f0eb630061fdf1a356ca0694a445e632b674ed1c
|
|
BLAKE2b-256 checksum How to use checksums |
c1b5453bebc592252385458af293a49381df40d80e295ee6926894b831966b66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.
Transparency log