Skip to main content

Real-time AI upscaler for any Linux window using CuNNy

Project description

Real‑Time Upscaler for Linux

PyPI version Python versions License: GPLv3

A real‑time AI upscaler for any application window on GNU/Linux. It uses CuNNy neural networks to perform 2× (or 4×) upscaling, then scales the result to full screen while preserving aspect ratio. Mouse clicks and motion are automatically forwarded to the original window.

Now with full XWayland support – works seamlessly under Wayland compositors!

Results at 400% magnification

Features

  • AI‑Powered Upscaling – Uses the CuNNy (Convolutional upscaling Neural Network) models, trained specifically for high‑quality 2× upscaling of visual novels and illustrations.
  • Complete Model Selection – Choose from 9 variants, offering a range of quality/performance trade‑offs:
    • 8x32 – Highest quality, slowest.
    • 4x32
    • 4x24
    • 4x16
    • 4x12
    • 3x12
    • fast – Default. Recommended for slow machines.
    • faster
    • veryfast – Fastest option, lowest quality.
  • Attach to Any Window – Either grab the currently active window, select from visible windows or launch a new program and capture its window automatically.
  • Full‑Screen Output – The upscaled image is displayed in a transparent overlay that covers your entire monitor, scaled to fill the screen while preserving aspect ratio.
  • Input Forwarding – Click, move, and drag on the upscaled image as if you were interacting directly with the original window.
  • Hardware Accelerated – GPU compute via Compushady (Vulkan) works on NVIDIA, AMD, and Intel GPUs.
  • XWayland Compatible – Runs under Wayland compositors by automatically forcing X11 platform for Qt and disabling Wayland Vulkan extensions.
  • Low Overhead – Minimal CPU/GPU usage; the final scaling pass uses hardware Lanczos2 filtering.

Requirements

  • GNU/Linux (X11 or Wayland with XWayland)
  • Vulkan-capable GPU from any vendor (NVIDIA, AMD, Intel)
  • Vulkan drivers (libvulkan-dev on Debian/Ubuntu)
  • X11 development libraries (libx11-dev)
  • GCC and basic tools to compile C extensions (build-essential).
  • Python 3.8 - 3.13

Python 3.14 compatibility

The current release does not support Python 3.14 due to a low‑level incompatibility with the Vulkan backend. If you have Python 3.14 installed, please use a Python 3.13 virtual environment. See this report for more details on that.

We are tracking the issue and will update once compatibility is restored.

Installation

1. System dependencies

Debian / Ubuntu / Linux Mint

sudo apt update
sudo apt install libvulkan-dev libx11-dev

Fedora / RHEL / CentOS

sudo dnf install vulkan-loader-devel libX11-devel

Arch Linux

sudo pacman -S vulkan-devel libx11

openSUSE

sudo zypper install vulkan-devel libX11-devel

Alpine Linux

sudo apk add vulkan-headers libx11-dev

2. Python package

Install with pipx (recommended)

pipx install linux-rt-upscaler

Or with regular pip (inside a virtual environment is advised)

pip install linux-rt-upscaler

Or install from source

# Install additional system dependencies for C compilation
sudo apt install gcc make

# Clone the repository
git clone https://github.com/baronsmv/linux-rt-upscaler.git
cd linux-rt-upscaler

# Install the dependencies and the package in development mode
pip install -e .

Usage

After installation, the upscale command will be available globally:

# Upscale the currently active window
upscale

# Interactively select from visible windows at startup
upscale -s

# Run a command and upscale its window
upscale <command>

# Choose a specific model (examples)
upscale -m 8x32      # Highest quality, slowest
upscale -m 4x24      # A balanced option
upscale -m veryfast  # Maximum performance

# Disable mouse‑click forwarding (also enables dimming/click‑through)
upscale -d

# Perform two 2× passes (total 4×) (Experimental)
upscale -2

# Show help and other options
upscale -h

Controls

  • Exit: Press Ctrl+C in the terminal where the upscaler is running.
  • Dimming/Click‑through (only when -d is used):
    • The overlay becomes semi‑transparent (20% opacity) when the mouse leaves the source window.
    • Clicks then pass through to whatever window is underneath (e.g., your desktop or other applications).

