upres-cli 0.1.1 → 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/dist/cli.cjs CHANGED
@@ -6,6 +6,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
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
+ };
9
16
  var __copyProps = (to, from, except, desc) => {
10
17
  if (from && typeof from === "object" || typeof from === "function") {
11
18
  for (let key of __getOwnPropNames(from))
@@ -23,6 +30,307 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
30
  mod
24
31
  ));
25
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
+
26
334
  // src/cli.ts
27
335
  var import_node_fs2 = __toESM(require("fs"), 1);
28
336
  var import_node_path2 = __toESM(require("path"), 1);
@@ -80,7 +388,7 @@ var UpresClient = class {
80
388
  if (res.status === 402) {
81
389
  console.error(
82
390
  `Error: Monthly quota exceeded (used ${err.used ?? "?"}/${err.quota ?? "?"}).
83
- Upgrade to Business tier at https://upres.ai/pricing`
391
+ Upgrade to Studio at https://upres.ai/pricing`
84
392
  );
85
393
  process.exit(1);
86
394
  }
@@ -187,226 +495,9 @@ var UpresClient = class {
187
495
  }
188
496
  };
189
497
 
190
- // src/models.ts
191
- var MODELS = [
192
- {
193
- id: "wavespeed-ai/real-esrgan",
194
- name: "Real-ESRGAN",
195
- description: "Fast image super-resolution with artifact removal. Best value.",
196
- category: "image-upscale",
197
- price: "$0.0024/image",
198
- inputTypes: ["image/*"],
199
- params: [
200
- { name: "image", type: "string", required: true, description: "Image URL" }
201
- ]
202
- },
203
- {
204
- id: "wavespeed-ai/image-upscaler",
205
- name: "Image Upscaler",
206
- description: "AI upscaler to 2K/4K/8K with detail preservation.",
207
- category: "image-upscale",
208
- price: "$0.01/image",
209
- inputTypes: ["image/*"],
210
- params: [
211
- { name: "image", type: "string", required: true, description: "Image URL" },
212
- { name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
213
- { name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
214
- ]
215
- },
216
- {
217
- id: "wavespeed-ai/ultimate-image-upscaler",
218
- name: "Ultimate Image Upscaler",
219
- description: "Most advanced AI enhancer. Reimagines fine detail at 2K/4K/8K.",
220
- category: "image-upscale",
221
- price: "$0.01/image",
222
- inputTypes: ["image/*"],
223
- params: [
224
- { name: "image", type: "string", required: true, description: "Image URL" },
225
- { name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
226
- { name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
227
- ]
228
- },
229
- {
230
- id: "wavespeed-ai/seedvr2/image",
231
- name: "SeedVR2 Image",
232
- description: "ByteDance SeedVR2 architecture for sharp, detailed upscaling.",
233
- category: "image-upscale",
234
- price: "$0.01/image",
235
- inputTypes: ["image/*"],
236
- params: [
237
- { name: "image", type: "string", required: true, description: "Image URL" },
238
- { name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
239
- { name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
240
- ]
241
- },
242
- {
243
- id: "bria/increase-resolution",
244
- name: "Bria Increase Resolution",
245
- description: "Preservation-first 2x/4x upscale. No content drift.",
246
- category: "image-upscale",
247
- price: "$0.04/image",
248
- inputTypes: ["image/*"],
249
- params: [
250
- { name: "image", type: "string", required: true, description: "Image URL. Max output 8192x8192" },
251
- { name: "desired_increase", type: "integer", required: false, default: 2, options: [2, 4], description: "Resolution multiplier" }
252
- ]
253
- },
254
- {
255
- id: "clarity-ai/crystal-upscaler",
256
- name: "Crystal Upscaler",
257
- description: "Upscale to target megapixels with creativity control.",
258
- category: "image-upscale",
259
- price: "Pay per use",
260
- inputTypes: ["image/*"],
261
- params: [
262
- { name: "image", type: "string", required: true, description: "Image URL" },
263
- { name: "target_megapixels", type: "number", required: false, default: 2, range: "1-200", description: "Target size in megapixels" },
264
- { name: "creativity", type: "number", required: false, default: 0, range: "0-10", description: "Quality improvement strength" }
265
- ]
266
- },
267
- {
268
- id: "recraft-ai/recraft-crisp-upscale",
269
- name: "Recraft Crisp Upscale",
270
- description: "Enhances textures and facial features. Ideal for portraits.",
271
- category: "image-enhance",
272
- price: "Pay per use",
273
- inputTypes: ["image/*"],
274
- params: [
275
- { name: "image", type: "string", required: true, description: "Image URL or base64" }
276
- ]
277
- },
278
- {
279
- id: "recraft-ai/recraft-creative-upscale",
280
- name: "Recraft Creative Upscale",
281
- description: "Generative enhancement adding depth and polish to complex elements.",
282
- category: "image-enhance",
283
- price: "$0.25/image",
284
- inputTypes: ["image/*"],
285
- params: [
286
- { name: "image", type: "string", required: true, description: "Image URL or base64" }
287
- ]
288
- },
289
- {
290
- id: "wavespeed-ai/phota/enhance",
291
- name: "Phota Enhance",
292
- description: "Batch enhancement up to 4 images per run with optional 4K output.",
293
- category: "image-enhance",
294
- price: "$0.09/image",
295
- inputTypes: ["image/*"],
296
- params: [
297
- { name: "image", type: "string", required: true, description: "Image URL or base64 data URI" },
298
- { name: "num_images", type: "integer", required: false, default: 1, range: "1-4", description: "Enhanced variations to generate" },
299
- { name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
300
- ]
301
- },
302
- {
303
- id: "wavespeed-ai/z-image-turbo/image-to-image",
304
- name: "Z-Image Turbo",
305
- description: "Fast enhance with strength control. Low strength = subtle upscale.",
306
- category: "image-enhance",
307
- price: "$0.01/image",
308
- inputTypes: ["image/*"],
309
- params: [
310
- { name: "image", type: "string", required: true, description: "Reference image URL" },
311
- { name: "prompt", type: "string", required: true, description: "Enhancement prompt", default: "enhance image quality, sharp details" },
312
- { 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" },
313
- { name: "size", type: "string", required: false, default: "1024*1024", description: "Output size (width*height)" },
314
- { name: "seed", type: "integer", required: false, default: -1, range: "-1-2147483647", description: "Random seed. -1 = random" },
315
- { name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
316
- ]
317
- },
318
- {
319
- id: "wavespeed-ai/video-upscaler",
320
- name: "Video Upscaler",
321
- description: "Fast AI video upscaling to 720p-4K. Best value for video.",
322
- category: "video-upscale",
323
- price: "$0.005-0.02/sec",
324
- inputTypes: ["video/*"],
325
- params: [
326
- { name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
327
- { name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
328
- ]
329
- },
330
- {
331
- id: "wavespeed-ai/video-upscaler-pro",
332
- name: "Video Upscaler Pro",
333
- description: "Motion-aware processing with artifact cleanup for pro results.",
334
- category: "video-upscale",
335
- price: "$0.03-0.05/sec",
336
- inputTypes: ["video/*"],
337
- params: [
338
- { name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
339
- { name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
340
- ]
341
- },
342
- {
343
- id: "wavespeed-ai/ultimate-video-upscaler",
344
- name: "Ultimate Video Upscaler",
345
- description: "Deep learning detail reconstruction for highest quality 4K video.",
346
- category: "video-upscale",
347
- price: "$0.02-0.08/sec",
348
- inputTypes: ["video/*"],
349
- params: [
350
- { name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
351
- { name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
352
- ]
353
- },
354
- {
355
- id: "wavespeed-ai/seedvr2/video",
356
- name: "SeedVR2 Video",
357
- description: "16B param ByteDance model. Highest fidelity with frame consistency.",
358
- category: "video-upscale",
359
- price: "$0.02-0.05/sec",
360
- inputTypes: ["video/*"],
361
- params: [
362
- { name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
363
- { name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
364
- ]
365
- },
366
- {
367
- id: "bytedance/video-upscaler",
368
- name: "ByteDance Video Upscaler",
369
- description: "ByteDance super-resolution recovering fine detail to 4K.",
370
- category: "video-upscale",
371
- price: "$0.007-0.029/sec",
372
- inputTypes: ["video/*"],
373
- params: [
374
- { name: "video", type: "string", required: true, description: "Video URL" },
375
- { name: "target_resolution", type: "string", required: false, default: "1080p", options: ["1080p", "2k", "4k"], description: "Target resolution" }
376
- ]
377
- },
378
- {
379
- id: "bria/fibo/video-upscaler",
380
- name: "Bria Video Upscaler",
381
- description: "Temporal consistency with multiple output codec options.",
382
- category: "video-upscale",
383
- price: "$0.14/sec",
384
- inputTypes: ["video/*"],
385
- params: [
386
- { name: "video", type: "string", required: true, description: "Video URL" },
387
- { name: "target_resolution", type: "string", required: false, default: "2k", options: ["2k", "4k"], description: "Target resolution" },
388
- { 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" }
389
- ]
390
- },
391
- {
392
- id: "runwayml/upscale-v1",
393
- name: "RunwayML Upscale",
394
- description: "Simple one-click video upscale to 4K by RunwayML.",
395
- category: "video-upscale",
396
- price: "$0.02/sec",
397
- inputTypes: ["video/*"],
398
- params: [
399
- { name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" }
400
- ]
401
- }
402
- ];
403
- var IMAGE_MODELS = MODELS.filter((m) => m.category !== "video-upscale");
404
- var VIDEO_MODELS = MODELS.filter((m) => m.category === "video-upscale");
405
- var DEFAULT_IMAGE_MODEL = "wavespeed-ai/image-upscaler";
406
- var DEFAULT_VIDEO_MODEL = "wavespeed-ai/video-upscaler";
407
-
408
498
  // src/cli.ts
409
- var VERSION = "0.1.0";
499
+ init_models();
500
+ var VERSION2 = "0.2.0";
410
501
  function parseArgs(argv) {
411
502
  const args = [];
412
503
  const flags = {};
@@ -432,7 +523,7 @@ function parseArgs(argv) {
432
523
  }
433
524
  function printHelp() {
434
525
  console.log(`
435
- upres-cli v${VERSION} \u2014 AI image & video upscaling
526
+ upres-cli v${VERSION2} \u2014 AI image & video upscaling
436
527
 
437
528
  USAGE
438
529
  upres <command> [options]
@@ -443,12 +534,12 @@ COMMANDS
443
534
  models List available models
444
535
  jobs List recent jobs
445
536
  account Show quota and plan info
537
+ mcp Speak MCP over stdin/stdout for Claude, Cursor, Hermes
446
538
  version Print version
447
539
 
448
540
  OPTIONS
449
- --model <id> Model ID (default: wavespeed-ai/image-upscaler)
450
- --scale <n> Scale factor 2-8 (image only, default: 4)
451
- --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)
452
543
  --output <path> Output file or directory
453
544
  --api-key <key> API key (or set UPRES_API_KEY env var)
454
545
  --wait Wait for job to complete (default: true)
@@ -459,22 +550,23 @@ OPTIONS
459
550
  --help Show help
460
551
 
461
552
  EXAMPLES
462
- upres upscale photo.jpg --model real-esrgan --scale 4
463
- upres upscale photo.jpg --model wavespeed-ai/image-upscaler --resolution 8k --output out.jpg
464
- upres batch ./photos/ --model wavespeed-ai/real-esrgan --output ./upscaled/
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/
465
557
  upres models
466
558
  upres jobs --limit 10 --status completed
467
559
  upres account
468
560
 
469
561
  API KEY
470
- 1. Get a free key at https://upres.ai/account/api-keys
562
+ 1. Get a Studio key at https://upres.ai/account/api-keys
471
563
  2. Export: UPRES_API_KEY=upres_yourkey
472
564
  3. Or save: echo '{"apiKey":"upres_yourkey"}' > ~/.config/upres/config.json
473
565
 
474
566
  PRICING
475
- Free: 5 ops/month
476
- Pro: $19/month \u2014 100 ops, HD output, no watermark
477
- Biz: $49/month \u2014 unlimited + batch API + all models
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
478
570
 
479
571
  https://upres.ai/pricing
480
572
  `);
@@ -655,7 +747,7 @@ async function main() {
655
747
  process.exit(0);
656
748
  }
657
749
  if (command === "version" || command === "--version" || command === "-v") {
658
- console.log(`upres-cli v${VERSION}`);
750
+ console.log(`upres-cli v${VERSION2}`);
659
751
  process.exit(0);
660
752
  }
661
753
  switch (command) {
@@ -674,6 +766,11 @@ async function main() {
674
766
  case "account":
675
767
  await cmdAccount(flags);
676
768
  break;
769
+ case "mcp": {
770
+ const { startStdio: startStdio2 } = await Promise.resolve().then(() => (init_mcp(), mcp_exports));
771
+ startStdio2();
772
+ return;
773
+ }
677
774
  default:
678
775
  console.error(`Unknown command: ${command}
679
776
  Run "upres --help" for usage.`);