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 2x (or 4x) 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 2x 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.
  • Flexible Output Geometry – Control the overlay size, scaling mode, offset and borders.
  • Input Forwarding – Click, move, and drag on the upscaled image as if interacting directly with the original window.
  • Hardware Accelerated – Vulkan compute (Compushady) works on NVIDIA, AMD, and Intel GPUs.
  • XWayland Compatible – Runs under Wayland compositors by automatically forcing X11 platform for Qt.
  • Low Overhead – Final scaling pass uses hardware Lanczos2 filtering.
  • Global Hotkeys & On‑Screen Display – Switch models, take lossless screenshots and more using keyboard shortcuts.

Requirements

  • GNU/Linux (X11 or Wayland with XWayland)
  • Vulkan-capable GPU (NVIDIA, AMD, Intel)
  • Vulkan drivers (libvulkan-dev)
  • X11 development libraries (libx11-dev)
  • X C Binding headers (libxcb-dev)
  • Python 3.8 – 3.13

Python 3.14 compatibility: Currently not supported due to a low‑level Vulkan backend issue. Please use a Python ≤ 3.13 virtual environment if you have Python 3.14 installed. See issue #1 for details.

Installation

1. System dependencies

Debian / Ubuntu / Linux Mint

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

Fedora / RHEL / CentOS

sudo dnf install vulkan-loader-devel libX11-devel libxcb-devel

Arch Linux

sudo pacman -S vulkan-devel libx11 libxcb

openSUSE

sudo zypper install vulkan-devel libX11-devel libxcb-devel

Alpine Linux

sudo apk add vulkan-headers libx11-dev libxcb-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
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

# Perform 4x upscaling (two 2x passes)
upscale -2

# Set a custom overlay geometry (50% size, fitted)
upscale -o 50%

# Crop 100 pixels from top and left, then upscale
upscale --crop-top 100 --crop-left 100

# Shift the overlay 100 pixels right and 50 down
upscale --offset-x 100 --offset-y 50

For a full list of options and examples:

upscale --help

Controls

Shortcut Action
Alt+Shift+S Toggle overlay visibility / pause processing
Alt+Shift+M Switch to the next upscaling model
Alt+Shift+G Cycle output geometry (fit → stretch → cover)
Alt+Shift+P Take a lossless screenshot

All hotkeys can be customised in the configuration file.

  • Exit: Ctrl+C in the terminal.

Profiles

You can define named configuration profiles in your YAML config file. Profiles let you quickly switch settings for different games or applications without typing long command lines each time.

Create a config file (e.g., ~/.config/linux-rt-upscaler/config.yaml) and add a top‑level profiles key. Each profile is a dictionary with an optional match section and an options section.

If no profile is selected manually, the program checks all profiles that have a match section against the title of the target window. If a profile matches (any match criterion is sufficient), its options are applied automatically.

# General defaults (lowest priority)
model: fast
select: false

profiles:
  game:
    match:
      title: "Danganronpa"      # Exact match (case-insensitive)
      title_contains: "ronp"    # Or substring match
      title_regex: "Dangan.*"   # Or regular expression
    options:
      model: 4x24
      double_upscale: true

A more detailed example is included here.

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 2x (or 4x) 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.

Known Issues

Mouse forwarding may not work with Wine, Proton <10 and other applications

Synthetic mouse events (clicks, motion, wheel) sent by the overlay are ignored by:

  • Wine and Proton versions older than 10.0 (Proton 10 works correctly).
  • Certain native applications like Firefox.

For more details, see issue #7.

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).
  • screeninfo – Python library to fetch location and size of physical screens.
  • PySide6 – Qt bindings used for the overlay window.
  • python‑xlib – X11 client library for window management and input forwarding.
  • XCB binding for Python – XCB binding for Python.
  • pyewmh – Query and control of window manager.
  • psutil – Library for retrieving information on running processes.
  • Pillow – The Python Imaging Library

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.9-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (760.6 kB view details)

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

linux_rt_upscaler-0.2.9-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (760.6 kB view details)

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

linux_rt_upscaler-0.2.9-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (760.6 kB view details)

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

linux_rt_upscaler-0.2.9-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (760.6 kB view details)

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

linux_rt_upscaler-0.2.9-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (760.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.9-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.9-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 82d844469ce46886536c6fc175d76368fdccb182e2ec93d638f4544378e009d8
MD5 29512513886863b1b2e43488ad87ac8c
BLAKE2b-256 b133a1413a917a67659142d29e7c2ebef367227de000d4c9e2b4087a7c2a89da

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.9-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.9-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.9-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 643110e50c75ecc52eb9e2a845bd25335bb6f12267b043bbe2cfb123c68dc8d7
MD5 701de521b3bf80e14adc3ce90333d924
BLAKE2b-256 8eb5e01aef9da98c5857428c47061e35fb8128e5eb80041737ce77636aacfc28

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.9-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.9-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.9-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 b200dde430aa6f39bb1d7d5fcf80239bcdfcfec51e92e024db132b349d77aed3
MD5 9df4163ace677b9d2986d9f0f1a75f74
BLAKE2b-256 3fff486f159346baa6834b4c23c45eeed12f2fa3a567a9395d1ce3e8c0dd604d

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.9-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.9-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.9-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 ebc526153d4a34744571f7bd1d418f25aa9ea94df6422c15bd8c2e11dd999d07
MD5 6fbf86fe9278245d3e5705f04a557b75
BLAKE2b-256 cf097e22374e11d22016f6ae638c05f66d778de313c56d8ea7ab842a1e90aa9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.9-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.9-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.9-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 9c81b5d2b83001ca8ebca200dbc2d2302b9352bab43c38df22bef188a26adba6
MD5 584e0a2142241ec66a968b671d51defe
BLAKE2b-256 1fae98413dcb70aaf65010bdc251931641cb0d74ae8e3ccd2d913b2d0129abff

See more details on using hashes here.

Provenance

The following attestation bundles were made for linux_rt_upscaler-0.2.9-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