How It Works

  1. Window Selection – Uses X11 to find the target window by PID or WM_CLASS.
  2. Capture – Grabs the window's pixels using a fast custom C library.
  3. AI Upscaling – CuNNy compute shaders (written in HLSL, compiled via Compushady) produce a 2× (or 4×) larger image .
  4. Aspect‑Preserving Scaling – A lightweight Lanczos2 compute shader scales the upscaled image to fill the monitor, adding black bars to maintain the original aspect ratio.
  5. Display – The result is rendered in a transparent overlay window that bypasses the window manager (so it always stays on top).
  6. Input Forwarding – Mouse events are transformed using the scaling ratios and sent to the original window via XSendEvent.

Future Plans

  • Standalone GUI application – Create a windowed app interface for easier management.
  • Addition of more models – Parse and include other models and shaders.
  • Native Wayland support – Support pure Wayland windows without XWayland.
  • Option to force screen aspect ratio – Let users choose between letterboxing or stretching.

Motivation

While real-time upscaling tools like Magpie and Lossless Scaling remain Windows-exclusive, projects such as lsfg-vk are successfully bringing their frame generation capabilities to Linux.

This project tackles the other half of the equation: AI-powered upscaling to deliver a native solution Linux has been missing, an experience similar to Gamescope that applies intelligent upscaling (similar to Anime4K) to any application.

Acknowledgments

This project stands on the shoulders of several open‑source works:

  • L65536 – For the original RealTimeSuperResolutionScreenUpscalerforLinux, which demonstrated the feasibility of real‑time CuNNy upscaling on Linux. This project extends that foundation with full‑screen scaling, accurate input forwarding, and support for all CuNNy NVL models and GPU vendors.
  • funnyplanter – For CuNNy, the neural network upscaling models, especially the Magpie NVL variants trained for visual novel content.
  • Compushady – Python library for GPU compute (Vulkan backend).
  • PySide6 – Qt bindings used for the overlay window.
  • python‑xlib – X11 client library for window management and input forwarding.
  • pyewmh – Query and control of window manager.
  • psutil – Library for retrieving information on running processes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

linux_rt_upscaler-0.2.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (728.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

linux_rt_upscaler-0.2.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (728.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

linux_rt_upscaler-0.2.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (728.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

linux_rt_upscaler-0.2.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (728.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

linux_rt_upscaler-0.2.4-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (728.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file linux_rt_upscaler-0.2.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for linux_rt_upscaler-0.2.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 8ac4d1895aeea75fc9e614ec854709dffb535c3d69ddac0f7f09a15726d3ac99
MD5 a84e1e42ec02f0cdf8f20d0f19568024
BLAKE2b-256 713672d980592a71a9767634c6f65292610d6f16bf87d3361e74e421ad971462

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: build_wheels.yml on baronsmv/linux-rt-upscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linux_rt_upscaler-0.2.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for linux_rt_upscaler-0.2.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 beb39d808bb5ccc4d48a7b75f9a7206740b5fc27d5153bff1e5648c4ab6a0ef8
MD5 0fc1b924638bd97bac2df9fb70d3e375
BLAKE2b-256 cf19763839fff02a8bfcbe45c415378b7fd33a4073b334e126e6196718cfdc12

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: build_wheels.yml on baronsmv/linux-rt-upscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linux_rt_upscaler-0.2.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for linux_rt_upscaler-0.2.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ea3bbd29cd821508ba854613604a7423cb263fedda7d7914f11d8182f26dd941
MD5 24f00e6b7e1cba08044de044d4185d7f
BLAKE2b-256 6faa5295099a1b8ab73518ee0f999f8917a0bed08ad5752eb2dabff6a42db8dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: build_wheels.yml on baronsmv/linux-rt-upscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linux_rt_upscaler-0.2.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for linux_rt_upscaler-0.2.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 215c0f2dce617ff47f5e97cced20f6307df2a081e3c1fee0b4b5615df53616ca
MD5 b9732a319bcecfcd60cd2a96d92a3bec
BLAKE2b-256 83c7d9091631738722ab6ce5eca50b0a3b67ebdadc172a0d9e59d180d6eab1b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.4-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: build_wheels.yml on baronsmv/linux-rt-upscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linux_rt_upscaler-0.2.4-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for linux_rt_upscaler-0.2.4-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 aa93b8a008d1203cf89e156304da41dae7bdb8747d0ca579c67ea644b1a47ff1
MD5 16aa83e4439ab82e62a25853fb83a989
BLAKE2b-256 59439065312834d931fc57ef7b98794ef979ab8445a609668cb7edc5816c8d22

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.4-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: build_wheels.yml on baronsmv/linux-rt-upscaler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page