Metadata-Version: 2.4
Name: upscale
Version: 0.5.1
Summary: Local AI image upscaler: chained Real-ESRGAN passes to any scale, seam-free feather-blended tiles
Author: upscale
License: MIT
Project-URL: Homepage, https://wwylon.github.io/upscale/
Project-URL: Repository, https://github.com/wwylon/upscale
Project-URL: Issues, https://github.com/wwylon/upscale/issues
Keywords: image-upscaler,super-resolution,real-esrgan,upscaling,pytorch,onnx,mcp,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: torch>=2.0
Requires-Dist: torchvision
Requires-Dist: spandrel
Requires-Dist: Pillow
Requires-Dist: tifffile
Requires-Dist: imagecodecs
Requires-Dist: psd-tools>=1.9
Requires-Dist: tqdm
Requires-Dist: click
Requires-Dist: numpy
Requires-Dist: pydantic>=2.0
Provides-Extra: ui
Requires-Dist: gradio>=4.0; extra == "ui"
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == "server"
Requires-Dist: uvicorn[standard]>=0.27; extra == "server"
Requires-Dist: python-multipart>=0.0.9; extra == "server"
Provides-Extra: mcp
Requires-Dist: mcp>=1.0; extra == "mcp"
Provides-Extra: desktop
Requires-Dist: pywebview>=5.0; extra == "desktop"
Provides-Extra: slim
Requires-Dist: upscale[desktop,server]; extra == "slim"
Requires-Dist: onnxruntime>=1.17; extra == "slim"
Requires-Dist: Pillow; extra == "slim"
Requires-Dist: numpy; extra == "slim"
Requires-Dist: tifffile; extra == "slim"
Requires-Dist: imagecodecs; extra == "slim"
Requires-Dist: tqdm; extra == "slim"
Requires-Dist: click; extra == "slim"
Requires-Dist: pydantic>=2.0; extra == "slim"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"
Provides-Extra: classical
Requires-Dist: opencv-python-headless>=4.8; extra == "classical"
Provides-Extra: vectorize
Requires-Dist: vtracer>=0.6; extra == "vectorize"
Requires-Dist: pyautotrace>=0.0.7; extra == "vectorize"
Requires-Dist: resvg_py>=0.2; extra == "vectorize"
Provides-Extra: all
Requires-Dist: upscale[classical,desktop,dev,mcp,server,slim,ui,vectorize]; extra == "all"
Dynamic: license-file

# upscale

[![CI](https://github.com/wwylon/upscale/actions/workflows/ci.yml/badge.svg)](https://github.com/wwylon/upscale/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Local AI image upscale. Chains Real-ESRGAN passes (via [spandrel](https://github.com/chaiNNer-org/spandrel)) to reach any target scale, with feather-blended overlapping tiles so large outputs have no seams. Runs on CPU or an NVIDIA GPU; nothing leaves your machine except the one-time model download.

![upscale hero](docs/assets/hero.jpg)

![Before/after: 160px source upscaled 4x](docs/assets/demo.gif)

> Not related to other projects named "upscaler" on GitHub or PyPI. The package, the import name and the command are all `upscale`.

## Install

```bash
pip install "git+https://github.com/wwylon/upscale.git"   # or: pipx install git+https://github.com/wwylon/upscale.git
```

The pip install pulls PyTorch (large, slow first install). A PyTorch-free build exists only as the Windows desktop app (ONNX Runtime); see [docs/develop.md](docs/develop.md).

From a clone:

```bash
pip install -e .
pip install -e ".[server]"    # web UI + job API
pip install -e ".[mcp]"       # MCP tools for agents
```

## First win

```bash
upscale upscale input.png output.png --scale 4 --cpu
```

Use `--target-size 8000` for a target long edge instead of a factor, drop `--cpu` to use the GPU, and `--fast` for the quick SPAN model. Models download on first use and are hash-verified.

```bash
upscale models list              # built-in models
upscale suggest input.png        # heuristic model pick
upscale serve                    # local web UI at http://127.0.0.1:8787/en/
upscale mcp                      # MCP tools over stdio
```

Equivalent module form: `python -m upscale upscale ...`

## Highlights

- Exact scale (`--scale`) or target long edge (`--target-size`); extra passes only when needed
- Tile size chosen from free VRAM; very large frames spill to disk between passes
- Swappable models: Real-ESRGAN family, HAT, SPAN, community weights, or your own `.pth`
- Large outputs saved as BigTIFF; alpha preserved
- Web UI in several languages; Windows desktop build uses ONNX Runtime (no PyTorch)
- No telemetry

## Library

```python
from upscale import UpscaleConfig, execute

execute(UpscaleConfig(input="in.png", output="out.png", scale=4, cpu=True))
```

## Documentation

- [CLI reference](docs/cli.md)
- [HTTP and MCP API](docs/api.md)
- [Development, desktop build, layout](docs/develop.md)
- [Android skeleton](docs/android.md)

## Tests

```bash
pip install -e ".[dev,server,mcp]"
pytest
```

MIT licensed. See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).
