Skip to main content

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

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:

  • cpu CPU mode (very slow).
  • cuda GPU 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.

720x480
Resize Factor Average FPS
0.25x (180x120) ~45 fps
0.5x (360x240) ~34 fps
to 720x540 ~14 fps
1.5x (1080x720) ~8 fps
2x (1440x960) ~5 fps
1440x1080
Resize Factor Average FPS
0.25x (360x270) ~8 fps
0.5x (720x540) ~6 fps
1.5x (2160x1620) ~1.5 fps
2x (2880x2160) ~1 fps

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)

Source distribution for vs-liif 1.2.0
File Size Uploaded
vs_liif-1.2.0.tar.gz 17.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for vs-liif 1.2.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page