upres-cli 0.1.1 → 0.3.1
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 +79 -37
- package/dist/cli.cjs +381 -251
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +383 -251
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +27 -13
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +5 -1
- package/dist/client.d.ts +5 -1
- package/dist/client.js +25 -12
- package/dist/client.js.map +1 -1
- package/dist/mcp.cjs +310 -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 +283 -0
- package/dist/mcp.js.map +1 -0
- package/dist/models.cjs +51 -214
- package/dist/models.cjs.map +1 -1
- package/dist/models.d.cts +5 -3
- package/dist/models.d.ts +5 -3
- package/dist/models.js +49 -214
- package/dist/models.js.map +1 -1
- package/dist/types.cjs +0 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -0
- package/package.json +54 -12
- package/scripts/check-mcp-registry.sh +51 -0
- package/scripts/ensure-dist.mjs +15 -0
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models.ts","../src/mcp.ts"],"sourcesContent":["import type { ModelDefinition } from \"./types.js\";\n\n// Synced with the public aliases in upres.ai server/contract/models.ts.\n// A job names one alias. Which backend serves it is ours to choose and can\n// change without notice — that is how a failing vendor stops being your outage.\n// Aliases with max scale 1 do not enlarge; the API stores scale 1 for them.\n\nfunction scaleParam(maxScale: number): ModelDefinition[\"params\"] {\n if (maxScale <= 1) return [];\n const options: number[] = [];\n for (let step = 2; step <= maxScale; step *= 2) options.push(step);\n return [\n {\n name: \"scale\",\n type: \"integer\",\n required: false,\n default: 4,\n options,\n description: \"Scale multiplier. Ignored when the alias does not enlarge.\",\n },\n ];\n}\n\nfunction model(\n id: string,\n name: string,\n description: string,\n category: ModelDefinition[\"category\"],\n inputTypes: string[],\n maxScale: number,\n): ModelDefinition {\n const fileParam =\n category.startsWith(\"video\")\n ? { name: \"video\", type: \"string\" as const, required: true, description: \"Video URL or file\" }\n : category.startsWith(\"audio\")\n ? { name: \"audio\", type: \"string\" as const, required: true, description: \"Audio URL or file\" }\n : { name: \"image\", type: \"string\" as const, required: true, description: \"Image URL or file\" };\n return {\n id,\n name,\n description,\n category,\n price: \"One credit per stage that runs\",\n inputTypes,\n params: [fileParam, ...scaleParam(maxScale)],\n };\n}\n\nexport const MODELS: ModelDefinition[] = [\n model(\"flare\", \"Flare\", \"Everyday photos, 2x-4x. Fastest and cheapest. Does not invent detail.\", \"image-upscale\", [\"image/*\"], 4),\n model(\"prism\", \"Prism\", \"Text, logos, screenshots and product shots. Keeps edges true, does not invent detail.\", \"image-upscale\", [\"image/*\"], 4),\n model(\"lumen\", \"Lumen\", \"Maximum detail recovery for print, up to 8x. Slower and dearer than Flare.\", \"image-upscale\", [\"image/*\"], 8),\n model(\"mirage\", \"Mirage\", \"Invents plausible new detail rather than recovering what was there. Good for art, wrong for documents.\", \"image-upscale\", [\"image/*\"], 8),\n model(\"hush\", \"Hush\", \"Faithful denoise. Same size as the source, nothing invented.\", \"image-clean\", [\"image/*\"], 1),\n model(\"keen\", \"Keen\", \"Deblur and sharpen. Same size as the source, does not invent texture.\", \"image-restore\", [\"image/*\"], 1),\n model(\"visage\", \"Visage\", \"Restores faces and leaves the rest of the frame alone. Does not enlarge.\", \"image-restore\", [\"image/*\"], 1),\n model(\"atelier\", \"Atelier\", \"Hush, then Visage if the photo looks like a portrait, then Lumen. A skipped face stage is free.\", \"image-studio\", [\"image/*\"], 8),\n model(\"motion\", \"Motion\", \"Fast 4K finish for AI-generated video. Frame-consistent, does not invent faces.\", \"video-upscale\", [\"video/*\"], 4),\n model(\"motion-x\", \"Motion X\", \"Cinema-grade video upscale. Noticeably slower and dearer per second than Motion.\", \"video-upscale\", [\"video/*\"], 4),\n model(\"still\", \"Still\", \"Temporal video denoise. Resolution stays put.\", \"video-clean\", [\"video/*\"], 1),\n model(\"cadence\", \"Cadence\", \"Frame interpolation. Does not enlarge the picture.\", \"video-restore\", [\"video/*\"], 1),\n model(\"atelier-x\", \"Atelier X\", \"Still, then Motion X. Two credits.\", \"video-studio\", [\"video/*\"], 4),\n model(\"voice\", \"Voice\", \"Speech denoise and bandwidth extension to 48 kHz. Not for music.\", \"audio-clean\", [\"audio/*\"], 1),\n];\n\nexport const IMAGE_MODELS = MODELS.filter((m) => m.category.startsWith(\"image\"));\nexport const VIDEO_MODELS = MODELS.filter((m) => m.category.startsWith(\"video\"));\nexport const AUDIO_MODELS = MODELS.filter((m) => m.category.startsWith(\"audio\"));\nexport const DEFAULT_IMAGE_MODEL = \"flare\";\nexport const DEFAULT_VIDEO_MODEL = \"motion\";\nexport const DEFAULT_AUDIO_MODEL = \"voice\";\n","#!/usr/bin/env node\n/**\n * UpRes MCP stdio server. Speaks JSON-RPC over stdin/stdout so Claude,\n * Cursor, and Hermes can upscale without a browser.\n *\n * UPRES_API_KEY=upres_... npx upres-cli mcp\n * claude mcp add upres -- npx -y upres-cli mcp\n */\nimport { AUDIO_MODELS, IMAGE_MODELS, MODELS, VIDEO_MODELS } from \"./models.js\";\n\nconst VERSION = \"0.3.0\";\nconst DEFAULT_BASE_URL = \"https://api.upres.ai/v1\";\n\ntype Json = Record<string, unknown>;\n\nfunction apiKey(): string {\n return process.env.UPRES_API_KEY ?? \"\";\n}\n\nfunction baseUrl(): string {\n return process.env.UPRES_BASE_URL ?? DEFAULT_BASE_URL;\n}\n\nasync function api<T>(method: string, endpoint: string, body?: unknown): Promise<T> {\n const key = apiKey();\n if (!key) {\n throw new Error(\"UPRES_API_KEY is not set. Get a key at https://upres.ai/account/api-keys\");\n }\n const res = await fetch(`${baseUrl()}${endpoint}`, {\n method,\n headers: {\n Authorization: `Bearer ${key}`,\n ...(body ? { \"Content-Type\": \"application/json\" } : {}),\n },\n body: body ? JSON.stringify(body) : undefined,\n });\n const data = (await res.json().catch(() => ({}))) as T & { error?: string };\n if (!res.ok) {\n throw new Error(data.error ?? `HTTP ${res.status}`);\n }\n return data;\n}\n\nconst TOOLS = [\n {\n name: \"upres_list_models\",\n description: \"List the 14 public UpRes aliases for image, video, and speech.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n },\n {\n name: \"upres_get_credits\",\n description: \"Show recent job count for the authenticated UpRes API key as a quota proxy.\",\n inputSchema: { type: \"object\", properties: {}, additionalProperties: false },\n },\n {\n name: \"upres_upscale_image\",\n description:\n \"Submit an image job from a public URL. Upscale: flare, prism, lumen, mirage. Restore: hush, keen, visage, atelier. Scale is ignored when the alias does not enlarge.\",\n inputSchema: {\n type: \"object\",\n properties: {\n image_url: { type: \"string\", description: \"Public HTTPS URL of the image\" },\n model: {\n type: \"string\",\n enum: IMAGE_MODELS.map((m) => m.id),\n description: \"Image alias. Default flare.\",\n },\n scale: { type: \"integer\", enum: [2, 4, 8], description: \"Scale multiplier. Default 4. Ignored for hush, keen, and visage.\" },\n },\n required: [\"image_url\"],\n additionalProperties: false,\n },\n },\n {\n name: \"upres_upscale_video\",\n description:\n \"Submit a video job from a public URL. motion and motion-x upscale. still denoises, cadence interpolates frames, atelier-x runs still then motion-x.\",\n inputSchema: {\n type: \"object\",\n properties: {\n video_url: { type: \"string\", description: \"Public HTTPS URL of the video\" },\n model: {\n type: \"string\",\n enum: VIDEO_MODELS.map((m) => m.id),\n description: \"Video alias. Default motion.\",\n },\n scale: { type: \"integer\", enum: [2, 4], description: \"Scale multiplier. Default 4. Ignored for still and cadence.\" },\n },\n required: [\"video_url\"],\n additionalProperties: false,\n },\n },\n {\n name: \"upres_enhance_audio\",\n description: \"Submit a speech job from a public URL. voice denoises speech and extends it to 48 kHz. Music is not supported.\",\n inputSchema: {\n type: \"object\",\n properties: {\n audio_url: { type: \"string\", description: \"Public HTTPS URL of wav, mp3, m4a, or flac speech\" },\n model: {\n type: \"string\",\n enum: AUDIO_MODELS.map((m) => m.id),\n description: \"Audio alias. Default voice.\",\n },\n },\n required: [\"audio_url\"],\n additionalProperties: false,\n },\n },\n {\n name: \"upres_get_job\",\n description: \"Get status and result_url of an UpRes job by id.\",\n inputSchema: {\n type: \"object\",\n properties: {\n job_id: { type: \"string\", description: \"Job UUID returned by an upscale tool\" },\n },\n required: [\"job_id\"],\n additionalProperties: false,\n },\n },\n];\n\nfunction ok(id: unknown, result: unknown) {\n return { jsonrpc: \"2.0\", id, result };\n}\n\nfunction fail(id: unknown, code: number, message: string) {\n return { jsonrpc: \"2.0\", id, error: { code, message } };\n}\n\nfunction text(obj: unknown) {\n return { content: [{ type: \"text\", text: JSON.stringify(obj, null, 2) }] };\n}\n\nasync function callTool(name: string, args: Json): Promise<unknown> {\n switch (name) {\n case \"upres_list_models\":\n return text(\n MODELS.map((m) => ({\n id: m.id,\n name: m.name,\n category: m.category,\n description: m.description,\n })),\n );\n case \"upres_get_credits\": {\n const jobs = await api<{ data: { status: string }[] }>(\"GET\", \"/jobs?limit=100\");\n const data = jobs.data ?? [];\n return text({\n recent_jobs: data.length,\n completed: data.filter((j) => j.status === \"completed\").length,\n pricing: \"https://upres.ai/pricing\",\n });\n }\n case \"upres_upscale_image\": {\n const image_url = String(args.image_url ?? \"\");\n if (!image_url) throw new Error(\"image_url is required\");\n const job = await api(\"POST\", \"/jobs\", {\n image_url,\n model: args.model ?? \"flare\",\n scale: args.scale ?? 4,\n });\n return text(job);\n }\n case \"upres_upscale_video\": {\n const video_url = String(args.video_url ?? \"\");\n if (!video_url) throw new Error(\"video_url is required\");\n const job = await api(\"POST\", \"/jobs\", {\n image_url: video_url,\n model: args.model ?? \"motion\",\n scale: args.scale ?? 4,\n });\n return text(job);\n }\n case \"upres_enhance_audio\": {\n const audio_url = String(args.audio_url ?? \"\");\n if (!audio_url) throw new Error(\"audio_url is required\");\n const job = await api(\"POST\", \"/jobs\", {\n image_url: audio_url,\n model: args.model ?? \"voice\",\n });\n return text(job);\n }\n case \"upres_get_job\": {\n const job_id = String(args.job_id ?? \"\");\n if (!job_id) throw new Error(\"job_id is required\");\n const job = await api(\"GET\", `/jobs/${job_id}`);\n return text(job);\n }\n default:\n throw new Error(`Unknown tool: ${name}`);\n }\n}\n\nasync function handle(msg: Json): Promise<Json | null> {\n const id = msg.id;\n const method = String(msg.method ?? \"\");\n if (msg.jsonrpc !== \"2.0\") return fail(id, -32600, \"Invalid Request\");\n\n if (method === \"initialize\") {\n return ok(id, {\n protocolVersion: \"2024-11-05\",\n capabilities: { tools: {} },\n serverInfo: { name: \"upres\", version: VERSION },\n });\n }\n if (method === \"notifications/initialized\" || method === \"initialized\") return null;\n if (method === \"ping\") return ok(id, {});\n if (method === \"tools/list\") return ok(id, { tools: TOOLS });\n if (method === \"tools/call\") {\n const params = (msg.params ?? {}) as Json;\n const name = String(params.name ?? \"\");\n const args = (params.arguments ?? {}) as Json;\n try {\n return ok(id, await callTool(name, args));\n } catch (e) {\n return ok(id, {\n isError: true,\n content: [{ type: \"text\", text: (e as Error).message }],\n });\n }\n }\n if (id === undefined) return null;\n return fail(id, -32601, `Method not found: ${method}`);\n}\n\nexport async function handleMessage(msg: Json): Promise<Json | null> {\n return handle(msg);\n}\n\nexport function startStdio(): void {\n let buf = \"\";\n process.stdin.setEncoding(\"utf8\");\n process.stdin.on(\"data\", async (chunk: string) => {\n buf += chunk;\n while (true) {\n const nl = buf.indexOf(\"\\n\");\n if (nl < 0) break;\n const line = buf.slice(0, nl).trim();\n buf = buf.slice(nl + 1);\n if (!line) continue;\n let msg: Json;\n try {\n msg = JSON.parse(line) as Json;\n } catch {\n continue;\n }\n const reply = await handle(msg);\n if (reply) process.stdout.write(JSON.stringify(reply) + \"\\n\");\n }\n });\n}\n"],"mappings":";;;AAOA,SAAS,WAAW,UAA6C;AAC/D,MAAI,YAAY,EAAG,QAAO,CAAC;AAC3B,QAAM,UAAoB,CAAC;AAC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AACV,UAAQ,MAAM,YAAY,MAAM;AAChC,UAAQ,MAAM,GAAG,QAAQ,OAAO,UAAkB;AAChD,WAAO;AACP,WAAO,MAAM;AACX,YAAM,KAAK,IAAI,QAAQ,IAAI;AAC3B,UAAI,KAAK,EAAG;AACZ,YAAM,OAAO,IAAI,MAAM,GAAG,EAAE,EAAE,KAAK;AACnC,YAAM,IAAI,MAAM,KAAK,CAAC;AACtB,UAAI,CAAC,KAAM;AACX,UAAI;AACJ,UAAI;AACF,cAAM,KAAK,MAAM,IAAI;AAAA,MACvB,QAAQ;AACN;AAAA,MACF;AACA,YAAM,QAAQ,MAAM,OAAO,GAAG;AAC9B,UAAI,MAAO,SAAQ,OAAO,MAAM,KAAK,UAAU,KAAK,IAAI,IAAI;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/models.cjs
CHANGED
|
@@ -20,6 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/models.ts
|
|
21
21
|
var models_exports = {};
|
|
22
22
|
__export(models_exports, {
|
|
23
|
+
AUDIO_MODELS: () => AUDIO_MODELS,
|
|
24
|
+
DEFAULT_AUDIO_MODEL: () => DEFAULT_AUDIO_MODEL,
|
|
23
25
|
DEFAULT_IMAGE_MODEL: () => DEFAULT_IMAGE_MODEL,
|
|
24
26
|
DEFAULT_VIDEO_MODEL: () => DEFAULT_VIDEO_MODEL,
|
|
25
27
|
IMAGE_MODELS: () => IMAGE_MODELS,
|
|
@@ -27,224 +29,59 @@ __export(models_exports, {
|
|
|
27
29
|
VIDEO_MODELS: () => VIDEO_MODELS
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(models_exports);
|
|
32
|
+
function scaleParam(maxScale) {
|
|
33
|
+
if (maxScale <= 1) return [];
|
|
34
|
+
const options = [];
|
|
35
|
+
for (let step = 2; step <= maxScale; step *= 2) options.push(step);
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
name: "scale",
|
|
39
|
+
type: "integer",
|
|
40
|
+
required: false,
|
|
41
|
+
default: 4,
|
|
42
|
+
options,
|
|
43
|
+
description: "Scale multiplier. Ignored when the alias does not enlarge."
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
function model(id, name, description, category, inputTypes, maxScale) {
|
|
48
|
+
const fileParam = category.startsWith("video") ? { name: "video", type: "string", required: true, description: "Video URL or file" } : category.startsWith("audio") ? { name: "audio", type: "string", required: true, description: "Audio URL or file" } : { name: "image", type: "string", required: true, description: "Image URL or file" };
|
|
49
|
+
return {
|
|
50
|
+
id,
|
|
51
|
+
name,
|
|
52
|
+
description,
|
|
53
|
+
category,
|
|
54
|
+
price: "One credit per stage that runs",
|
|
55
|
+
inputTypes,
|
|
56
|
+
params: [fileParam, ...scaleParam(maxScale)]
|
|
57
|
+
};
|
|
58
|
+
}
|
|
30
59
|
var MODELS = [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
description: "AI upscaler to 2K/4K/8K with detail preservation.",
|
|
46
|
-
category: "image-upscale",
|
|
47
|
-
price: "$0.01/image",
|
|
48
|
-
inputTypes: ["image/*"],
|
|
49
|
-
params: [
|
|
50
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
51
|
-
{ name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
|
|
52
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: "wavespeed-ai/ultimate-image-upscaler",
|
|
57
|
-
name: "Ultimate Image Upscaler",
|
|
58
|
-
description: "Most advanced AI enhancer. Reimagines fine detail at 2K/4K/8K.",
|
|
59
|
-
category: "image-upscale",
|
|
60
|
-
price: "$0.01/image",
|
|
61
|
-
inputTypes: ["image/*"],
|
|
62
|
-
params: [
|
|
63
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
64
|
-
{ name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
|
|
65
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: "wavespeed-ai/seedvr2/image",
|
|
70
|
-
name: "SeedVR2 Image",
|
|
71
|
-
description: "ByteDance SeedVR2 architecture for sharp, detailed upscaling.",
|
|
72
|
-
category: "image-upscale",
|
|
73
|
-
price: "$0.01/image",
|
|
74
|
-
inputTypes: ["image/*"],
|
|
75
|
-
params: [
|
|
76
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
77
|
-
{ name: "target_resolution", type: "string", required: false, default: "4k", options: ["2k", "4k", "8k"], description: "Target output resolution" },
|
|
78
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
id: "bria/increase-resolution",
|
|
83
|
-
name: "Bria Increase Resolution",
|
|
84
|
-
description: "Preservation-first 2x/4x upscale. No content drift.",
|
|
85
|
-
category: "image-upscale",
|
|
86
|
-
price: "$0.04/image",
|
|
87
|
-
inputTypes: ["image/*"],
|
|
88
|
-
params: [
|
|
89
|
-
{ name: "image", type: "string", required: true, description: "Image URL. Max output 8192x8192" },
|
|
90
|
-
{ name: "desired_increase", type: "integer", required: false, default: 2, options: [2, 4], description: "Resolution multiplier" }
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "clarity-ai/crystal-upscaler",
|
|
95
|
-
name: "Crystal Upscaler",
|
|
96
|
-
description: "Upscale to target megapixels with creativity control.",
|
|
97
|
-
category: "image-upscale",
|
|
98
|
-
price: "Pay per use",
|
|
99
|
-
inputTypes: ["image/*"],
|
|
100
|
-
params: [
|
|
101
|
-
{ name: "image", type: "string", required: true, description: "Image URL" },
|
|
102
|
-
{ name: "target_megapixels", type: "number", required: false, default: 2, range: "1-200", description: "Target size in megapixels" },
|
|
103
|
-
{ name: "creativity", type: "number", required: false, default: 0, range: "0-10", description: "Quality improvement strength" }
|
|
104
|
-
]
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
id: "recraft-ai/recraft-crisp-upscale",
|
|
108
|
-
name: "Recraft Crisp Upscale",
|
|
109
|
-
description: "Enhances textures and facial features. Ideal for portraits.",
|
|
110
|
-
category: "image-enhance",
|
|
111
|
-
price: "Pay per use",
|
|
112
|
-
inputTypes: ["image/*"],
|
|
113
|
-
params: [
|
|
114
|
-
{ name: "image", type: "string", required: true, description: "Image URL or base64" }
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: "recraft-ai/recraft-creative-upscale",
|
|
119
|
-
name: "Recraft Creative Upscale",
|
|
120
|
-
description: "Generative enhancement adding depth and polish to complex elements.",
|
|
121
|
-
category: "image-enhance",
|
|
122
|
-
price: "$0.25/image",
|
|
123
|
-
inputTypes: ["image/*"],
|
|
124
|
-
params: [
|
|
125
|
-
{ name: "image", type: "string", required: true, description: "Image URL or base64" }
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: "wavespeed-ai/phota/enhance",
|
|
130
|
-
name: "Phota Enhance",
|
|
131
|
-
description: "Batch enhancement up to 4 images per run with optional 4K output.",
|
|
132
|
-
category: "image-enhance",
|
|
133
|
-
price: "$0.09/image",
|
|
134
|
-
inputTypes: ["image/*"],
|
|
135
|
-
params: [
|
|
136
|
-
{ name: "image", type: "string", required: true, description: "Image URL or base64 data URI" },
|
|
137
|
-
{ name: "num_images", type: "integer", required: false, default: 1, range: "1-4", description: "Enhanced variations to generate" },
|
|
138
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
139
|
-
]
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
id: "wavespeed-ai/z-image-turbo/image-to-image",
|
|
143
|
-
name: "Z-Image Turbo",
|
|
144
|
-
description: "Fast enhance with strength control. Low strength = subtle upscale.",
|
|
145
|
-
category: "image-enhance",
|
|
146
|
-
price: "$0.01/image",
|
|
147
|
-
inputTypes: ["image/*"],
|
|
148
|
-
params: [
|
|
149
|
-
{ name: "image", type: "string", required: true, description: "Reference image URL" },
|
|
150
|
-
{ name: "prompt", type: "string", required: true, description: "Enhancement prompt", default: "enhance image quality, sharp details" },
|
|
151
|
-
{ 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" },
|
|
152
|
-
{ name: "size", type: "string", required: false, default: "1024*1024", description: "Output size (width*height)" },
|
|
153
|
-
{ name: "seed", type: "integer", required: false, default: -1, range: "-1-2147483647", description: "Random seed. -1 = random" },
|
|
154
|
-
{ name: "output_format", type: "string", required: false, default: "jpeg", options: ["jpeg", "png", "webp"], description: "Output format" }
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
id: "wavespeed-ai/video-upscaler",
|
|
159
|
-
name: "Video Upscaler",
|
|
160
|
-
description: "Fast AI video upscaling to 720p-4K. Best value for video.",
|
|
161
|
-
category: "video-upscale",
|
|
162
|
-
price: "$0.005-0.02/sec",
|
|
163
|
-
inputTypes: ["video/*"],
|
|
164
|
-
params: [
|
|
165
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
166
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
id: "wavespeed-ai/video-upscaler-pro",
|
|
171
|
-
name: "Video Upscaler Pro",
|
|
172
|
-
description: "Motion-aware processing with artifact cleanup for pro results.",
|
|
173
|
-
category: "video-upscale",
|
|
174
|
-
price: "$0.03-0.05/sec",
|
|
175
|
-
inputTypes: ["video/*"],
|
|
176
|
-
params: [
|
|
177
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
178
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
179
|
-
]
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
id: "wavespeed-ai/ultimate-video-upscaler",
|
|
183
|
-
name: "Ultimate Video Upscaler",
|
|
184
|
-
description: "Deep learning detail reconstruction for highest quality 4K video.",
|
|
185
|
-
category: "video-upscale",
|
|
186
|
-
price: "$0.02-0.08/sec",
|
|
187
|
-
inputTypes: ["video/*"],
|
|
188
|
-
params: [
|
|
189
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
190
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
id: "wavespeed-ai/seedvr2/video",
|
|
195
|
-
name: "SeedVR2 Video",
|
|
196
|
-
description: "16B param ByteDance model. Highest fidelity with frame consistency.",
|
|
197
|
-
category: "video-upscale",
|
|
198
|
-
price: "$0.02-0.05/sec",
|
|
199
|
-
inputTypes: ["video/*"],
|
|
200
|
-
params: [
|
|
201
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" },
|
|
202
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["720p", "1080p", "2k", "4k"], description: "Target resolution" }
|
|
203
|
-
]
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
id: "bytedance/video-upscaler",
|
|
207
|
-
name: "ByteDance Video Upscaler",
|
|
208
|
-
description: "ByteDance super-resolution recovering fine detail to 4K.",
|
|
209
|
-
category: "video-upscale",
|
|
210
|
-
price: "$0.007-0.029/sec",
|
|
211
|
-
inputTypes: ["video/*"],
|
|
212
|
-
params: [
|
|
213
|
-
{ name: "video", type: "string", required: true, description: "Video URL" },
|
|
214
|
-
{ name: "target_resolution", type: "string", required: false, default: "1080p", options: ["1080p", "2k", "4k"], description: "Target resolution" }
|
|
215
|
-
]
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
id: "bria/fibo/video-upscaler",
|
|
219
|
-
name: "Bria Video Upscaler",
|
|
220
|
-
description: "Temporal consistency with multiple output codec options.",
|
|
221
|
-
category: "video-upscale",
|
|
222
|
-
price: "$0.14/sec",
|
|
223
|
-
inputTypes: ["video/*"],
|
|
224
|
-
params: [
|
|
225
|
-
{ name: "video", type: "string", required: true, description: "Video URL" },
|
|
226
|
-
{ name: "target_resolution", type: "string", required: false, default: "2k", options: ["2k", "4k"], description: "Target resolution" },
|
|
227
|
-
{ 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" }
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
id: "runwayml/upscale-v1",
|
|
232
|
-
name: "RunwayML Upscale",
|
|
233
|
-
description: "Simple one-click video upscale to 4K by RunwayML.",
|
|
234
|
-
category: "video-upscale",
|
|
235
|
-
price: "$0.02/sec",
|
|
236
|
-
inputTypes: ["video/*"],
|
|
237
|
-
params: [
|
|
238
|
-
{ name: "video", type: "string", required: true, description: "Video URL. Max 10 minutes" }
|
|
239
|
-
]
|
|
240
|
-
}
|
|
60
|
+
model("flare", "Flare", "Everyday photos, 2x-4x. Fastest and cheapest. Does not invent detail.", "image-upscale", ["image/*"], 4),
|
|
61
|
+
model("prism", "Prism", "Text, logos, screenshots and product shots. Keeps edges true, does not invent detail.", "image-upscale", ["image/*"], 4),
|
|
62
|
+
model("lumen", "Lumen", "Maximum detail recovery for print, up to 8x. Slower and dearer than Flare.", "image-upscale", ["image/*"], 8),
|
|
63
|
+
model("mirage", "Mirage", "Invents plausible new detail rather than recovering what was there. Good for art, wrong for documents.", "image-upscale", ["image/*"], 8),
|
|
64
|
+
model("hush", "Hush", "Faithful denoise. Same size as the source, nothing invented.", "image-clean", ["image/*"], 1),
|
|
65
|
+
model("keen", "Keen", "Deblur and sharpen. Same size as the source, does not invent texture.", "image-restore", ["image/*"], 1),
|
|
66
|
+
model("visage", "Visage", "Restores faces and leaves the rest of the frame alone. Does not enlarge.", "image-restore", ["image/*"], 1),
|
|
67
|
+
model("atelier", "Atelier", "Hush, then Visage if the photo looks like a portrait, then Lumen. A skipped face stage is free.", "image-studio", ["image/*"], 8),
|
|
68
|
+
model("motion", "Motion", "Fast 4K finish for AI-generated video. Frame-consistent, does not invent faces.", "video-upscale", ["video/*"], 4),
|
|
69
|
+
model("motion-x", "Motion X", "Cinema-grade video upscale. Noticeably slower and dearer per second than Motion.", "video-upscale", ["video/*"], 4),
|
|
70
|
+
model("still", "Still", "Temporal video denoise. Resolution stays put.", "video-clean", ["video/*"], 1),
|
|
71
|
+
model("cadence", "Cadence", "Frame interpolation. Does not enlarge the picture.", "video-restore", ["video/*"], 1),
|
|
72
|
+
model("atelier-x", "Atelier X", "Still, then Motion X. Two credits.", "video-studio", ["video/*"], 4),
|
|
73
|
+
model("voice", "Voice", "Speech denoise and bandwidth extension to 48 kHz. Not for music.", "audio-clean", ["audio/*"], 1)
|
|
241
74
|
];
|
|
242
|
-
var IMAGE_MODELS = MODELS.filter((m) => m.category
|
|
243
|
-
var VIDEO_MODELS = MODELS.filter((m) => m.category
|
|
244
|
-
var
|
|
245
|
-
var
|
|
75
|
+
var IMAGE_MODELS = MODELS.filter((m) => m.category.startsWith("image"));
|
|
76
|
+
var VIDEO_MODELS = MODELS.filter((m) => m.category.startsWith("video"));
|
|
77
|
+
var AUDIO_MODELS = MODELS.filter((m) => m.category.startsWith("audio"));
|
|
78
|
+
var DEFAULT_IMAGE_MODEL = "flare";
|
|
79
|
+
var DEFAULT_VIDEO_MODEL = "motion";
|
|
80
|
+
var DEFAULT_AUDIO_MODEL = "voice";
|
|
246
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
247
82
|
0 && (module.exports = {
|
|
83
|
+
AUDIO_MODELS,
|
|
84
|
+
DEFAULT_AUDIO_MODEL,
|
|
248
85
|
DEFAULT_IMAGE_MODEL,
|
|
249
86
|
DEFAULT_VIDEO_MODEL,
|
|
250
87
|
IMAGE_MODELS,
|
package/dist/models.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["import type { ModelDefinition } from \"./types.js\";\n\nexport const MODELS: ModelDefinition[] = [\n {\n id: \"wavespeed-ai/real-esrgan\",\n name: \"Real-ESRGAN\",\n description: \"Fast image super-resolution with artifact removal. Best value.\",\n category: \"image-upscale\",\n price: \"$0.0024/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL\" },\n ],\n },\n {\n id: \"wavespeed-ai/image-upscaler\",\n name: \"Image Upscaler\",\n description: \"AI upscaler to 2K/4K/8K with detail preservation.\",\n category: \"image-upscale\",\n price: \"$0.01/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"4k\", options: [\"2k\", \"4k\", \"8k\"], description: \"Target output resolution\" },\n { name: \"output_format\", type: \"string\", required: false, default: \"jpeg\", options: [\"jpeg\", \"png\", \"webp\"], description: \"Output format\" },\n ],\n },\n {\n id: \"wavespeed-ai/ultimate-image-upscaler\",\n name: \"Ultimate Image Upscaler\",\n description: \"Most advanced AI enhancer. Reimagines fine detail at 2K/4K/8K.\",\n category: \"image-upscale\",\n price: \"$0.01/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"4k\", options: [\"2k\", \"4k\", \"8k\"], description: \"Target output resolution\" },\n { name: \"output_format\", type: \"string\", required: false, default: \"jpeg\", options: [\"jpeg\", \"png\", \"webp\"], description: \"Output format\" },\n ],\n },\n {\n id: \"wavespeed-ai/seedvr2/image\",\n name: \"SeedVR2 Image\",\n description: \"ByteDance SeedVR2 architecture for sharp, detailed upscaling.\",\n category: \"image-upscale\",\n price: \"$0.01/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"4k\", options: [\"2k\", \"4k\", \"8k\"], description: \"Target output resolution\" },\n { name: \"output_format\", type: \"string\", required: false, default: \"jpeg\", options: [\"jpeg\", \"png\", \"webp\"], description: \"Output format\" },\n ],\n },\n {\n id: \"bria/increase-resolution\",\n name: \"Bria Increase Resolution\",\n description: \"Preservation-first 2x/4x upscale. No content drift.\",\n category: \"image-upscale\",\n price: \"$0.04/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL. Max output 8192x8192\" },\n { name: \"desired_increase\", type: \"integer\", required: false, default: 2, options: [2, 4], description: \"Resolution multiplier\" },\n ],\n },\n {\n id: \"clarity-ai/crystal-upscaler\",\n name: \"Crystal Upscaler\",\n description: \"Upscale to target megapixels with creativity control.\",\n category: \"image-upscale\",\n price: \"Pay per use\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL\" },\n { name: \"target_megapixels\", type: \"number\", required: false, default: 2, range: \"1-200\", description: \"Target size in megapixels\" },\n { name: \"creativity\", type: \"number\", required: false, default: 0, range: \"0-10\", description: \"Quality improvement strength\" },\n ],\n },\n {\n id: \"recraft-ai/recraft-crisp-upscale\",\n name: \"Recraft Crisp Upscale\",\n description: \"Enhances textures and facial features. Ideal for portraits.\",\n category: \"image-enhance\",\n price: \"Pay per use\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL or base64\" },\n ],\n },\n {\n id: \"recraft-ai/recraft-creative-upscale\",\n name: \"Recraft Creative Upscale\",\n description: \"Generative enhancement adding depth and polish to complex elements.\",\n category: \"image-enhance\",\n price: \"$0.25/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL or base64\" },\n ],\n },\n {\n id: \"wavespeed-ai/phota/enhance\",\n name: \"Phota Enhance\",\n description: \"Batch enhancement up to 4 images per run with optional 4K output.\",\n category: \"image-enhance\",\n price: \"$0.09/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Image URL or base64 data URI\" },\n { name: \"num_images\", type: \"integer\", required: false, default: 1, range: \"1-4\", description: \"Enhanced variations to generate\" },\n { name: \"output_format\", type: \"string\", required: false, default: \"jpeg\", options: [\"jpeg\", \"png\", \"webp\"], description: \"Output format\" },\n ],\n },\n {\n id: \"wavespeed-ai/z-image-turbo/image-to-image\",\n name: \"Z-Image Turbo\",\n description: \"Fast enhance with strength control. Low strength = subtle upscale.\",\n category: \"image-enhance\",\n price: \"$0.01/image\",\n inputTypes: [\"image/*\"],\n params: [\n { name: \"image\", type: \"string\", required: true, description: \"Reference image URL\" },\n { name: \"prompt\", type: \"string\", required: true, description: \"Enhancement prompt\", default: \"enhance image quality, sharp details\" },\n { 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\" },\n { name: \"size\", type: \"string\", required: false, default: \"1024*1024\", description: \"Output size (width*height)\" },\n { name: \"seed\", type: \"integer\", required: false, default: -1, range: \"-1-2147483647\", description: \"Random seed. -1 = random\" },\n { name: \"output_format\", type: \"string\", required: false, default: \"jpeg\", options: [\"jpeg\", \"png\", \"webp\"], description: \"Output format\" },\n ],\n },\n {\n id: \"wavespeed-ai/video-upscaler\",\n name: \"Video Upscaler\",\n description: \"Fast AI video upscaling to 720p-4K. Best value for video.\",\n category: \"video-upscale\",\n price: \"$0.005-0.02/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL. Max 10 minutes\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"1080p\", options: [\"720p\", \"1080p\", \"2k\", \"4k\"], description: \"Target resolution\" },\n ],\n },\n {\n id: \"wavespeed-ai/video-upscaler-pro\",\n name: \"Video Upscaler Pro\",\n description: \"Motion-aware processing with artifact cleanup for pro results.\",\n category: \"video-upscale\",\n price: \"$0.03-0.05/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL. Max 10 minutes\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"1080p\", options: [\"720p\", \"1080p\", \"2k\", \"4k\"], description: \"Target resolution\" },\n ],\n },\n {\n id: \"wavespeed-ai/ultimate-video-upscaler\",\n name: \"Ultimate Video Upscaler\",\n description: \"Deep learning detail reconstruction for highest quality 4K video.\",\n category: \"video-upscale\",\n price: \"$0.02-0.08/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL. Max 10 minutes\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"1080p\", options: [\"720p\", \"1080p\", \"2k\", \"4k\"], description: \"Target resolution\" },\n ],\n },\n {\n id: \"wavespeed-ai/seedvr2/video\",\n name: \"SeedVR2 Video\",\n description: \"16B param ByteDance model. Highest fidelity with frame consistency.\",\n category: \"video-upscale\",\n price: \"$0.02-0.05/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL. Max 10 minutes\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"1080p\", options: [\"720p\", \"1080p\", \"2k\", \"4k\"], description: \"Target resolution\" },\n ],\n },\n {\n id: \"bytedance/video-upscaler\",\n name: \"ByteDance Video Upscaler\",\n description: \"ByteDance super-resolution recovering fine detail to 4K.\",\n category: \"video-upscale\",\n price: \"$0.007-0.029/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"1080p\", options: [\"1080p\", \"2k\", \"4k\"], description: \"Target resolution\" },\n ],\n },\n {\n id: \"bria/fibo/video-upscaler\",\n name: \"Bria Video Upscaler\",\n description: \"Temporal consistency with multiple output codec options.\",\n category: \"video-upscale\",\n price: \"$0.14/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL\" },\n { name: \"target_resolution\", type: \"string\", required: false, default: \"2k\", options: [\"2k\", \"4k\"], description: \"Target resolution\" },\n { 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\" },\n ],\n },\n {\n id: \"runwayml/upscale-v1\",\n name: \"RunwayML Upscale\",\n description: \"Simple one-click video upscale to 4K by RunwayML.\",\n category: \"video-upscale\",\n price: \"$0.02/sec\",\n inputTypes: [\"video/*\"],\n params: [\n { name: \"video\", type: \"string\", required: true, description: \"Video URL. Max 10 minutes\" },\n ],\n },\n];\n\nexport const IMAGE_MODELS = MODELS.filter((m) => m.category !== \"video-upscale\");\nexport const VIDEO_MODELS = MODELS.filter((m) => m.category === \"video-upscale\");\nexport const DEFAULT_IMAGE_MODEL = \"wavespeed-ai/image-upscaler\";\nexport const DEFAULT_VIDEO_MODEL = \"wavespeed-ai/video-upscaler\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAA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,qBAAqB,MAAM,UAAU,UAAU,OAAO,SAAS,MAAM,SAAS,CAAC,MAAM,IAAI,GAAG,aAAa,oBAAoB;AAAA,MACrI,EAAE,MAAM,8BAA8B,MAAM,UAAU,UAAU,OAAO,SAAS,YAAY,SAAS,CAAC,YAAY,YAAY,YAAY,YAAY,gBAAgB,YAAY,YAAY,WAAW,KAAK,GAAG,aAAa,6BAA6B;AAAA,IAC7P;AAAA,EACF;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,IACV,OAAO;AAAA,IACP,YAAY,CAAC,SAAS;AAAA,IACtB,QAAQ;AAAA,MACN,EAAE,MAAM,SAAS,MAAM,UAAU,UAAU,MAAM,aAAa,4BAA4B;AAAA,IAC5F;AAAA,EACF;AACF;AAEO,IAAM,eAAe,OAAO,OAAO,CAAC,MAAM,EAAE,aAAa,eAAe;AACxE,IAAM,eAAe,OAAO,OAAO,CAAC,MAAM,EAAE,aAAa,eAAe;AACxE,IAAM,sBAAsB;AAC5B,IAAM,sBAAsB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/models.ts"],"sourcesContent":["import type { ModelDefinition } from \"./types.js\";\n\n// Synced with the public aliases in upres.ai server/contract/models.ts.\n// A job names one alias. Which backend serves it is ours to choose and can\n// change without notice — that is how a failing vendor stops being your outage.\n// Aliases with max scale 1 do not enlarge; the API stores scale 1 for them.\n\nfunction scaleParam(maxScale: number): ModelDefinition[\"params\"] {\n if (maxScale <= 1) return [];\n const options: number[] = [];\n for (let step = 2; step <= maxScale; step *= 2) options.push(step);\n return [\n {\n name: \"scale\",\n type: \"integer\",\n required: false,\n default: 4,\n options,\n description: \"Scale multiplier. Ignored when the alias does not enlarge.\",\n },\n ];\n}\n\nfunction model(\n id: string,\n name: string,\n description: string,\n category: ModelDefinition[\"category\"],\n inputTypes: string[],\n maxScale: number,\n): ModelDefinition {\n const fileParam =\n category.startsWith(\"video\")\n ? { name: \"video\", type: \"string\" as const, required: true, description: \"Video URL or file\" }\n : category.startsWith(\"audio\")\n ? { name: \"audio\", type: \"string\" as const, required: true, description: \"Audio URL or file\" }\n : { name: \"image\", type: \"string\" as const, required: true, description: \"Image URL or file\" };\n return {\n id,\n name,\n description,\n category,\n price: \"One credit per stage that runs\",\n inputTypes,\n params: [fileParam, ...scaleParam(maxScale)],\n };\n}\n\nexport const MODELS: ModelDefinition[] = [\n model(\"flare\", \"Flare\", \"Everyday photos, 2x-4x. Fastest and cheapest. Does not invent detail.\", \"image-upscale\", [\"image/*\"], 4),\n model(\"prism\", \"Prism\", \"Text, logos, screenshots and product shots. Keeps edges true, does not invent detail.\", \"image-upscale\", [\"image/*\"], 4),\n model(\"lumen\", \"Lumen\", \"Maximum detail recovery for print, up to 8x. Slower and dearer than Flare.\", \"image-upscale\", [\"image/*\"], 8),\n model(\"mirage\", \"Mirage\", \"Invents plausible new detail rather than recovering what was there. Good for art, wrong for documents.\", \"image-upscale\", [\"image/*\"], 8),\n model(\"hush\", \"Hush\", \"Faithful denoise. Same size as the source, nothing invented.\", \"image-clean\", [\"image/*\"], 1),\n model(\"keen\", \"Keen\", \"Deblur and sharpen. Same size as the source, does not invent texture.\", \"image-restore\", [\"image/*\"], 1),\n model(\"visage\", \"Visage\", \"Restores faces and leaves the rest of the frame alone. Does not enlarge.\", \"image-restore\", [\"image/*\"], 1),\n model(\"atelier\", \"Atelier\", \"Hush, then Visage if the photo looks like a portrait, then Lumen. A skipped face stage is free.\", \"image-studio\", [\"image/*\"], 8),\n model(\"motion\", \"Motion\", \"Fast 4K finish for AI-generated video. Frame-consistent, does not invent faces.\", \"video-upscale\", [\"video/*\"], 4),\n model(\"motion-x\", \"Motion X\", \"Cinema-grade video upscale. Noticeably slower and dearer per second than Motion.\", \"video-upscale\", [\"video/*\"], 4),\n model(\"still\", \"Still\", \"Temporal video denoise. Resolution stays put.\", \"video-clean\", [\"video/*\"], 1),\n model(\"cadence\", \"Cadence\", \"Frame interpolation. Does not enlarge the picture.\", \"video-restore\", [\"video/*\"], 1),\n model(\"atelier-x\", \"Atelier X\", \"Still, then Motion X. Two credits.\", \"video-studio\", [\"video/*\"], 4),\n model(\"voice\", \"Voice\", \"Speech denoise and bandwidth extension to 48 kHz. Not for music.\", \"audio-clean\", [\"audio/*\"], 1),\n];\n\nexport const IMAGE_MODELS = MODELS.filter((m) => m.category.startsWith(\"image\"));\nexport const VIDEO_MODELS = MODELS.filter((m) => m.category.startsWith(\"video\"));\nexport const AUDIO_MODELS = MODELS.filter((m) => m.category.startsWith(\"audio\"));\nexport const DEFAULT_IMAGE_MODEL = \"flare\";\nexport const DEFAULT_VIDEO_MODEL = \"motion\";\nexport const DEFAULT_AUDIO_MODEL = \"voice\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,SAAS,WAAW,UAA6C;AAC/D,MAAI,YAAY,EAAG,QAAO,CAAC;AAC3B,QAAM,UAAoB,CAAC;AAC3B,WAAS,OAAO,GAAG,QAAQ,UAAU,QAAQ,EAAG,SAAQ,KAAK,IAAI;AACjE,SAAO;AAAA,IACL;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,MACT;AAAA,MACA,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEA,SAAS,MACP,IACA,MACA,aACA,UACA,YACA,UACiB;AACjB,QAAM,YACJ,SAAS,WAAW,OAAO,IACvB,EAAE,MAAM,SAAS,MAAM,UAAmB,UAAU,MAAM,aAAa,oBAAoB,IAC3F,SAAS,WAAW,OAAO,IACzB,EAAE,MAAM,SAAS,MAAM,UAAmB,UAAU,MAAM,aAAa,oBAAoB,IAC3F,EAAE,MAAM,SAAS,MAAM,UAAmB,UAAU,MAAM,aAAa,oBAAoB;AACnG,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,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E,SAAS,WAAW,OAAO,CAAC;AACxE,IAAM,eAAe,OAAO,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW,OAAO,CAAC;AACxE,IAAM,sBAAsB;AAC5B,IAAM,sBAAsB;AAC5B,IAAM,sBAAsB;","names":[]}
|
package/dist/models.d.cts
CHANGED
|
@@ -3,7 +3,9 @@ import { ModelDefinition } from './types.cjs';
|
|
|
3
3
|
declare const MODELS: ModelDefinition[];
|
|
4
4
|
declare const IMAGE_MODELS: ModelDefinition[];
|
|
5
5
|
declare const VIDEO_MODELS: ModelDefinition[];
|
|
6
|
-
declare const
|
|
7
|
-
declare const
|
|
6
|
+
declare const AUDIO_MODELS: ModelDefinition[];
|
|
7
|
+
declare const DEFAULT_IMAGE_MODEL = "flare";
|
|
8
|
+
declare const DEFAULT_VIDEO_MODEL = "motion";
|
|
9
|
+
declare const DEFAULT_AUDIO_MODEL = "voice";
|
|
8
10
|
|
|
9
|
-
export { DEFAULT_IMAGE_MODEL, DEFAULT_VIDEO_MODEL, IMAGE_MODELS, MODELS, VIDEO_MODELS };
|
|
11
|
+
export { AUDIO_MODELS, DEFAULT_AUDIO_MODEL, DEFAULT_IMAGE_MODEL, DEFAULT_VIDEO_MODEL, IMAGE_MODELS, MODELS, VIDEO_MODELS };
|
package/dist/models.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { ModelDefinition } from './types.js';
|
|
|
3
3
|
declare const MODELS: ModelDefinition[];
|
|
4
4
|
declare const IMAGE_MODELS: ModelDefinition[];
|
|
5
5
|
declare const VIDEO_MODELS: ModelDefinition[];
|
|
6
|
-
declare const
|
|
7
|
-
declare const
|
|
6
|
+
declare const AUDIO_MODELS: ModelDefinition[];
|
|
7
|
+
declare const DEFAULT_IMAGE_MODEL = "flare";
|
|
8
|
+
declare const DEFAULT_VIDEO_MODEL = "motion";
|
|
9
|
+
declare const DEFAULT_AUDIO_MODEL = "voice";
|
|
8
10
|
|
|
9
|
-
export { DEFAULT_IMAGE_MODEL, DEFAULT_VIDEO_MODEL, IMAGE_MODELS, MODELS, VIDEO_MODELS };
|
|
11
|
+
export { AUDIO_MODELS, DEFAULT_AUDIO_MODEL, DEFAULT_IMAGE_MODEL, DEFAULT_VIDEO_MODEL, IMAGE_MODELS, MODELS, VIDEO_MODELS };
|