@aswless_854771076/ai_short_studio_cli 0.1.28 → 0.1.30
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
CHANGED
|
@@ -85,7 +85,7 @@ CLI 通过 `/api/v1/bootstrap` 完成版本、连通性与 Supabase 公共配置
|
|
|
85
85
|
|
|
86
86
|
`canvas settings set` 支持项目级 `imageResolution`、`imageQuality`、`videoResolution`,未覆盖的图片、图片编辑和视频节点会继承这些默认值。候选值来自 `settings get` 对应字段的实时 `options`;节点仅在需要偏离项目默认时,按当前模型 `capabilities` 写入 `resolution`、`quality` 覆盖。
|
|
87
87
|
|
|
88
|
-
百炼 CosyVoice 的 `tts` 节点通过实时 schema 提供音色、语言、格式、采样率、音量、语速、音调和声音指令。先用 `canvas settings get` 确认最终 `audioModel`,再从 `canvas node types` 返回的 `tts.configSchema` 选择字段和值;CLI
|
|
88
|
+
百炼 CosyVoice 的 `tts` 节点通过实时 schema 提供音色、语言、格式、采样率、音量、语速、音调和声音指令。先用 `canvas settings get` 确认最终 `audioModel`,再从 `canvas node types` 返回的 `tts.configSchema` 选择字段和值;CLI 会在写入前校验必填字段、类型、整数、枚举和数值上下限。
|
|
89
89
|
|
|
90
90
|
声音克隆使用实时目录中的 `voice-clone` 节点:参考音频连接 `audio`,成功后将 `voice` 输出连接到 `tts.voice`,无需手工复制音色 ID。
|
|
91
91
|
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
function validateConfigSchema(nodeType, config) {
|
|
3
|
-
|
|
4
|
-
return;
|
|
2
|
+
function validateConfigSchema(nodeType, config, requiredValues = config ?? {}) {
|
|
3
|
+
const values = config ?? {};
|
|
5
4
|
const properties = nodeType.configSchema?.properties;
|
|
6
5
|
if (!properties || typeof properties !== 'object' || Array.isArray(properties))
|
|
7
6
|
return;
|
|
8
|
-
|
|
7
|
+
const required = nodeType.configSchema?.required;
|
|
8
|
+
if (Array.isArray(required)) {
|
|
9
|
+
for (const key of required) {
|
|
10
|
+
if (typeof key === 'string' && (!(key in requiredValues) || requiredValues[key] === '')) {
|
|
11
|
+
throw new Error(`节点 ${nodeType.kind} 缺少必填配置:${key}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
for (const [key, value] of Object.entries(values)) {
|
|
9
16
|
const schema = properties[key];
|
|
10
17
|
if (!schema || typeof schema !== 'object' || Array.isArray(schema)) {
|
|
11
18
|
throw new Error(`节点 ${nodeType.kind} 的 ${key} 不在实时 schema 中`);
|
|
@@ -107,14 +114,15 @@ export class VvicatApi {
|
|
|
107
114
|
const definition = catalog.nodeTypes.find((item) => item.kind === input.kind);
|
|
108
115
|
if (!definition)
|
|
109
116
|
throw new Error(`未知节点类型:${input.kind}`);
|
|
110
|
-
|
|
117
|
+
const config = { ...definition.defaultConfig, ...input.config };
|
|
118
|
+
validateConfigSchema(definition, input.config, config);
|
|
111
119
|
const node = {
|
|
112
120
|
id: randomUUID(),
|
|
113
121
|
kind: input.kind,
|
|
114
122
|
title: input.title || definition.title,
|
|
115
123
|
x: input.x ?? 0,
|
|
116
124
|
y: input.y ?? 0,
|
|
117
|
-
data: { schemaVersion: 1, config
|
|
125
|
+
data: { schemaVersion: 1, config },
|
|
118
126
|
};
|
|
119
127
|
return this.patchCanvas(projectId, {
|
|
120
128
|
canvasId: canvas.id,
|
|
@@ -131,11 +139,12 @@ export class VvicatApi {
|
|
|
131
139
|
const definition = catalog.nodeTypes.find((item) => item.kind === node.kind);
|
|
132
140
|
if (!definition)
|
|
133
141
|
throw new Error(`未知节点类型:${node.kind}`);
|
|
134
|
-
|
|
142
|
+
const nextConfig = { ...node.data.config, ...config };
|
|
143
|
+
validateConfigSchema(definition, config, nextConfig);
|
|
135
144
|
return this.patchCanvas(projectId, {
|
|
136
145
|
canvasId: canvas.id,
|
|
137
146
|
expectedVersion: canvas.version,
|
|
138
|
-
upsertNodes: [{ ...node, data: { ...node.data, config:
|
|
147
|
+
upsertNodes: [{ ...node, data: { ...node.data, config: nextConfig } }],
|
|
139
148
|
});
|
|
140
149
|
}
|
|
141
150
|
async deleteNode(projectId, nodeId) {
|
package/package.json
CHANGED
|
@@ -50,9 +50,17 @@ description: Use when an agent needs to inspect or operate VVICAT infinite-canva
|
|
|
50
50
|
3. 实际查看图片/视频/音频预览;核对人物身份、场景、道具、动作顺序、构图、连续性,以及黑帧、拉伸、裁切、破音、空结果等明显缺陷。能从资产元数据取得的画幅和时长必须与配置交叉核对。
|
|
51
51
|
4. 输出简短审计结论,逐项列出通过项、缺陷、失败项和未决项。只读即可确认的问题直接补查;涉及再次付费生成、改选版本或覆盖用户内容时先展示问题并取得确认。自我审计不能替代用户选版和阶段确认。
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
## TTS 与声音克隆
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
语音交付使用 `audio`、`voice-clone` 和 `tts` 节点,并以服务端实时节点目录为准:
|
|
56
|
+
|
|
57
|
+
1. 先执行 `canvas settings get` 和 `canvas node types --json`,确认最终生效的 `audioModel`、`tts.configSchema`、`voice-clone.configSchema` 及端口。不要根据百炼网页文档猜测当前服务已支持的字段或音色。
|
|
58
|
+
2. `tts` 的文本通过 `text` 输入端口或 `config.text` 提供;音色通过 `tts.voice` 连线或 `config.voice` 提供。连线音色优先于手填值,并使任务采用该克隆产物记录的精确 CosyVoice 目标模型。执行前必须回读画布,确认文本、音色和最终 `audioModel` 一致。
|
|
59
|
+
3. `cosyvoice-v3.5-plus` 与 `cosyvoice-v3.5-flash` 只接受声音设计或声音克隆生成的同型号音色 ID,不接受 `longxiaochun`、`longxiaochun_v3` 等系统预置音色名,也不能混用其他 CosyVoice 型号的 ID。违反该约束会在供应商请求前返回 `COSYVOICE_TTS_CUSTOM_VOICE_REQUIRED:<model>`;不要通过反复更换预置音色重试。
|
|
60
|
+
4. 需要克隆时,先创建或绑定含已授权参考音频的 `audio` 节点,再创建 `voice-clone`,连接 `audio.audio → voice-clone.audio`。按实时 schema 确认 `prefix`、`targetModel`、`languageHints`、`maxPromptAudioLength` 和 `enablePreprocess`;`prefix` 只含字母和数字且不超过 10 位,参考音频截取范围为 3~30 秒。声音克隆会创建远端资源,任务不自动重试;失败时先检查输入,不得盲目重复执行。
|
|
61
|
+
5. 运行 `voice-clone` 后取得真实任务 ID 并执行 `task wait`。成功后刷新画布,确认产物包含非空音色 ID 和与 `targetModel` 对应的模型键,再连接 `voice-clone.voice → tts.voice`。不得预先猜测音色 ID,也不要把任务 ID、节点 ID 或预置音色名当作音色 ID。
|
|
62
|
+
6. CosyVoice `tts` 只写实时 schema 声明的 `languageHints`、`format`、`sampleRate`、`volume`、`cosyRate`、`pitch` 和 `instruction`。默认值通常为 WAV、24000 Hz、音量 50、语速 1、音调 1;最终仍以实时 schema 为准。`instruction` 只用于 schema 和有效模型共同允许的型号,最多 100 个计权字符,汉字按 2 个计算。非 CosyVoice 模型使用 `rate`,不得同时套用 CosyVoice 参数。
|
|
63
|
+
7. 运行 `tts` 后必须等待任务终态并刷新资产,实际试听音频,检查空音频、破音、语言、音色、语速、音调和时长。任务失败时先按错误码修正:`*_VOICE_ID_REQUIRED` 表示音色缺失,`COSYVOICE_TTS_CUSTOM_VOICE_REQUIRED:<model>` 表示 v3.5 音色来源或型号错误,`COSYVOICE_TTS_INSTRUCTION_TOO_LONG` 表示声音指令超限,`COSYVOICE_TTS_LANGUAGE_HINT_UNSUPPORTED:<language>` 表示语言提示不兼容;只有供应商临时错误才按任务的 `retryable` 判断是否重试。
|
|
56
64
|
|
|
57
65
|
Meme 推荐链路为 `text.text → meme-scene-analysis.story`,运行后把自动生成的计划资源连接到 `meme-material-search.plan`,再把素材包资源连接到 `cat-meme-video.materials`;原故事仍连接 `cat-meme-video.story`,计划资源可同时连接 `cat-meme-video.plan`。每一步完成后刷新画布,使用服务端自动创建的资源节点,不能伪造或重复创建资源。`cat-meme-video` 的 `config` 需按实时 schema 确认 `aspectRatio`(`1:1`、`9:16` 或 `16:9`)与 `resolution`(`720p` 或 `1080p`);它们是节点输出参数,不替代项目配置门禁。
|
|
58
66
|
|