Real-time AI upscaler for any Linux window using CuNNy
Project description
Real‑Time Upscaler for Linux
A real‑time AI upscaler for any application window on GNU/Linux. It uses CuNNy neural networks to perform 2× upscaling, then scales the result to full screen while preserving aspect ratio. Mouse clicks and motion are automatically forwarded to the original window.
Based on
Based on RealTimeSuperResolutionScreenUpscalerforLinux by L65536 ---specifically its v07linux, with the following differences:
- Full‑screen scaling – The upscaled image now fills the monitor, applying a second scaling layer while preserving aspect ratio.
- Click/motion forwarding – Mouse clicks and motion are forwarded to the original window with proper coordinate transformation. This can be deactivated with the
-doption. - Support all CuNNy NVL models – All NVL models have been translated to work in Compushady.
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 the CuNNy NVL variants, offering a range of quality/performance trade‑offs:
8x32– Highest quality, slowest.4x324x244x164x123x12fast– Default. Recommended for slow machines.fasterveryfast– 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.
- Low Overhead – Minimal CPU/GPU usage; the final scaling pass uses hardware Lanczos2 filtering.
Requirements
- GNU/Linux with X11 (Wayland is not supported)
- Vulkan-capable GPU from any vendor (NVIDIA, AMD, Intel)
- Vulkan drivers (
libvulkan-devon Debian/Ubuntu) - X11 development libraries (
libx11-dev) - Python 3.8 or newer
Installation
Option 1: Install from PyPI (Recommended)
# Install system dependencies (Debian/Ubuntu)
sudo apt install libvulkan-dev libx11-dev
# Install with pipx (recommended)
pipx install linux-rt-upscaler
# Or with regular pip
pip install linux-rt-upscaler
Option 2: Install from source
# Clone the repository
git clone https://github.com/baronsmv/linux-rt-upscaler.git
cd linux-rt-upscaler
# Install system dependencies (Debian/Ubuntu)
sudo apt install libvulkan-dev libx11-dev
# Install Python packages
pip install -r requirements.txt
# Install 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+Cin the terminal where the upscaler is running. - Dimming/Click‑through (only when
-dis 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).
Future Plans
- Standalone GUI application – Create a windowed app interface for easier management of the upscaler
- Addition of more models – Parse and include other models and shaders
How It Works
- Window Selection – Uses X11 to find the target window by PID or WM_CLASS.
- Capture – Grabs the window's pixels using a fast custom C library.
- AI Upscaling – CuNNy compute shaders (written in HLSL, compiled via Compushady) produce a 2× larger image .
- 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.
- Display – The result is rendered in a transparent overlay window that bypasses the window manager (so it always stays on top).
- Input Forwarding – Mouse events are transformed using the scaling ratios and sent to the original window via
XSendEvent.
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, a fullscreen Gamescope-like experience that applies intelligent upscaling (similar to Anime4K) to any application.
Acknowledgments
- L65536 – For the original RealTimeSuperResolutionScreenUpscalerforLinux project, which provided the foundational scripts and CuNNy integration
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linux_rt_upscaler-0.1.6.tar.gz.
File metadata
- Download URL: linux_rt_upscaler-0.1.6.tar.gz
- Upload date:
- Size: 643.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a7ed3cc3dac7f75ed7b77ae33b795a3351ee5e9d7808b4f747887b206dd7350
|
|
| MD5 |
a56e1c1de53c3403e006ee33e20a5506
|
|
| BLAKE2b-256 |
a7e7c688ce8e187a6d0220c58dc25f1e931407e8453a58ea1915f764856d5fd3
|
File details
Details for the file linux_rt_upscaler-0.1.6-py3-none-any.whl.
File metadata
- Download URL: linux_rt_upscaler-0.1.6-py3-none-any.whl
- Upload date:
- Size: 713.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e93f88eb01eb262d8fa46c3c5f6141f86670ec0d9644774d21ab4a7a5f62a3d
|
|
| MD5 |
92a7e2b025534af3fd147859998fec85
|
|
| BLAKE2b-256 |
203db9c2f0d482a0e51400c101a2992b279dcda175263d52bc55aa5824fdbbb6
|