Skip to main content

Multi-backend deep learning upscalers for pixtreme

Project description

pixtreme-upscale

Multi-backend deep learning upscalers for pixtreme

Overview

pixtreme-upscale provides GPU-accelerated deep learning super-resolution with support for ONNX, PyTorch, and TensorRT backends. Integrates with Spandrel for automatic model architecture detection.

Features

  • Multi-Backend Support: ONNX Runtime, PyTorch, TensorRT
  • Automatic Tiling: Handle large images with automatic tiling workflow
  • Model Conversion: PyTorch → ONNX → TensorRT pipeline
  • Spandrel Integration: Automatic architecture detection for 100+ models
  • Zero-Copy: Direct GPU memory operations

Installation

Requirements:

  • Python >= 3.12
  • CUDA Toolkit 12.x
  • NVIDIA GPU with compute capability >= 6.0
# Base installation (ONNX + PyTorch)
pip install pixtreme-upscale

# With TensorRT support
pip install pixtreme-upscale[tensorrt]

Requires pixtreme-core, PyTorch, ONNX Runtime, and CUDA Toolkit 12.x.

Quick Start

import pixtreme_upscale as pu
import pixtreme_core as px

# Read image
img = px.imread("input.jpg")

# ONNX backend (fastest compatibility)
upscaler = pu.OnnxUpscaler("model.onnx")
upscaled = upscaler.get(img)

# PyTorch backend (most flexible)
upscaler = pu.TorchUpscaler("model.pth")
upscaled = upscaler.get(img)

# TensorRT backend (fastest performance)
upscaler = pu.TrtUpscaler("model.onnx")  # Auto-converts to TRT
upscaled = upscaler.get(img)

# Save result
px.imwrite("output.jpg", upscaled)

Automatic Tiling

All upscalers automatically handle large images via tiling:

# Automatically tiles large images
large_img = px.imread("8k_image.jpg")
upscaled = upscaler.get(large_img)  # Handles tiling internally

Model Conversion

from pixtreme_upscale.utils.model_convert import torch_to_onnx, onnx_to_trt

# PyTorch → ONNX
torch_to_onnx("model.pth", "model.onnx", input_shape=(1, 3, 1080, 1920))

# ONNX → TensorRT
onnx_to_trt("model.onnx", "model.trt", precision="fp16")

Supported Models

Works with Spandrel-supported architectures:

  • ESRGAN, Real-ESRGAN, RealESRGAN+
  • SwinIR, HAT, OmniSR
  • And 100+ more architectures

License

MIT License - see LICENSE file for details.

Links

Project details


Download files

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

Source Distribution

pixtreme_upscale-0.8.3.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

pixtreme_upscale-0.8.3-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file pixtreme_upscale-0.8.3.tar.gz.

File metadata

  • Download URL: pixtreme_upscale-0.8.3.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.18

File hashes

Hashes for pixtreme_upscale-0.8.3.tar.gz
Algorithm Hash digest
SHA256 58d398601d300da31e06c9f80d553bd9a268337eb6918a466a83fdffe8f48cc4
MD5 675ae033c0b19e30f1e80c196f63f7ba
BLAKE2b-256 d86b276fc4a53d252a23e6b2d86abc8432f1da25f1cf73653671c8ca6ac5a80e

See more details on using hashes here.

File details

Details for the file pixtreme_upscale-0.8.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pixtreme_upscale-0.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2e85d041835ca4f5a506267117d1041a8810468406e165ee947284f09c4e1d87
MD5 5985c2d6688c776ea78aa356ac270783
BLAKE2b-256 a92111ee943fef59487eda72c4dcc8c2ecf83bc3a8efe3d482d8270dbcb026b8

See more details on using hashes here.

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