upscalex 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- upscalex-0.1.0/.gitignore +49 -0
- upscalex-0.1.0/CONTRIBUTING.md +133 -0
- upscalex-0.1.0/INSTALLATION.md +190 -0
- upscalex-0.1.0/LICENSE +21 -0
- upscalex-0.1.0/PKG-INFO +268 -0
- upscalex-0.1.0/README.md +235 -0
- upscalex-0.1.0/SKILLS.md +115 -0
- upscalex-0.1.0/assets/banner.png +0 -0
- upscalex-0.1.0/assets/comparison.png +0 -0
- upscalex-0.1.0/assets/sample_original.png +0 -0
- upscalex-0.1.0/assets/sample_upscaled.png +0 -0
- upscalex-0.1.0/docs/architecture.md +108 -0
- upscalex-0.1.0/docs/cli-guide.md +231 -0
- upscalex-0.1.0/docs/installation.md +172 -0
- upscalex-0.1.0/docs/mcp-guide.md +293 -0
- upscalex-0.1.0/docs/troubleshooting.md +166 -0
- upscalex-0.1.0/pyproject.toml +53 -0
- upscalex-0.1.0/src/upscalex/__init__.py +11 -0
- upscalex-0.1.0/src/upscalex/cli.py +296 -0
- upscalex-0.1.0/src/upscalex/engine.py +697 -0
- upscalex-0.1.0/src/upscalex/server.py +241 -0
- upscalex-0.1.0/src/upscalex/utils.py +198 -0
- upscalex-0.1.0/tests/test_cli.py +67 -0
- upscalex-0.1.0/tests/test_engine.py +181 -0
- upscalex-0.1.0/uv.lock +2454 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# RealESRGAN engine downloads & binaries
|
|
30
|
+
realesrgan-ncnn-vulkan*
|
|
31
|
+
realesrgan.zip
|
|
32
|
+
models/
|
|
33
|
+
*.pth
|
|
34
|
+
*.bin
|
|
35
|
+
*.param
|
|
36
|
+
*.dll
|
|
37
|
+
|
|
38
|
+
# Pytest / Cache
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
.coverage
|
|
41
|
+
htmlcov/
|
|
42
|
+
|
|
43
|
+
# IDE / OS
|
|
44
|
+
.vscode/
|
|
45
|
+
.idea/
|
|
46
|
+
*.swp
|
|
47
|
+
*~
|
|
48
|
+
.DS_Store
|
|
49
|
+
Thumbs.db
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Contributing to UpscaleX
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to UpscaleX. This project maintains a strict engineering standard focused on high-performance image processing, robust CLI ergonomics, and reliable Model Context Protocol (MCP) server integration.
|
|
4
|
+
|
|
5
|
+
All contributions, whether bug fixes, documentation improvements, model integrations, or architectural enhancements, are welcome.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Code of Conduct
|
|
10
|
+
|
|
11
|
+
Contributors are expected to adhere to professional communication and collaboration standards:
|
|
12
|
+
- Maintain technical, constructive, and objective dialogue in issues and pull requests.
|
|
13
|
+
- Respect differing perspectives and technical approaches.
|
|
14
|
+
- Focus on performance, memory safety, test coverage, and documentation accuracy.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Development Environment Setup
|
|
19
|
+
|
|
20
|
+
UpscaleX uses [`uv`](https://github.com/astral-sh/uv) as its package manager and execution environment.
|
|
21
|
+
|
|
22
|
+
### Prerequisites
|
|
23
|
+
|
|
24
|
+
- Python 3.10 or later
|
|
25
|
+
- Vulkan-compatible GPU (NVIDIA, AMD, or Intel) with up-to-date graphics drivers
|
|
26
|
+
- Git
|
|
27
|
+
|
|
28
|
+
### Initializing the Workspace
|
|
29
|
+
|
|
30
|
+
1. Fork the repository on GitHub and clone your fork:
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/<your-username>/upscalex.git
|
|
33
|
+
cd upscalex
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. Create a virtual environment using `uv`:
|
|
37
|
+
```bash
|
|
38
|
+
uv venv
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
3. Install editable dependencies, including development tools:
|
|
42
|
+
```bash
|
|
43
|
+
uv pip install -e ".[dev]"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
4. Verify your setup by running the test suite:
|
|
47
|
+
```bash
|
|
48
|
+
uv run pytest -v
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Project Structure
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
upscalex/
|
|
57
|
+
├── src/
|
|
58
|
+
│ └── upscalex/
|
|
59
|
+
│ ├── __init__.py # Package initialization and public API
|
|
60
|
+
│ ├── cli.py # Command-line interface implementation
|
|
61
|
+
│ ├── engine.py # Subprocess runner, tiling logic, Lanczos resampler
|
|
62
|
+
│ ├── server.py # FastMCP server and tool registrations
|
|
63
|
+
│ └── utils.py # Binary fetcher, platform resolvers, formatters
|
|
64
|
+
├── tests/
|
|
65
|
+
│ ├── test_cli.py # CLI invocation and runner tests
|
|
66
|
+
│ └── test_engine.py # Core processing, mathematical sizing, and GPU tests
|
|
67
|
+
├── docs/ # Technical documentation
|
|
68
|
+
│ ├── architecture.md # Pipeline architecture and memory management
|
|
69
|
+
│ ├── cli-guide.md # Command-line interface reference
|
|
70
|
+
│ └── mcp-guide.md # Model Context Protocol integration reference
|
|
71
|
+
├── pyproject.toml # PEP 621 package metadata and entry points
|
|
72
|
+
├── uv.lock # Pinned dependency lockfile
|
|
73
|
+
└── LICENSE # MIT License
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Coding Standards
|
|
79
|
+
|
|
80
|
+
### Python Style
|
|
81
|
+
|
|
82
|
+
- Adhere to PEP 8 standards with modern typing annotations (`from __future__ import annotations`).
|
|
83
|
+
- Ensure all public functions, classes, and methods have comprehensive docstrings explaining arguments, return types, and exceptions raised.
|
|
84
|
+
- Avoid emoji usage in commit messages, documentation, terminal outputs, and code comments. Maintain a clean, professional technical tone.
|
|
85
|
+
- Do not introduce dependencies that require CUDA compilation unless behind optional build flags. The core engine relies on Vulkan runtime binaries.
|
|
86
|
+
|
|
87
|
+
### Memory & Stability Rules
|
|
88
|
+
|
|
89
|
+
- When interacting with high-resolution image decoders (such as Pillow), always account for ultra-large resolutions exceeding 100 Megapixels.
|
|
90
|
+
- Set `Image.MAX_IMAGE_PIXELS = None` in modules handling raw bitmaps to avoid decompression bomb exceptions during multi-gigapixel print jobs.
|
|
91
|
+
- Always guarantee temporary files created during supersampling or tile processing are safely unlinked in `finally` blocks.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Testing Workflow
|
|
96
|
+
|
|
97
|
+
All pull requests must maintain 100% pass rate on existing and new tests.
|
|
98
|
+
|
|
99
|
+
Run tests locally using pytest:
|
|
100
|
+
```bash
|
|
101
|
+
uv run pytest -v
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
When contributing new features:
|
|
105
|
+
1. Add corresponding unit tests in `tests/test_engine.py` or `tests/test_cli.py`.
|
|
106
|
+
2. Verify that CLI commands exit with code `0` on success and appropriate non-zero error codes on failure.
|
|
107
|
+
3. Test edge cases such as missing binaries, invalid image paths, non-standard aspect ratios, and extreme resolutions.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Pull Request Process
|
|
112
|
+
|
|
113
|
+
1. Create a descriptive feature branch from `main`:
|
|
114
|
+
```bash
|
|
115
|
+
git checkout -b feature/tiling-optimization
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
2. Format commits using Conventional Commit style:
|
|
119
|
+
- `feat: add support for custom tile padding`
|
|
120
|
+
- `fix: handle missing models directory in custom paths`
|
|
121
|
+
- `docs: update mcp configuration guide for cursor`
|
|
122
|
+
- `perf: optimize memory consumption during lanczos downscaling`
|
|
123
|
+
|
|
124
|
+
3. Ensure `uv.lock` is kept up to date if dependencies are modified:
|
|
125
|
+
```bash
|
|
126
|
+
uv lock
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
4. Push your branch to your fork and submit a Pull Request against the `main` branch.
|
|
130
|
+
5. Provide a clear summary in your pull request description detailing:
|
|
131
|
+
- The rationale for the change.
|
|
132
|
+
- Any benchmarks or performance impacts.
|
|
133
|
+
- Verification steps taken.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# UpscaleX Installation Guide
|
|
2
|
+
|
|
3
|
+
This document provides two installation paths for UpscaleX:
|
|
4
|
+
1. **Agent Autonomous Setup Prompt**: A ready-to-use prompt that can be pasted into any AI coding assistant (Antigravity, Claude Code, Cursor, Windsurf) to automatically install, test, and configure the MCP server.
|
|
5
|
+
2. **Manual Installation Guide**: Step-by-step terminal instructions for Windows, Linux, and macOS.
|
|
6
|
+
|
|
7
|
+
See the complete guide in [`docs/installation.md`](docs/installation.md) or read the self-contained instructions below.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Agent Autonomous Setup Prompt
|
|
12
|
+
|
|
13
|
+
Copy and paste the following prompt directly into your AI coding assistant:
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
Please install and configure the UpscaleX MCP and CLI tool in this environment.
|
|
17
|
+
|
|
18
|
+
Repository: https://github.com/The-Open-Source-Founder/upscalex.git
|
|
19
|
+
|
|
20
|
+
Instructions:
|
|
21
|
+
1. Verify Python 3.10+ and git are available.
|
|
22
|
+
2. Clone the repository into an appropriate local tools or workspace directory:
|
|
23
|
+
git clone https://github.com/The-Open-Source-Founder/upscalex.git
|
|
24
|
+
3. Using uv (or python venv):
|
|
25
|
+
- Create a virtual environment: uv venv (or python -m venv .venv)
|
|
26
|
+
- Install the package in editable mode with development dependencies:
|
|
27
|
+
uv pip install -e ".[dev]"
|
|
28
|
+
4. Execute the test suite to ensure the engine and CLI are operational:
|
|
29
|
+
uv run pytest -v
|
|
30
|
+
5. Register the MCP server in the client configuration (e.g. claude_desktop_config.json or mcp_config.json):
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"upscalex": {
|
|
34
|
+
"command": "<ABSOLUTE_PATH_TO_VENV_PYTHON>",
|
|
35
|
+
"args": ["-m", "upscalex.server"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
6. Run "upscalex models" and report confirmation once completed.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 2. Quick Installation via PyPI
|
|
45
|
+
|
|
46
|
+
For standalone CLI and MCP server usage, install directly via `pip`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install upscalex
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Verify the installation:
|
|
53
|
+
```bash
|
|
54
|
+
upscalex doctor
|
|
55
|
+
upscalex models
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 3. Manual Installation from Source
|
|
61
|
+
|
|
62
|
+
### Prerequisites
|
|
63
|
+
|
|
64
|
+
- **Python**: Version 3.10 or higher.
|
|
65
|
+
- **Package Manager**: [`uv`](https://github.com/astral-sh/uv) (recommended) or standard `pip`.
|
|
66
|
+
- **GPU Driver**: Vulkan-compatible GPU drivers (NVIDIA GeForce/RTX, AMD Radeon, or Intel Arc/Iris).
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### Step 1: Clone the Repository
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/The-Open-Source-Founder/upscalex.git
|
|
74
|
+
cd upscalex
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### Step 2: Create a Virtual Environment and Install
|
|
80
|
+
|
|
81
|
+
#### Option A: Using `uv` (Recommended)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Create the virtual environment
|
|
85
|
+
uv venv
|
|
86
|
+
|
|
87
|
+
# Install in editable mode with development dependencies
|
|
88
|
+
uv pip install -e ".[dev]"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Option B: Using Standard Python and Pip
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Windows
|
|
95
|
+
python -m venv .venv
|
|
96
|
+
.\.venv\Scripts\activate
|
|
97
|
+
pip install -e ".[dev]"
|
|
98
|
+
|
|
99
|
+
# Linux / macOS
|
|
100
|
+
python3 -m venv .venv
|
|
101
|
+
source .venv/bin/activate
|
|
102
|
+
pip install -e ".[dev]"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### Step 3: Run the Verification Suite
|
|
108
|
+
|
|
109
|
+
Run pytest to verify the engine, CLI commands, and Vulkan inference:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
uv run pytest -v
|
|
113
|
+
# Or with standard venv:
|
|
114
|
+
pytest -v
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Expected result: `8 passed`.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### Step 4: Verify Available Models
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
upscalex models
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The tool will display the pre-trained model matrix (`realesrgan-x4plus`, `realesrgan-x4plus-anime`, etc.).
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### Step 5: Configure the MCP Server
|
|
132
|
+
|
|
133
|
+
To enable AI agents to execute upscaling jobs autonomously, add UpscaleX to your MCP client configuration.
|
|
134
|
+
|
|
135
|
+
#### Claude Desktop
|
|
136
|
+
|
|
137
|
+
Configuration file paths:
|
|
138
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
139
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
140
|
+
- **Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
141
|
+
|
|
142
|
+
Add the following entry under `"mcpServers"`:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"upscalex": {
|
|
148
|
+
"command": "uv",
|
|
149
|
+
"args": [
|
|
150
|
+
"run",
|
|
151
|
+
"--directory",
|
|
152
|
+
"/absolute/path/to/upscalex",
|
|
153
|
+
"upscalex-mcp"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### Cursor IDE
|
|
161
|
+
|
|
162
|
+
Add to `.cursor/mcp.json` or your project settings:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"upscalex": {
|
|
168
|
+
"command": "uv",
|
|
169
|
+
"args": [
|
|
170
|
+
"run",
|
|
171
|
+
"--directory",
|
|
172
|
+
"/absolute/path/to/upscalex",
|
|
173
|
+
"upscalex-mcp"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Step 6: Test Upscaling
|
|
183
|
+
|
|
184
|
+
Run a test upscale on any image:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
upscalex upscale input.png --target 16k
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Output file `input_16k.png` will be generated in the same directory.
|
upscalex-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arunmozhi Varman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
upscalex-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: upscalex
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: UpscaleX MCP/CLI: Production-grade 8K/16K image upscaler CLI and Model Context Protocol (MCP) server powered by RealESRGAN, Vulkan GPU acceleration, and Lanczos supersampling.
|
|
5
|
+
Project-URL: Homepage, https://github.com/The-Open-Source-Founder/upscalex
|
|
6
|
+
Project-URL: Documentation, https://github.com/The-Open-Source-Founder/upscalex#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/The-Open-Source-Founder/upscalex.git
|
|
8
|
+
Project-URL: Issues, https://github.com/The-Open-Source-Founder/upscalex/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/The-Open-Source-Founder/upscalex/releases
|
|
10
|
+
Author-email: Arunmozhi Varman <arunmozhi@example.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: 16k,8k,ai,cli,image-processing,mcp,realesrgan,super-resolution,upscale,upscalex,vulkan
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: click>=8.1.0
|
|
27
|
+
Requires-Dist: fastmcp>=0.4.0
|
|
28
|
+
Requires-Dist: pillow>=10.0.0
|
|
29
|
+
Requires-Dist: rich>=13.0.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<img src="https://raw.githubusercontent.com/The-Open-Source-Founder/upscalex/main/assets/banner.png" alt="UpscaleX Banner" width="100%">
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
# UpscaleX MCP/CLI
|
|
39
|
+
|
|
40
|
+
[](LICENSE)
|
|
41
|
+
[](https://www.python.org/downloads/)
|
|
42
|
+
[](https://modelcontextprotocol.io)
|
|
43
|
+
[](https://www.khronos.org/vulkan/)
|
|
44
|
+
|
|
45
|
+
UpscaleX is a production-grade 8K and 16K image upscaler CLI and Model Context Protocol (MCP) server powered by RealESRGAN, Vulkan GPU hardware acceleration, and Lanczos supersampling.
|
|
46
|
+
|
|
47
|
+
Engineered for digital print workflows, large-format poster production, fine art reproductions, and autonomous AI coding agents in Claude Desktop, Antigravity, and Cursor.
|
|
48
|
+
|
|
49
|
+
> Looking for quick setup? Read the [Installation Guide](INSTALLATION.md) for a copy-paste AI Agent setup prompt and manual instructions, or provide your AI coding assistant with the [UpscaleX Agent Skill](SKILLS.md).
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Table of Contents
|
|
54
|
+
|
|
55
|
+
- [Key Features](#key-features)
|
|
56
|
+
- [Installation Guide](INSTALLATION.md)
|
|
57
|
+
- [AI Agent Skill](SKILLS.md)
|
|
58
|
+
- [Visual Quality Comparison](#visual-quality-comparison)
|
|
59
|
+
- [Documentation Directory](#documentation-directory)
|
|
60
|
+
- [Quickstart with uv](#quickstart-with-uv)
|
|
61
|
+
- [Command-Line Interface](#command-line-interface)
|
|
62
|
+
- [Model Context Protocol (MCP) Integration](#model-context-protocol-mcp-integration)
|
|
63
|
+
- [Model Matrix](#model-matrix)
|
|
64
|
+
- [Testing and Verification](#testing-and-verification)
|
|
65
|
+
- [Contributing](#contributing)
|
|
66
|
+
- [License](#license)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Key Features
|
|
71
|
+
|
|
72
|
+
- **Dual-Mode Operation**: Interactive command-line interface (`upscalex`) and standard Model Context Protocol server (`upscalex-mcp`).
|
|
73
|
+
- **8K and 16K Presets**:
|
|
74
|
+
- **16K**: Native 4x RealESRGAN deep-learning model upscale producing master files up to 400+ Megapixels.
|
|
75
|
+
- **8K**: 4x deep-learning inference followed by Lanczos-3 downsampling (Supersampling Anti-Aliasing / SSAA) for sharp edges and zero noise.
|
|
76
|
+
- **Custom Dimensions**: Proportional scaling to arbitrary resolutions or physical print aspect ratios.
|
|
77
|
+
- **Cross-Platform Architecture**: Tested and supported across **Windows**, **Linux** (Ubuntu, Debian, Fedora), and **macOS** (Apple Silicon arm64 & Intel x86_64).
|
|
78
|
+
- **GPU Acceleration with Seamless CPU Fallback**: Automatically discovers and utilizes discrete Vulkan GPUs (NVIDIA RTX/GeForce, AMD Radeon, Intel Arc/Iris, Apple Silicon via MoltenVK). In headless Docker containers or environments without GPU drivers, the engine falls back to multi-threaded CPU Lanczos super-resolution with zero crashes.
|
|
79
|
+
- **Hardware Diagnostics**: Integrated `upscalex doctor` command inspects system compute devices, Vulkan support, and recommended tile dimensions.
|
|
80
|
+
- **Memory-Safe Tiling**: Sliding-window spatial tile decomposition (`--tile-size 256`) processes ultra-gigapixel images without Out-Of-Memory (OOM) failures on 4GB to 8GB GPUs.
|
|
81
|
+
- **Automated Engine Provisioning**: Downloads and validates the precompiled platform binary automatically if not found locally.
|
|
82
|
+
- **Print Fidelity Analysis**: Automatically calculates physical print dimensions in inches and centimeters at 300 DPI, 150 DPI, and 72 DPI.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Visual Quality Comparison
|
|
87
|
+
|
|
88
|
+
Below is an empirical comparison demonstrating UpscaleX 4x super-resolution reconstruction on a low-resolution pixelated source (`663 × 531` px, 0.35 MP) upscaled to high-definition print fidelity (`2,652 × 2,124` px, 5.63 MP) using the `realesrgan-x4plus` model.
|
|
89
|
+
|
|
90
|
+
<p align="center">
|
|
91
|
+
<img src="https://raw.githubusercontent.com/The-Open-Source-Founder/upscalex/main/assets/comparison.png" alt="UpscaleX Quality Comparison" width="100%">
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
| Metric | Original Source | UpscaleX 4x Output |
|
|
95
|
+
| :--- | :--- | :--- |
|
|
96
|
+
| **Pixel Dimensions** | `663 × 531` | **`2,652 × 2,124`** |
|
|
97
|
+
| **Total Megapixels** | 0.35 MP | **5.63 MP** (16× Pixel Multiplication) |
|
|
98
|
+
| **Edge Reconstruction** | Heavy block pixelation, ringing | Reconstructed circular spokes, sharp contours |
|
|
99
|
+
| **Max 300 DPI Print Size** | 2.2 × 1.8 inches | **8.8 × 7.1 inches** |
|
|
100
|
+
| **Model** | — | `realesrgan-x4plus` |
|
|
101
|
+
| **Hardware** | — | NVIDIA GeForce RTX 3050 Laptop GPU (10.8s) |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Documentation Directory
|
|
106
|
+
|
|
107
|
+
Comprehensive technical guides are available in the [`docs/`](docs/) directory and repository root:
|
|
108
|
+
|
|
109
|
+
- [Installation Guide](INSTALLATION.md): AI Agent autonomous copy-paste prompt and manual installation procedures.
|
|
110
|
+
- [AI Agent Skill Specification](SKILLS.md): Standard agent skill definition for Claude, Cursor, and Antigravity.
|
|
111
|
+
- [CLI Reference Guide](docs/cli-guide.md): Complete flag documentation, tiling strategies, and execution examples.
|
|
112
|
+
- [Model Context Protocol (MCP) Guide](docs/mcp-guide.md): JSON-RPC tool contracts, parameter schemas, and multi-client configuration.
|
|
113
|
+
- [Architecture & Mathematics Specification](docs/architecture.md): Deep-learning foundations, RRDB networks, Lanczos kernels, and memory bounds.
|
|
114
|
+
- [Contributing Guide](CONTRIBUTING.md): Code standards, test procedures, and pull request workflow.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Quickstart
|
|
119
|
+
|
|
120
|
+
### Option 1: Install from PyPI (Simplest for CLI & MCP)
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pip install upscalex
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Option 2: Clone and Install from Source (with uv)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
git clone https://github.com/The-Open-Source-Founder/upscalex.git
|
|
130
|
+
cd upscalex
|
|
131
|
+
|
|
132
|
+
# Create virtual environment and install package
|
|
133
|
+
uv venv
|
|
134
|
+
uv pip install -e .
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Inspect Available Models
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
upscalex models
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Command-Line Interface
|
|
146
|
+
|
|
147
|
+
### 16K Upscale (Default 4x Model)
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
upscalex upscale input.png --target 16k
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 8K Supersampled Upscale
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
upscalex upscale poster.png --target 8k -o poster_8k.png
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 2D Illustration / Anime Artwork
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
upscalex upscale graphic.png --model realesrgan-x4plus-anime --target 8k
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Image and Print Sizing Inspection
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
upscalex info input.png
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Hardware and Content-Aware Model Recommendation
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
upscalex recommend input.png
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
For complete options and arguments, see the [CLI Guide](docs/cli-guide.md).
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Model Context Protocol (MCP) Integration
|
|
182
|
+
|
|
183
|
+
UpscaleX runs as a native MCP server, enabling LLM agents to inspect image properties, evaluate print viability, and execute upscaling autonomously.
|
|
184
|
+
|
|
185
|
+
### Server Invocation
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
upscalex-mcp
|
|
189
|
+
# or
|
|
190
|
+
upscalex serve
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Client Configuration
|
|
194
|
+
|
|
195
|
+
Add this entry to your MCP client configuration file:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"mcpServers": {
|
|
200
|
+
"upscalex": {
|
|
201
|
+
"command": "uv",
|
|
202
|
+
"args": [
|
|
203
|
+
"run",
|
|
204
|
+
"--directory",
|
|
205
|
+
"/path/to/upscalex",
|
|
206
|
+
"upscalex-mcp"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Detailed configuration instructions for Claude Desktop, Antigravity, and Cursor are provided in the [MCP Guide](docs/mcp-guide.md).
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Model Matrix and Catalog
|
|
218
|
+
|
|
219
|
+
UpscaleX supports both pre-packaged core models and on-demand downloadable community models:
|
|
220
|
+
|
|
221
|
+
| Model ID | Scale | Target Media | VRAM Requirement | Status | Description |
|
|
222
|
+
| :--- | :--- | :--- | :--- | :--- | :--- |
|
|
223
|
+
| `realesrgan-x4plus` | 4x | Photos / Fine Art | Medium (4GB VRAM) | **Installed** | Flagship model for high-fidelity photography, art, and exhibition posters. |
|
|
224
|
+
| `realesrgan-x4plus-anime` | 4x | Anime / Illustration | Medium (4GB VRAM) | **Installed** | Preserves flat colors, sharp contours, and line definition in 2D illustrations. |
|
|
225
|
+
| `realesr-animevideov3-x4` | 4x | Video / Fast Previews | Low (1GB-2GB / CPU) | **Installed** | Lightweight 4x feed-forward model for fast turnaround and low-spec systems. |
|
|
226
|
+
| `realesr-animevideov3-x2` | 2x | Animation / Video | Low (1GB-2GB / CPU) | **Installed** | Fast 2x model for video frames, icons, and lightweight web assets. |
|
|
227
|
+
| `realesr-animevideov3-x3` | 3x | Animation / Video | Low (1GB-2GB / CPU) | **Installed** | Fast 3x model for intermediate scaling. |
|
|
228
|
+
| `realesr-general-x4v3` | 4x | General / Compact | Low (2GB VRAM) | **Installed** | Official compact general model with low memory consumption. |
|
|
229
|
+
| `4x-ultrasharp` | 4x | Portraits / Ultra-Detail | Medium-High (4GB-6GB) | Downloadable | Community champion for micro-textures, portraits, fabrics, and skin. |
|
|
230
|
+
| `4x-nmkd-superscale` | 4x | Clean Photorealistic | Medium-High (4GB-6GB) | Downloadable | Trained on clean photography; preserves hair, threads, and foliage. |
|
|
231
|
+
| `realesrgan-anime-6b` | 4x | Anime / Fast | Low (1GB-2GB / CPU) | Downloadable | 6-block lightweight anime model for rapid processing. |
|
|
232
|
+
|
|
233
|
+
### Download Additional Models
|
|
234
|
+
|
|
235
|
+
Download models through the CLI or via the `download_model` MCP tool:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Download 4x UltraSharp for portraits
|
|
239
|
+
upscalex download-model 4x-ultrasharp
|
|
240
|
+
|
|
241
|
+
# Download NMKD clean photo model
|
|
242
|
+
upscalex download-model 4x-nmkd-superscale
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Testing and Verification
|
|
248
|
+
|
|
249
|
+
Run the test suite to verify model resolution calculation, CLI exit codes, and live GPU inference:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
uv pip install -e ".[dev]"
|
|
253
|
+
uv run pytest -v
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
All tests must pass prior to submitting changes.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Contributing
|
|
261
|
+
|
|
262
|
+
Contributions to UpscaleX are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for coding standards, pull request processes, and development guidelines.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|