upres-cli 0.1.0 → 0.2.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/README.md +55 -28
- package/dist/cli.cjs +329 -233
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +331 -233
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +1 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -3
- package/dist/client.js.map +1 -1
- package/dist/mcp.cjs +314 -0
- package/dist/mcp.cjs.map +1 -0
- package/dist/mcp.d.cts +6 -0
- package/dist/mcp.d.ts +6 -0
- package/dist/mcp.js +287 -0
- package/dist/mcp.js.map +1 -0
- package/dist/models.cjs +38 -177
- package/dist/models.cjs.map +1 -1
- package/dist/models.d.cts +2 -2
- package/dist/models.d.ts +2 -2
- package/dist/models.js +38 -178
- package/dist/models.js.map +1 -1
- package/dist/types.cjs +0 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.js +0 -1
- package/package.json +12 -7
- package/scripts/check-mcp-registry.sh +51 -0
- package/scripts/ensure-dist.mjs +15 -0
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
"use strict";
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
@@ -7,6 +6,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esm = (fn, res) => function __init() {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
};
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
10
16
|
var __copyProps = (to, from, except, desc) => {
|
|
11
17
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
18
|
for (let key of __getOwnPropNames(from))
|
|
@@ -24,6 +30,307 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
30
|
mod
|
|
25
31
|
));
|
|
26
32
|
|
|
33
|
+
// src/models.ts
|
|
34
|
+
var MODELS, IMAGE_MODELS, VIDEO_MODELS, DEFAULT_IMAGE_MODEL, DEFAULT_VIDEO_MODEL;
|
|
35
|
+
var init_models = __esm({
|
|
36
|
+
"src/models.ts"() {
|
|
37
|
+
"use strict";
|
|
38
|
+
MODELS = [
|
|
39
|
+
{
|
|
40
|
+
id: "flare",
|
|
41
|
+
name: "Flare",
|
|
42
|
+
description: "Everyday photos, 2x-4x. Fastest and cheapest. Does not invent detail.",
|
|
43
|
+
category: "image-upscale",
|
|
44
|
+
price: "Included in plan quota",
|
|
45
|
+
inputTypes: ["image/*"],
|
|
46
|
+
params: [
|
|
47
|
+
{ name: "image", type: "string", required: true, description: "Image URL or file" },
|
|
48
|
+
{ name: "scale", type: "integer", required: false, default: 4, options: [2, 4], description: "Scale multiplier" }
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "prism",
|
|
53
|
+
name: "Prism",
|
|
54
|
+
description: "Text, logos, screenshots and product shots. Keeps edges true, does not invent detail.",
|
|
55
|
+
category: "image-upscale",
|
|
56
|
+
price: "Included in plan quota",
|
|
57
|
+
inputTypes: ["image/*"],
|
|
58
|
+
params: [
|
|
59
|
+
{ name: "image", type: "string", required: true, description: "Image URL or file" },
|
|
60
|
+
{ name: "scale", type: "integer", required: false, default: 4, options: [2, 4], description: "Scale multiplier" }
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "lumen",
|
|
65
|
+
name: "Lumen",
|
|
66
|
+
description: "Maximum detail recovery for print, up to 8x. Slower and dearer than Flare.",
|
|
67
|
+
category: "image-upscale",
|
|
68
|
+
price: "Included in plan quota",
|
|
69
|
+
inputTypes: ["image/*"],
|
|
70
|
+
params: [
|
|
71
|
+
{ name: "image", type: "string", required: true, description: "Image URL or file" },
|
|
72
|
+
{ name: "scale", type: "integer", required: false, default: 4, options: [2, 4, 8], description: "Scale multiplier" }
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "mirage",
|
|
77
|
+
name: "Mirage",
|
|
78
|
+
description: "Invents plausible new detail rather than recovering what was there. Most dramatic, least faithful. Good for art, wrong for documents.",
|
|
79
|
+
category: "image-enhance",
|
|
80
|
+
price: "Included in plan quota",
|
|
81
|
+
inputTypes: ["image/*"],
|
|
82
|
+
params: [
|
|
83
|
+
{ name: "image", type: "string", required: true, description: "Image URL or file" },
|
|
84
|
+
{ name: "scale", type: "integer", required: false, default: 4, options: [2, 4, 8], description: "Scale multiplier" }
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "motion",
|
|
89
|
+
name: "Motion",
|
|
90
|
+
description: "Fast 4K finish for AI-generated video (Sora, Kling, Runway). Frame-consistent, does not invent faces.",
|
|
91
|
+
category: "video-upscale",
|
|
92
|
+
price: "Counts against monthly video minutes",
|
|
93
|
+
inputTypes: ["video/*"],
|
|
94
|
+
params: [
|
|
95
|
+
{ name: "video", type: "string", required: true, description: "Video URL or file" },
|
|
96
|
+
{ name: "scale", type: "integer", required: false, default: 4, options: [2, 4], description: "Scale multiplier" }
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "motion-x",
|
|
101
|
+
name: "Motion X",
|
|
102
|
+
description: "Cinema-grade video upscale for film and commercials. Noticeably slower and dearer per second than Motion.",
|
|
103
|
+
category: "video-upscale",
|
|
104
|
+
price: "Counts against monthly video minutes",
|
|
105
|
+
inputTypes: ["video/*"],
|
|
106
|
+
params: [
|
|
107
|
+
{ name: "video", type: "string", required: true, description: "Video URL or file" },
|
|
108
|
+
{ name: "scale", type: "integer", required: false, default: 4, options: [2, 4], description: "Scale multiplier" }
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
IMAGE_MODELS = MODELS.filter((m) => m.category !== "video-upscale");
|
|
113
|
+
VIDEO_MODELS = MODELS.filter((m) => m.category === "video-upscale");
|
|
114
|
+
DEFAULT_IMAGE_MODEL = "flare";
|
|
115
|
+
DEFAULT_VIDEO_MODEL = "motion";
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// src/mcp.ts
|
|
120
|
+
var mcp_exports = {};
|
|
121
|
+
__export(mcp_exports, {
|
|
122
|
+
handleMessage: () => handleMessage,
|
|
123
|
+
startStdio: () => startStdio
|
|
124
|
+
});
|
|
125
|
+
function apiKey() {
|
|
126
|
+
return process.env.UPRES_API_KEY ?? "";
|
|
127
|
+
}
|
|
128
|
+
function baseUrl() {
|
|
129
|
+
return process.env.UPRES_BASE_URL ?? DEFAULT_BASE_URL2;
|
|
130
|
+
}
|
|
131
|
+
async function api(method, endpoint, body) {
|
|
132
|
+
const key = apiKey();
|
|
133
|
+
if (!key) {
|
|
134
|
+
throw new Error("UPRES_API_KEY is not set. Get a key at https://upres.ai/account/api-keys");
|
|
135
|
+
}
|
|
136
|
+
const res = await fetch(`${baseUrl()}${endpoint}`, {
|
|
137
|
+
method,
|
|
138
|
+
headers: {
|
|
139
|
+
Authorization: `Bearer ${key}`,
|
|
140
|
+
...body ? { "Content-Type": "application/json" } : {}
|
|
141
|
+
},
|
|
142
|
+
body: body ? JSON.stringify(body) : void 0
|
|
143
|
+
});
|
|
144
|
+
const data = await res.json().catch(() => ({}));
|
|
145
|
+
if (!res.ok) {
|
|
146
|
+
throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
147
|
+
}
|
|
148
|
+
return data;
|
|
149
|
+
}
|
|
150
|
+
function ok(id, result) {
|
|
151
|
+
return { jsonrpc: "2.0", id, result };
|
|
152
|
+
}
|
|
153
|
+
function fail(id, code, message) {
|
|
154
|
+
return { jsonrpc: "2.0", id, error: { code, message } };
|
|
155
|
+
}
|
|
156
|
+
function text(obj) {
|
|
157
|
+
return { content: [{ type: "text", text: JSON.stringify(obj, null, 2) }] };
|
|
158
|
+
}
|
|
159
|
+
async function callTool(name, args) {
|
|
160
|
+
switch (name) {
|
|
161
|
+
case "upres_list_models":
|
|
162
|
+
return text(
|
|
163
|
+
MODELS.map((m) => ({
|
|
164
|
+
id: m.id,
|
|
165
|
+
name: m.name,
|
|
166
|
+
category: m.category,
|
|
167
|
+
description: m.description
|
|
168
|
+
}))
|
|
169
|
+
);
|
|
170
|
+
case "upres_get_credits": {
|
|
171
|
+
const jobs = await api("GET", "/jobs?limit=100");
|
|
172
|
+
const data = jobs.data ?? [];
|
|
173
|
+
return text({
|
|
174
|
+
recent_jobs: data.length,
|
|
175
|
+
completed: data.filter((j) => j.status === "completed").length,
|
|
176
|
+
pricing: "https://upres.ai/pricing"
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
case "upres_upscale_image": {
|
|
180
|
+
const image_url = String(args.image_url ?? "");
|
|
181
|
+
if (!image_url) throw new Error("image_url is required");
|
|
182
|
+
const job = await api("POST", "/jobs", {
|
|
183
|
+
image_url,
|
|
184
|
+
model: args.model ?? "flare",
|
|
185
|
+
scale: args.scale ?? 4
|
|
186
|
+
});
|
|
187
|
+
return text(job);
|
|
188
|
+
}
|
|
189
|
+
case "upres_upscale_video": {
|
|
190
|
+
const video_url = String(args.video_url ?? "");
|
|
191
|
+
if (!video_url) throw new Error("video_url is required");
|
|
192
|
+
const job = await api("POST", "/jobs", {
|
|
193
|
+
image_url: video_url,
|
|
194
|
+
model: args.model ?? "motion",
|
|
195
|
+
scale: args.scale ?? 4
|
|
196
|
+
});
|
|
197
|
+
return text(job);
|
|
198
|
+
}
|
|
199
|
+
case "upres_get_job": {
|
|
200
|
+
const job_id = String(args.job_id ?? "");
|
|
201
|
+
if (!job_id) throw new Error("job_id is required");
|
|
202
|
+
const job = await api("GET", `/jobs/${job_id}`);
|
|
203
|
+
return text(job);
|
|
204
|
+
}
|
|
205
|
+
default:
|
|
206
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
async function handle(msg) {
|
|
210
|
+
const id = msg.id;
|
|
211
|
+
const method = String(msg.method ?? "");
|
|
212
|
+
if (msg.jsonrpc !== "2.0") return fail(id, -32600, "Invalid Request");
|
|
213
|
+
if (method === "initialize") {
|
|
214
|
+
return ok(id, {
|
|
215
|
+
protocolVersion: "2024-11-05",
|
|
216
|
+
capabilities: { tools: {} },
|
|
217
|
+
serverInfo: { name: "upres", version: VERSION }
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (method === "notifications/initialized" || method === "initialized") return null;
|
|
221
|
+
if (method === "ping") return ok(id, {});
|
|
222
|
+
if (method === "tools/list") return ok(id, { tools: TOOLS });
|
|
223
|
+
if (method === "tools/call") {
|
|
224
|
+
const params = msg.params ?? {};
|
|
225
|
+
const name = String(params.name ?? "");
|
|
226
|
+
const args = params.arguments ?? {};
|
|
227
|
+
try {
|
|
228
|
+
return ok(id, await callTool(name, args));
|
|
229
|
+
} catch (e) {
|
|
230
|
+
return ok(id, {
|
|
231
|
+
isError: true,
|
|
232
|
+
content: [{ type: "text", text: e.message }]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (id === void 0) return null;
|
|
237
|
+
return fail(id, -32601, `Method not found: ${method}`);
|
|
238
|
+
}
|
|
239
|
+
async function handleMessage(msg) {
|
|
240
|
+
return handle(msg);
|
|
241
|
+
}
|
|
242
|
+
function startStdio() {
|
|
243
|
+
let buf = "";
|
|
244
|
+
process.stdin.setEncoding("utf8");
|
|
245
|
+
process.stdin.on("data", async (chunk) => {
|
|
246
|
+
buf += chunk;
|
|
247
|
+
while (true) {
|
|
248
|
+
const nl = buf.indexOf("\n");
|
|
249
|
+
if (nl < 0) break;
|
|
250
|
+
const line = buf.slice(0, nl).trim();
|
|
251
|
+
buf = buf.slice(nl + 1);
|
|
252
|
+
if (!line) continue;
|
|
253
|
+
let msg;
|
|
254
|
+
try {
|
|
255
|
+
msg = JSON.parse(line);
|
|
256
|
+
} catch {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
const reply = await handle(msg);
|
|
260
|
+
if (reply) process.stdout.write(JSON.stringify(reply) + "\n");
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
var VERSION, DEFAULT_BASE_URL2, TOOLS;
|
|
265
|
+
var init_mcp = __esm({
|
|
266
|
+
"src/mcp.ts"() {
|
|
267
|
+
"use strict";
|
|
268
|
+
init_models();
|
|
269
|
+
VERSION = "0.2.0";
|
|
270
|
+
DEFAULT_BASE_URL2 = "https://api.upres.ai/v1";
|
|
271
|
+
TOOLS = [
|
|
272
|
+
{
|
|
273
|
+
name: "upres_list_models",
|
|
274
|
+
description: "List UpRes upscale models (flare, prism, lumen, mirage, motion, motion-x) with use cases.",
|
|
275
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "upres_get_credits",
|
|
279
|
+
description: "Show recent job count for the authenticated UpRes API key as a quota proxy.",
|
|
280
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: "upres_upscale_image",
|
|
284
|
+
description: "Submit an image upscale job from a public URL. Models: flare, prism, lumen, mirage.",
|
|
285
|
+
inputSchema: {
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
image_url: { type: "string", description: "Public HTTPS URL of the image" },
|
|
289
|
+
model: {
|
|
290
|
+
type: "string",
|
|
291
|
+
enum: ["flare", "prism", "lumen", "mirage"],
|
|
292
|
+
description: "Image model. Default flare."
|
|
293
|
+
},
|
|
294
|
+
scale: { type: "integer", enum: [2, 4, 8], description: "Scale multiplier. Default 4." }
|
|
295
|
+
},
|
|
296
|
+
required: ["image_url"],
|
|
297
|
+
additionalProperties: false
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "upres_upscale_video",
|
|
302
|
+
description: "Submit a video upscale job from a public URL. Models: motion, motion-x.",
|
|
303
|
+
inputSchema: {
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: {
|
|
306
|
+
video_url: { type: "string", description: "Public HTTPS URL of the video" },
|
|
307
|
+
model: {
|
|
308
|
+
type: "string",
|
|
309
|
+
enum: ["motion", "motion-x"],
|
|
310
|
+
description: "Video model. Default motion."
|
|
311
|
+
},
|
|
312
|
+
scale: { type: "integer", enum: [2, 4], description: "Scale multiplier. Default 4." }
|
|
313
|
+
},
|
|
314
|
+
required: ["video_url"],
|
|
315
|
+
additionalProperties: false
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: "upres_get_job",
|
|
320
|
+
description: "Get status and result_url of an UpRes job by id.",
|
|
321
|
+
inputSchema: {
|
|
322
|
+
type: "object",
|
|
323
|
+
properties: {
|
|
324
|
+
job_id: { type: "string", description: "Job UUID returned by an upscale tool" }
|
|
325
|
+
},
|
|
326
|
+
required: ["job_id"],
|
|
327
|
+
additionalProperties: false
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
27
334
|
// src/cli.ts
|
|
28
335
|
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
29
336
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
@@ -81,7 +388,7 @@ var UpresClient = class {
|
|
|
81
388
|
if (res.status === 402) {
|
|
82
389
|
console.error(
|
|
83
390
|
`Error: Monthly quota exceeded (used ${err.used ?? "?"}/${err.quota ?? "?"}).
|
|
84
|
-
Upgrade to
|
|
391
|
+
Upgrade to Studio at https://upres.ai/pricing`
|
|
85
392
|
);
|
|
86
393
|
process.exit(1);
|
|
87
394
|
}
|
|
@@ -188,226 +495,9 @@ var UpresClient = class {
|
|
|
188
495
|
}
|
|
189
496
|
};
|
|
190
497
|
|
|
191
|
-
// src/models.ts
|
|
192
|
-
var MODELS = [
|
|
193
|
-
{
|
|
194
|
-
id: "wavespeed-ai/real-esrgan",
|
|
195
|
-
name: "Real-ESRGAN",
|
|
196
|
-
description: "Fast image super-resolution with artifact removal. Best value.",
|
|
197
|
-
category: "image-upscale",
|
|
198
|
-
price: "$0.0024/image",
|
|
199
|
-
inputTypes: ["image/*"],
|
|
200
|
-
params: [
|
|
201
|
-
{ name: "image", type: "string", required: true, description: "Image URL" }
|
|
202
|
-
]
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
id: "wavespeed-ai/image-upscaler",
|
|
206
|
-
name: "Image Upscaler",
|
|
207
|
-
description: "AI upscaler to 2K/4K/8K with detail preservation.",
|
|
208
|
-
category: "image-upscale",
|
|
209
|
-
price: "$0.01/image",
|
|
210
|
-
inputTypes: ["image/*"],
|
|
211
|
-
params: [
|
|
212
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
213
|
-
{ name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
|
|
214
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
215
|
-
]
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
id: "wavespeed-ai/ultimate-image-upscaler",
|
|
219
|
-
name: "Ultimate Image Upscaler",
|
|
220
|
-
description: "Most advanced AI enhancer. Reimagines fine detail at 2K/4K/8K.",
|
|
221
|
-
category: "image-upscale",
|
|
222
|
-
price: "$0.01/image",
|
|
223
|
-
inputTypes: ["image/*"],
|
|
224
|
-
params: [
|
|
225
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
226
|
-
{ name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
|
|
227
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
id: "wavespeed-ai/seedvr2/image",
|
|
232
|
-
name: "SeedVR2 Image",
|
|
233
|
-
description: "ByteDance SeedVR2 architecture for sharp, detailed upscaling.",
|
|
234
|
-
category: "image-upscale",
|
|
235
|
-
price: "$0.01/image",
|
|
236
|
-
inputTypes: ["image/*"],
|
|
237
|
-
params: [
|
|
238
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
239
|
-
{ name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
|
|
240
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
241
|
-
]
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
id: "bria/increase-resolution",
|
|
245
|
-
name: "Bria Increase Resolution",
|
|
246
|
-
description: "Preservation-first 2x/4x upscale. No content drift.",
|
|
247
|
-
category: "image-upscale",
|
|
248
|
-
price: "$0.04/image",
|
|
249
|
-
inputTypes: ["image/*"],
|
|
250
|
-
params: [
|
|
251
|
-
{ name: "image", type: "string", required: true, description: "Image URL. Max output 8192x8192" },
|
|
252
|
-
{ name: "desired_increase", type: "integer", required: false, default: 2, options: [2, 4], description: "Resolution multiplier" }
|
|
253
|
-
]
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
id: "clarity-ai/crystal-upscaler",
|
|
257
|
-
name: "Crystal Upscaler",
|
|
258
|
-
description: "Upscale to target megapixels with creativity control.",
|
|
259
|
-
category: "image-upscale",
|
|
260
|
-
price: "Pay per use",
|
|
261
|
-
inputTypes: ["image/*"],
|
|
262
|
-
params: [
|
|
263
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
264
|
-
{ name: "target_megapixels", type: "number", required: false, default: 2, range: "1-200", description: "Target size in megapixels" },
|
|
265
|
-
{ name: "creativity", type: "number", required: false, default: 0, range: "0-10", description: "Quality improvement strength" }
|
|
266
|
-
]
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
id: "recraft-ai/recraft-crisp-upscale",
|
|
270
|
-
name: "Recraft Crisp Upscale",
|
|
271
|
-
description: "Enhances textures and facial features. Ideal for portraits.",
|
|
272
|
-
category: "image-enhance",
|
|
273
|
-
price: "Pay per use",
|
|
274
|
-
inputTypes: ["image/*"],
|
|
275
|
-
params: [
|
|
276
|
-
{ name: "image", type: "string", required: true, description: "Image URL or base64" }
|
|
277
|
-
]
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
id: "recraft-ai/recraft-creative-upscale",
|
|
281
|
-
name: "Recraft Creative Upscale",
|
|
282
|
-
description: "Generative enhancement adding depth and polish to complex elements.",
|
|
283
|
-
category: "image-enhance",
|
|
284
|
-
price: "$0.25/image",
|
|
285
|
-
inputTypes: ["image/*"],
|
|
286
|
-
params: [
|
|
287
|
-
{ name: "image", type: "string", required: true, description: "Image URL or base64" }
|
|
288
|
-
]
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
id: "wavespeed-ai/phota/enhance",
|
|
292
|
-
name: "Phota Enhance",
|
|
293
|
-
description: "Batch enhancement up to 4 images per run with optional 4K output.",
|
|
294
|
-
category: "image-enhance",
|
|
295
|
-
price: "$0.09/image",
|
|
296
|
-
inputTypes: ["image/*"],
|
|
297
|
-
params: [
|
|
298
|
-
{ name: "image", type: "string", required: true, description: "Image URL or base64 data URI" },
|
|
299
|
-
{ name: "num_images", type: "integer", required: false, default: 1, range: "1-4", description: "Enhanced variations to generate" },
|
|
300
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
id: "wavespeed-ai/z-image-turbo/image-to-image",
|
|
305
|
-
name: "Z-Image Turbo",
|
|
306
|
-
description: "Fast enhance with strength control. Low strength = subtle upscale.",
|
|
307
|
-
category: "image-enhance",
|
|
308
|
-
price: "$0.01/image",
|
|
309
|
-
inputTypes: ["image/*"],
|
|
310
|
-
params: [
|
|
311
|
-
{ name: "image", type: "string", required: true, description: "Reference image URL" },
|
|
312
|
-
{ name: "prompt", type: "string", required: true, description: "Enhancement prompt", default: "enhance image quality, sharp details" },
|
|
313
|
-
{ name: "strength", type: "number", required: false, default: 0.2, range: "0.00-1.00", description: "0-0.3 subtle enhance, 0.3-0.6 moderate, 0.6+ creative" },
|
|
314
|
-
{ name: "size", type: "string", required: false, default: "1024*1024", description: "Output size (width*height)" },
|
|
315
|
-
{ name: "seed", type: "integer", required: false, default: -1, range: "-1-2147483647", description: "Random seed. -1 = random" },
|
|
316
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
317
|
-
]
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
id: "wavespeed-ai/video-upscaler",
|
|
321
|
-
name: "Video Upscaler",
|
|
322
|
-
description: "Fast AI video upscaling to 720p-4K. Best value for video.",
|
|
323
|
-
category: "video-upscale",
|
|
324
|
-
price: "$0.005-0.02/sec",
|
|
325
|
-
inputTypes: ["video/*"],
|
|
326
|
-
params: [
|
|
327
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
328
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
329
|
-
]
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
id: "wavespeed-ai/video-upscaler-pro",
|
|
333
|
-
name: "Video Upscaler Pro",
|
|
334
|
-
description: "Motion-aware processing with artifact cleanup for pro results.",
|
|
335
|
-
category: "video-upscale",
|
|
336
|
-
price: "$0.03-0.05/sec",
|
|
337
|
-
inputTypes: ["video/*"],
|
|
338
|
-
params: [
|
|
339
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
340
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
341
|
-
]
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
id: "wavespeed-ai/ultimate-video-upscaler",
|
|
345
|
-
name: "Ultimate Video Upscaler",
|
|
346
|
-
description: "Deep learning detail reconstruction for highest quality 4K video.",
|
|
347
|
-
category: "video-upscale",
|
|
348
|
-
price: "$0.02-0.08/sec",
|
|
349
|
-
inputTypes: ["video/*"],
|
|
350
|
-
params: [
|
|
351
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
352
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
353
|
-
]
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
id: "wavespeed-ai/seedvr2/video",
|
|
357
|
-
name: "SeedVR2 Video",
|
|
358
|
-
description: "16B param ByteDance model. Highest fidelity with frame consistency.",
|
|
359
|
-
category: "video-upscale",
|
|
360
|
-
price: "$0.02-0.05/sec",
|
|
361
|
-
inputTypes: ["video/*"],
|
|
362
|
-
params: [
|
|
363
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
364
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
365
|
-
]
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
id: "bytedance/video-upscaler",
|
|
369
|
-
name: "ByteDance Video Upscaler",
|
|
370
|
-
description: "ByteDance super-resolution recovering fine detail to 4K.",
|
|
371
|
-
category: "video-upscale",
|
|
372
|
-
price: "$0.007-0.029/sec",
|
|
373
|
-
inputTypes: ["video/*"],
|
|
374
|
-
params: [
|
|
375
|
-
{ name: "video", type: "string", required: true, description: "Video URL" },
|
|
376
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["1080p", "2k", "4k"], description: "Target resolution" }
|
|
377
|
-
]
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
id: "bria/fibo/video-upscaler",
|
|
381
|
-
name: "Bria Video Upscaler",
|
|
382
|
-
description: "Temporal consistency with multiple output codec options.",
|
|
383
|
-
category: "video-upscale",
|
|
384
|
-
price: "$0.14/sec",
|
|
385
|
-
inputTypes: ["video/*"],
|
|
386
|
-
params: [
|
|
387
|
-
{ name: "video", type: "string", required: true, description: "Video URL" },
|
|
388
|
-
{ name: "target_resolution", type: "string", required: false, default: "2k", options: ["2k", "4k"], description: "Target resolution" },
|
|
389
|
-
{ name: "output_container_and_codec", type: "string", required: false, default: "mp4_h264", options: ["webm_vp9", "mp4_h264", "mp4_h265", "mov_h265", "mov_prores4s", "mkv_h264", "mkv_h265", "mkv_vp9", "gif"], description: "Output container and codec" }
|
|
390
|
-
]
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
id: "runwayml/upscale-v1",
|
|
394
|
-
name: "RunwayML Upscale",
|
|
395
|
-
description: "Simple one-click video upscale to 4K by RunwayML.",
|
|
396
|
-
category: "video-upscale",
|
|
397
|
-
price: "$0.02/sec",
|
|
398
|
-
inputTypes: ["video/*"],
|
|
399
|
-
params: [
|
|
400
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" }
|
|
401
|
-
]
|
|
402
|
-
}
|
|
403
|
-
];
|
|
404
|
-
var IMAGE_MODELS = MODELS.filter((m) => m.category !== "video-upscale");
|
|
405
|
-
var VIDEO_MODELS = MODELS.filter((m) => m.category === "video-upscale");
|
|
406
|
-
var DEFAULT_IMAGE_MODEL = "wavespeed-ai/image-upscaler";
|
|
407
|
-
var DEFAULT_VIDEO_MODEL = "wavespeed-ai/video-upscaler";
|
|
408
|
-
|
|
409
498
|
// src/cli.ts
|
|
410
|
-
|
|
499
|
+
init_models();
|
|
500
|
+
var VERSION2 = "0.2.0";
|
|
411
501
|
function parseArgs(argv) {
|
|
412
502
|
const args = [];
|
|
413
503
|
const flags = {};
|
|
@@ -433,7 +523,7 @@ function parseArgs(argv) {
|
|
|
433
523
|
}
|
|
434
524
|
function printHelp() {
|
|
435
525
|
console.log(`
|
|
436
|
-
upres-cli v${
|
|
526
|
+
upres-cli v${VERSION2} \u2014 AI image & video upscaling
|
|
437
527
|
|
|
438
528
|
USAGE
|
|
439
529
|
upres <command> [options]
|
|
@@ -444,12 +534,12 @@ COMMANDS
|
|
|
444
534
|
models List available models
|
|
445
535
|
jobs List recent jobs
|
|
446
536
|
account Show quota and plan info
|
|
537
|
+
mcp Speak MCP over stdin/stdout for Claude, Cursor, Hermes
|
|
447
538
|
version Print version
|
|
448
539
|
|
|
449
540
|
OPTIONS
|
|
450
|
-
--model <id> Model ID (default:
|
|
451
|
-
--scale <n> Scale factor 2-8 (
|
|
452
|
-
--resolution <res> Target resolution: 2k, 4k, 8k, 720p, 1080p (default: 4k)
|
|
541
|
+
--model <id> Model ID (default: flare for images, motion for video)
|
|
542
|
+
--scale <n> Scale factor 2-8 (default: 4)
|
|
453
543
|
--output <path> Output file or directory
|
|
454
544
|
--api-key <key> API key (or set UPRES_API_KEY env var)
|
|
455
545
|
--wait Wait for job to complete (default: true)
|
|
@@ -460,22 +550,23 @@ OPTIONS
|
|
|
460
550
|
--help Show help
|
|
461
551
|
|
|
462
552
|
EXAMPLES
|
|
463
|
-
upres upscale photo.jpg --model
|
|
464
|
-
upres upscale photo.jpg --model
|
|
465
|
-
upres
|
|
553
|
+
upres upscale photo.jpg --model flare --scale 4
|
|
554
|
+
upres upscale photo.jpg --model lumen --scale 8 --output out.jpg
|
|
555
|
+
upres upscale clip.mp4 --model motion
|
|
556
|
+
upres batch ./photos/ --model flare --output ./upscaled/
|
|
466
557
|
upres models
|
|
467
558
|
upres jobs --limit 10 --status completed
|
|
468
559
|
upres account
|
|
469
560
|
|
|
470
561
|
API KEY
|
|
471
|
-
1. Get a
|
|
562
|
+
1. Get a Studio key at https://upres.ai/account/api-keys
|
|
472
563
|
2. Export: UPRES_API_KEY=upres_yourkey
|
|
473
564
|
3. Or save: echo '{"apiKey":"upres_yourkey"}' > ~/.config/upres/config.json
|
|
474
565
|
|
|
475
566
|
PRICING
|
|
476
|
-
Free:
|
|
477
|
-
|
|
478
|
-
|
|
567
|
+
Free: 3 upscales/month
|
|
568
|
+
Creator: $9/month \u2014 50 stills + 20 min 4K video
|
|
569
|
+
Studio: $39/month \u2014 250 stills + 90 min 4K video + API
|
|
479
570
|
|
|
480
571
|
https://upres.ai/pricing
|
|
481
572
|
`);
|
|
@@ -656,7 +747,7 @@ async function main() {
|
|
|
656
747
|
process.exit(0);
|
|
657
748
|
}
|
|
658
749
|
if (command === "version" || command === "--version" || command === "-v") {
|
|
659
|
-
console.log(`upres-cli v${
|
|
750
|
+
console.log(`upres-cli v${VERSION2}`);
|
|
660
751
|
process.exit(0);
|
|
661
752
|
}
|
|
662
753
|
switch (command) {
|
|
@@ -675,6 +766,11 @@ async function main() {
|
|
|
675
766
|
case "account":
|
|
676
767
|
await cmdAccount(flags);
|
|
677
768
|
break;
|
|
769
|
+
case "mcp": {
|
|
770
|
+
const { startStdio: startStdio2 } = await Promise.resolve().then(() => (init_mcp(), mcp_exports));
|
|
771
|
+
startStdio2();
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
678
774
|
default:
|
|
679
775
|
console.error(`Unknown command: ${command}
|
|
680
776
|
Run "upres --help" for usage.`);
|