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

# 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 import convert_pytorch_to_onnx, convert_onnx_to_tensorrt

# PyTorch → ONNX
convert_pytorch_to_onnx("model.pth", "model.onnx")

# ONNX → TensorRT (requires tensorrt extra)
convert_onnx_to_tensorrt("model.onnx", "model.trt", fp16=True)

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.6.0.tar.gz (17.6 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.6.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pixtreme_upscale-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6f853693038c53d878624fdbb7edf7239852c70d692d788c9dd159a0f10bf72a
MD5 3950e541d07ebf26136da87bb44559f6
BLAKE2b-256 dd2ffb25583dd4bb50910fdd9bce9b09bc1cf86aafba7c6b47737b3e9b9e4e69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pixtreme_upscale-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a394f3182913dfe9d86c4a1dadb138d42c87982cc5eb5fcaccc9028e2290e7db
MD5 7448e3030b9a464e84411ccf19b98897
BLAKE2b-256 2c9bfc5acc1833c04a4c85c8a679eb3a16e34f1eb1b18c3a9cc23e8db8125cc3

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