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