dsh-lovart-mcp 0.14.0 → 0.16.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 +18 -0
- package/lib/index.js +26 -2
- package/lib/pricing.mjs +46 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,6 +57,24 @@ dsh plugin install dsh-lovart-mcp
|
|
|
57
57
|
|
|
58
58
|
生成是异步的:`lovart_generate` 只负责提交,返回 `task_ids`。要产物就再调 `lovart_task(task_ids: "...", wait: "true")`,它会轮询到完成,并把最终的图片或视频 URL 直接给你。传 `project_id` 可以把结果放进已有项目。
|
|
59
59
|
|
|
60
|
+
## 费用
|
|
61
|
+
|
|
62
|
+
生成前先 `lovart_quote`:已知价格直接给数字,未公开的会要求确认。下面这些是本机实测过的:
|
|
63
|
+
|
|
64
|
+
| 项目 | 积分 |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| Nano Banana 2 1K 图(Relax 通道) | 0 |
|
|
67
|
+
| GPT Image 2 2048×2048 | 12 |
|
|
68
|
+
| Wan 2.5 5 秒 720p | 25 |
|
|
69
|
+
| Kling 4.0 Flash 5 秒 720p | 45 |
|
|
70
|
+
| Seedance 2.0 Mini 5 秒 720p | 50 |
|
|
71
|
+
| Seedance 2.0 Fast 5 秒 720p | 70 |
|
|
72
|
+
| Seedance 2.0 5 秒 720p / 1080p | 90 / 250 |
|
|
73
|
+
| Seedance 2.5 Flash 5 秒 720p(含音频) | 101 |
|
|
74
|
+
| 放大 / 矢量化 / 分层 / 改图 | 4 / 9 / 5 / 17 |
|
|
75
|
+
|
|
76
|
+
按 Pro 月付折算,1 积分约 $0.0082。其他模型的价格 Lovart 没有公开,插件会在花分前把估算和「需要确认」一起给你。
|
|
77
|
+
|
|
60
78
|
## 模型与能力
|
|
61
79
|
|
|
62
80
|
面板底部有一块「模型与能力」:能力按生成、编辑、素材、项目、任务、模型目录、账户、评估分组,模型按厂商(openai、vertex、seedance……)分组。
|
package/lib/index.js
CHANGED
|
@@ -779,6 +779,7 @@ export async function apply(ctx, config = {}) {
|
|
|
779
779
|
const extra = quoteExtra(requested, { plan: typeof args.plan === 'string' ? args.plan : undefined })
|
|
780
780
|
if (extra !== undefined) return JSON.stringify(extra, null, 2)
|
|
781
781
|
const priced = quote({
|
|
782
|
+
kind: requested === 'video' ? 'video' : 'image',
|
|
782
783
|
model: typeof args.model === 'string' ? args.model : undefined,
|
|
783
784
|
resolution: typeof args.resolution === 'string' ? args.resolution : undefined,
|
|
784
785
|
duration: typeof args.duration === 'string' ? args.duration : undefined,
|
|
@@ -934,10 +935,33 @@ export async function apply(ctx, config = {}) {
|
|
|
934
935
|
? payload.tasks
|
|
935
936
|
: Array.isArray(payload?.result?.tasks)
|
|
936
937
|
? payload.result.tasks
|
|
937
|
-
: payload?.task_id !== undefined || payload?.taskId !== undefined
|
|
938
|
+
: payload?.task_id !== undefined || payload?.taskId !== undefined || payload?.id !== undefined
|
|
938
939
|
? [payload]
|
|
939
940
|
: []
|
|
940
|
-
|
|
941
|
+
const rows = list.map((item) => summarizeTask(item)).filter((item) => item !== null && item.taskId !== null)
|
|
942
|
+
if (rows.length > 0) return rows
|
|
943
|
+
// The gateway answers with the artifacts and a single status, not one
|
|
944
|
+
// record per task id, so rebuild the rows from the ids we asked about.
|
|
945
|
+
const source = payload?.result !== undefined && typeof payload.result === 'object' ? payload.result : payload
|
|
946
|
+
if (source === null || typeof source !== 'object' || typeof source.status !== 'string') return rows
|
|
947
|
+
const artifacts = ids.length === 1 && Array.isArray(source.artifacts)
|
|
948
|
+
? source.artifacts.map((item) => ({
|
|
949
|
+
url: item?.url ?? null,
|
|
950
|
+
format: item?.format ?? null,
|
|
951
|
+
width: item?.width ?? null,
|
|
952
|
+
height: item?.height ?? null,
|
|
953
|
+
seconds: item?.duration_seconds ?? null,
|
|
954
|
+
}))
|
|
955
|
+
: []
|
|
956
|
+
return ids.map((id) => ({
|
|
957
|
+
taskId: id,
|
|
958
|
+
status: source.status,
|
|
959
|
+
model: source.model ?? null,
|
|
960
|
+
projectId: source.project_id ?? null,
|
|
961
|
+
durationMs: null,
|
|
962
|
+
error: null,
|
|
963
|
+
artifacts,
|
|
964
|
+
}))
|
|
941
965
|
}
|
|
942
966
|
let rows = []
|
|
943
967
|
for (;;) {
|
package/lib/pricing.mjs
CHANGED
|
@@ -57,7 +57,38 @@ export const VIDEO_MODELS = {
|
|
|
57
57
|
'seedance/seedance-2-0': {
|
|
58
58
|
label: 'Seedance 2.0',
|
|
59
59
|
defaultResolution: '720p',
|
|
60
|
-
per5s: { '720p': 90 },
|
|
60
|
+
per5s: { '720p': 90, '1080p': 250 },
|
|
61
|
+
measured: true,
|
|
62
|
+
},
|
|
63
|
+
'seedance/seedance-2-0-fast': {
|
|
64
|
+
label: 'Seedance 2.0 Fast',
|
|
65
|
+
defaultResolution: '720p',
|
|
66
|
+
per5s: { '720p': 70 },
|
|
67
|
+
measured: true,
|
|
68
|
+
},
|
|
69
|
+
'seedance/seedance-2-0-mini': {
|
|
70
|
+
label: 'Seedance 2.0 Mini',
|
|
71
|
+
defaultResolution: '720p',
|
|
72
|
+
per5s: { '720p': 50 },
|
|
73
|
+
measured: true,
|
|
74
|
+
},
|
|
75
|
+
'seedance/seedance-2-5-flash': {
|
|
76
|
+
label: 'Seedance 2.5 Flash',
|
|
77
|
+
defaultResolution: '720p',
|
|
78
|
+
per5s: { '720p': 101 },
|
|
79
|
+
measured: true,
|
|
80
|
+
},
|
|
81
|
+
'kling/kling-v4-flash': {
|
|
82
|
+
label: 'Kling 4.0 Flash',
|
|
83
|
+
defaultResolution: '720p',
|
|
84
|
+
per5s: { '720p': 45 },
|
|
85
|
+
measured: true,
|
|
86
|
+
},
|
|
87
|
+
'wan/wan-2-5-preview': {
|
|
88
|
+
label: 'Wan 2.5',
|
|
89
|
+
defaultResolution: '720p',
|
|
90
|
+
per5s: { '720p': 25 },
|
|
91
|
+
measured: true,
|
|
61
92
|
},
|
|
62
93
|
}
|
|
63
94
|
|
|
@@ -151,7 +182,19 @@ export function estimateImage({ model, resolution, count = 1 }) {
|
|
|
151
182
|
export function estimateVideo({ model, resolution, duration, count = 1 }) {
|
|
152
183
|
const chosen = model && model !== '' ? model : DEFAULT_VIDEO_MODEL
|
|
153
184
|
const entry = VIDEO_MODELS[chosen]
|
|
154
|
-
if (entry === undefined)
|
|
185
|
+
if (entry === undefined) {
|
|
186
|
+
return {
|
|
187
|
+
model: chosen,
|
|
188
|
+
label: chosen,
|
|
189
|
+
credits: null,
|
|
190
|
+
perOutput: null,
|
|
191
|
+
resolution: resolution === undefined || String(resolution).trim() === '' ? undefined : String(resolution).toLowerCase(),
|
|
192
|
+
seconds: Math.max(1, Number(duration) || 5),
|
|
193
|
+
count: Math.max(1, Number(count) || 1),
|
|
194
|
+
measured: false,
|
|
195
|
+
known: false,
|
|
196
|
+
}
|
|
197
|
+
}
|
|
155
198
|
const res = resolution === undefined || String(resolution).trim() === '' || /K$/ui.test(String(resolution))
|
|
156
199
|
? entry.defaultResolution
|
|
157
200
|
: String(resolution).toLowerCase()
|
|
@@ -168,6 +211,7 @@ export function estimateVideo({ model, resolution, duration, count = 1 }) {
|
|
|
168
211
|
resolution: res,
|
|
169
212
|
seconds,
|
|
170
213
|
count: countUnits,
|
|
214
|
+
measured: entry.measured === true,
|
|
171
215
|
known: credits !== null,
|
|
172
216
|
}
|
|
173
217
|
}
|