upres-cli 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 upres.ai
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.
package/README.md ADDED
@@ -0,0 +1,226 @@
1
+ # upres-cli
2
+
3
+ [![npm version](https://img.shields.io/npm/v/upres-cli?style=flat-square)](https://www.npmjs.com/package/upres-cli)
4
+ [![PyPI version](https://img.shields.io/pypi/v/upres-ai?style=flat-square)](https://pypi.org/project/upres-ai/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
6
+ [![GitHub stars](https://img.shields.io/github/stars/auroracapital/upres-cli?style=flat-square)](https://github.com/auroracapital/upres-cli/stargazers)
7
+
8
+ Official CLI + SDK for **[upres.ai](https://upres.ai)** — AI image and video upscaling powered by Real-ESRGAN, SeedVR2, RunwayML, Bria, and more. One API, 17 state-of-the-art models, up to 8K output.
9
+
10
+ ```
11
+ $ upres upscale photo.jpg --model wavespeed-ai/image-upscaler --resolution 4k
12
+ Submitting job... model=wavespeed-ai/image-upscaler
13
+ Job created: 550e8400-e29b-41d4-a716-446655440000 (status: pending)
14
+ Waiting for result.......
15
+ Downloading to photo_upscaled.jpg... done.
16
+
17
+ Result: photo_upscaled.jpg
18
+ ```
19
+
20
+ ---
21
+
22
+ ## Why we built this
23
+
24
+ - **Topaz** is $200/yr, desktop-only, no API, no automation
25
+ - **Upscayl** is great for one-offs but can't handle bulk exports or CI pipelines
26
+ - **Every other SaaS upscaler** either watermarks your output, caps resolution at 2K, or charges per image with no monthly plan
27
+
28
+ upres.ai gives you a clean REST API, 17 models including the latest SeedVR2 and RunwayML, batch processing, and predictable pricing starting at $49/mo.
29
+
30
+ ---
31
+
32
+ ## Quickstart
33
+
34
+ ### Node.js
35
+
36
+ ```bash
37
+ npx upres-cli upscale photo.jpg
38
+ ```
39
+
40
+ Or install globally:
41
+
42
+ ```bash
43
+ npm install -g upres-cli
44
+ upres upscale photo.jpg --model wavespeed-ai/image-upscaler --resolution 8k --output photo_8k.jpg
45
+ ```
46
+
47
+ ### Python
48
+
49
+ ```bash
50
+ pip install upres-ai
51
+ upres upscale photo.jpg --model wavespeed-ai/image-upscaler --resolution 4k
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Authentication
57
+
58
+ 1. Sign up at [upres.ai](https://upres.ai) (free — 5 ops/month)
59
+ 2. Go to [upres.ai/account/api-keys](https://upres.ai/account/api-keys)
60
+ 3. Generate a key — it's shown once
61
+
62
+ ```bash
63
+ export UPRES_API_KEY=upres_yourkey
64
+ ```
65
+
66
+ Or save permanently:
67
+
68
+ ```bash
69
+ mkdir -p ~/.config/upres
70
+ echo '{"apiKey":"upres_yourkey"}' > ~/.config/upres/config.json
71
+ ```
72
+
73
+ Key resolution order: `--api-key` flag → `UPRES_API_KEY` env var → `~/.config/upres/config.json`
74
+
75
+ ---
76
+
77
+ ## Commands
78
+
79
+ ```bash
80
+ # Upscale a single image (local file or URL)
81
+ upres upscale photo.jpg --model wavespeed-ai/image-upscaler --resolution 4k
82
+ upres upscale photo.jpg --model wavespeed-ai/real-esrgan --scale 4 --output out.jpg
83
+ upres upscale https://example.com/photo.jpg --resolution 8k
84
+
85
+ # Upscale video
86
+ upres upscale clip.mp4 --model wavespeed-ai/video-upscaler --resolution 4k
87
+
88
+ # Batch upscale a folder
89
+ upres batch ./photos/ --model wavespeed-ai/real-esrgan --output ./upscaled/ --concurrency 5
90
+
91
+ # List available models
92
+ upres models
93
+
94
+ # List recent jobs
95
+ upres jobs --limit 20 --status completed
96
+
97
+ # Account / quota info
98
+ upres account
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Node.js SDK
104
+
105
+ ```typescript
106
+ import { UpresClient } from "upres-cli";
107
+
108
+ const client = new UpresClient(); // reads UPRES_API_KEY from env
109
+
110
+ // Upscale a local file
111
+ const job = await client.createJobFromFile("photo.jpg", {
112
+ model: "wavespeed-ai/image-upscaler",
113
+ scale: 4,
114
+ });
115
+
116
+ // Wait for completion
117
+ const completed = await client.waitForJob(job.id);
118
+
119
+ // Download result
120
+ await client.downloadResult(completed, "photo_4k.jpg");
121
+ console.log("Done:", completed.result_url);
122
+ ```
123
+
124
+ Files over 50 MB are automatically uploaded via [TUS resumable protocol](https://tus.io/).
125
+
126
+ ---
127
+
128
+ ## Python SDK
129
+
130
+ ```python
131
+ from upres import UpresClient
132
+
133
+ with UpresClient() as client: # reads UPRES_API_KEY from env
134
+ job = client.create_job_from_file(
135
+ "photo.jpg",
136
+ model="wavespeed-ai/image-upscaler",
137
+ scale=4,
138
+ )
139
+ completed = client.wait_for_job(job["id"])
140
+ client.download_result(completed, "photo_4k.jpg")
141
+ print("Done:", completed["result_url"])
142
+ ```
143
+
144
+ The Python SDK uses `httpx` — async-ready, no heavy dependencies.
145
+
146
+ ---
147
+
148
+ ## Examples
149
+
150
+ | Example | What it does |
151
+ |---|---|
152
+ | [batch-upscale-folder.js](examples/batch-upscale-folder.js) | Upscale all images in a folder with configurable concurrency |
153
+ | [restore-photo-folder.py](examples/restore-photo-folder.py) | Restore old/scanned photos using Recraft Crisp Upscale |
154
+ | [ecommerce-pipeline.js](examples/ecommerce-pipeline.js) | Product image pipeline: raw shots → 4K → publish-ready |
155
+ | [lightroom-export-hook.md](examples/lightroom-export-hook.md) | Auto-upscale Lightroom exports via post-processing hook |
156
+ | [figma-plugin-stub.md](examples/figma-plugin-stub.md) | Figma plugin integration guide |
157
+
158
+ ---
159
+
160
+ ## Models
161
+
162
+ 17 models across image upscale, image enhance, and video upscale.
163
+
164
+ | Category | Highlight |
165
+ |---|---|
166
+ | Image Upscale | Real-ESRGAN · SeedVR2 · Bria · Crystal · Ultimate |
167
+ | Image Enhance | Recraft Crisp/Creative · Phota · Z-Image Turbo |
168
+ | Video Upscale | SeedVR2 Video · RunwayML · ByteDance · Bria FiBO |
169
+
170
+ Full model list with params and pricing: [docs/models.md](docs/models.md) · [upres.ai/models](https://upres.ai/models)
171
+
172
+ ---
173
+
174
+ ## Pricing
175
+
176
+ | Plan | Price | Ops/mo | API | Watermark |
177
+ |---|---|---|---|---|
178
+ | **Free** | $0 | 5 | — | Yes |
179
+ | **Pro** | $19/mo | 100 | — | No |
180
+ | **Business** | $49/mo | Unlimited | **Yes** | No |
181
+
182
+ **Business tier unlocks the full API, batch processing, all 17 models, and no output watermark.**
183
+
184
+ [Compare plans →](https://upres.ai/pricing) · [vs. Topaz →](https://upres.ai/compare/topaz) · [vs. Upscayl →](https://upres.ai/compare/upscayl)
185
+
186
+ ---
187
+
188
+ ## Free tier for open-source projects
189
+
190
+ If you're building something open-source on top of the API, email [support@upres.ai](mailto:support@upres.ai) with your repo link. We offer 500 ops/month for qualifying OSS projects.
191
+
192
+ ---
193
+
194
+ ## Error handling
195
+
196
+ The SDK handles these errors automatically:
197
+
198
+ | Status | Behavior |
199
+ |---|---|
200
+ | `401` | Prints API key error + link to key management, exits |
201
+ | `402` | Prints quota exceeded + link to pricing, exits |
202
+ | `429` | Prints rate limit message (60 req/min), exits |
203
+ | `5xx` | Throws `UpresError` with message |
204
+
205
+ In Python: raises `AuthError`, `QuotaExceededError`, or `UpresError`.
206
+
207
+ ---
208
+
209
+ ## Contributing
210
+
211
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Tests run with:
212
+
213
+ ```bash
214
+ # Node
215
+ npm test
216
+
217
+ # Python
218
+ pip install -e ".[dev]"
219
+ pytest tests/test_client.py -v
220
+ ```
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ MIT — see [LICENSE](LICENSE)