接入测试

This commit is contained in:
zhishi 2026-03-15 19:39:23 +08:00
parent 6b85599c2e
commit c10323881c
14 changed files with 582 additions and 312 deletions

View File

@ -1,6 +1,6 @@
{
"name": "toonflow-app",
"version": "1.0.7-patch2",
"version": "1.0.7-patch3",
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
"author": "HBAI-Ltd <ltlctools@outlook.com>",
"homepage": "https://github.com/HBAI-Ltd/Toonflow-app#readme",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -591,54 +591,38 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
{ manufacturer: "deepSeek", model: "deepseek-chat", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "deepSeek", model: "deepseek-reasoner", responseFormat: "schema", image: 0, think: 1, tool: 1 },
{ manufacturer: "volcengine", model: "doubao-seed-2-0-pro-260215", responseFormat: "object", image: 1, think: 1, tool: 1 },
// { manufacturer: "volcengine", model: "doubao-seed-2-0-lite-260215", responseFormat: "object", image: 1, think: 1, tool: 1 },
// { manufacturer: "volcengine", model: "doubao-seed-2-0-mini-260215", responseFormat: "object", image: 1, think: 1, tool: 1 },
{ manufacturer: "volcengine", model: "doubao-seed-1-8-251228", responseFormat: "schema", image: 1, think: 1, tool: 1 },
// { manufacturer: "volcengine", model: "doubao-seed-1-6-251015", responseFormat: "schema", image: 1, think: 1, tool: 1 },
// { manufacturer: "volcengine", model: "doubao-seed-1-6-lite-251015", responseFormat: "schema", image: 1, think: 1, tool: 1 },
// { manufacturer: "volcengine", model: "doubao-seed-1-6-flash-250828", responseFormat: "schema", image: 1, think: 1, tool: 1 },
{ manufacturer: "zhipu", model: "glm-4.7", responseFormat: "object", image: 0, think: 0, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4.7-flashx", responseFormat: "object", image: 0, think: 0, tool: 1 },
{ manufacturer: "zhipu", model: "glm-4.6", responseFormat: "object", image: 0, think: 0, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4.5-air", responseFormat: "object", image: 0, think: 0, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4.5-airx", responseFormat: "object", image: 0, think: 0, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4-long", responseFormat: "object", image: 0, think: 0, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4-flashx-250414", responseFormat: "object", image: 0, think: 0, tool: 1 },
{ manufacturer: "zhipu", model: "glm-4.7-flash", responseFormat: "object", image: 0, think: 0, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4.5-flash", responseFormat: "object", image: 0, think: 1, tool: 1 },
// { manufacturer: "zhipu", model: "glm-4-flash-250414", responseFormat: "object", image: 0, think: 0, tool: 1 },
{ manufacturer: "zhipu", model: "glm-4.6v", responseFormat: "object", image: 1, think: 1, tool: 1 },
{ manufacturer: "qwen", model: "qwen-vl-max", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "qwen", model: "qwen-plus-latest", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "qwen", model: "qwen-max", responseFormat: "schema", image: 0, think: 0, tool: 1 },
// { manufacturer: "qwen", model: "qwen2.5-72b-instruct", responseFormat: "schema", image: 0, think: 0, tool: 1 },
// { manufacturer: "qwen", model: "qwen2.5-14b-instruct-1m", responseFormat: "schema", image: 0, think: 0, tool: 1 },
// { manufacturer: "qwen", model: "qwen2.5-vl-72b-instruct", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "openai", model: "gpt-4o", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "openai", model: "gpt-4o-mini", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "openai", model: "gpt-4.1", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "openai", model: "gpt-5.1", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "openai", model: "gpt-5.2", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "gemini", model: "gemini-3-pro-preview", responseFormat: "schema", image: 1, think: 1, tool: 1 },
{ manufacturer: "gemini", model: "gemini-2.5-pro", responseFormat: "schema", image: 1, think: 1, tool: 1 },
// { manufacturer: "gemini", model: "gemini-2.5-flash", responseFormat: "schema", image: 1, think: 1, tool: 1 },
// { manufacturer: "gemini", model: "gemini-2.0-flash", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "gemini", model: "gemini-2.0-flash-lite", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "gemini", model: "gemini-1.5-pro", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "gemini", model: "gemini-1.5-flash", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "anthropic", model: "claude-opus-4-5", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "anthropic", model: "claude-haiku-4-5", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "anthropic", model: "claude-sonnet-4-5", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "anthropic", model: "claude-opus-4-1", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "anthropic", model: "claude-opus-4-0", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "anthropic", model: "claude-sonnet-4-0", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "anthropic", model: "claude-3-7-sonnet-latest", responseFormat: "schema", image: 1, think: 0, tool: 1 },
// { manufacturer: "anthropic", model: "claude-3-5-haiku-latest", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "xai", model: "grok-3", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "xai", model: "grok-4", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "xai", model: "grok-4.1", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "other", model: "", responseFormat: "object", image: 1, think: 0, tool: 1 },
{ manufacturer: "modelScope", model: "deepseek-ai/DeepSeek-V3.2", responseFormat: "object", image: 0, think: 0, tool: 1 },
{ manufacturer: "formal", model: "gpt-4.1", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "formal", model: "doubao-seed-2-0-pro-260215", responseFormat: "object", image: 0, think: 0, tool: 1 },
{ manufacturer: "formal", model: "doubao-seed-1-8-251215", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "formal", model: "gpt-5.2", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "formal", model: "gpt-5.1", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "formal", model: "claude-sonnet-4-6", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "formal", model: "claude-sonnet-4-5-20250929", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "formal", model: "claude-opus-4-5-20251101", responseFormat: "schema", image: 0, think: 0, tool: 1 },
{ manufacturer: "formal", model: "qwen3.5-plus", responseFormat: "schema", image: 1, think: 0, tool: 1 },
{ manufacturer: "formal", model: "qwen3-max-2026-01-23", responseFormat: "schema", image: 1, think: 0, tool: 1 },
]);
},
},
@ -656,7 +640,6 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
await knex("t_imageModel").insert([
{ manufacturer: "volcengine", model: "doubao-seedream-5-0-260128", grid: 1, type: "ti2i" },
{ manufacturer: "volcengine", model: "doubao-seedream-4-5-251128", grid: 0, type: "ti2i" },
// { manufacturer: "volcengine", model: "doubao-seedream-4-0-250828", grid: 0, type: "ti2i" },
{ manufacturer: "kling", model: "kling-image-o1", grid: 0, type: "ti2i" },
{ manufacturer: "gemini", model: "gemini-2.5-flash-image", grid: 1, type: "ti2i" },
{ manufacturer: "gemini", model: "gemini-3-pro-image-preview", grid: 1, type: "ti2i" },
@ -668,7 +651,10 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
{ manufacturer: "grsai", model: "nano-banana-pro", grid: 1, type: "ti2i" },
{ manufacturer: "grsai", model: "nano-banana", grid: 1, type: "ti2i" },
{ manufacturer: "grsai", model: "nano-banana-2", grid: 1, type: "ti2i" },
{ manufacturer: "formal", model: "Qwen-Image", grid: 1, type: "ti2i" },
{ manufacturer: "formal", model: "Doubao-Seedream-5.0-Lite", grid: 1, type: "ti2i" },
{ manufacturer: "formal", model: "doubao-seedream-4-5-251128", grid: 1, type: "ti2i" },
{ manufacturer: "formal", model: "doubao-seedream-4-0-250828", grid: 1, type: "ti2i" },
]);
},
},
@ -718,6 +704,14 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
audio: 0,
type: JSON.stringify(["endFrameOptional", "reference"]),
},
{
manufacturer: "volcengine",
model: "doubao-seedance-2-0-260128",
durationResolutionMap: JSON.stringify([{ duration: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], resolution: ["720p", "480p"] }]),
aspectRatio: JSON.stringify(["16:9", "4:3", "1:1", "3:4", "9:16", "21:9"]),
audio: 1,
type: JSON.stringify(["endFrameOptional", "multiImage"]),
},
{
manufacturer: "volcengine",
model: "doubao-seedance-1-0-lite-t2v-250428",
@ -800,22 +794,6 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired", "text"]),
},
{
manufacturer: "vidu",
model: "viduq1",
durationResolutionMap: JSON.stringify([{ duration: [5], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired", "text"]),
},
{
manufacturer: "vidu",
model: "viduq1-classic",
durationResolutionMap: JSON.stringify([{ duration: [5], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "startEndRequired"]),
},
{
manufacturer: "vidu",
model: "vidu2.0",
@ -907,22 +885,6 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
audio: 0,
type: JSON.stringify(["singleImage"]),
},
{
manufacturer: "wan",
model: "wanx2.1-i2v-plus",
durationResolutionMap: JSON.stringify([{ duration: [5], resolution: ["720p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage"]),
},
{
manufacturer: "wan",
model: "wanx2.1-i2v-turbo",
durationResolutionMap: JSON.stringify([{ duration: [3, 4, 5], resolution: ["480p", "720p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage"]),
},
{
manufacturer: "wan",
model: "wan2.2-kf2v-flash",
@ -931,14 +893,6 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
audio: 0,
type: JSON.stringify(["startEndRequired"]),
},
{
manufacturer: "wan",
model: "wanx2.1-kf2v-plus",
durationResolutionMap: JSON.stringify([{ duration: [5], resolution: ["720p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["startEndRequired"]),
},
{
manufacturer: "gemini",
model: "veo-3.1-generate-preview",
@ -1067,46 +1021,28 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
{
manufacturer: "formal",
model: "Seedance-1.5-Pro",
model: "Seedance-1.5-Pro-audio",
durationResolutionMap: JSON.stringify([{ duration: [4, 5, 6, 7, 8, 9, 10, 11, 12], resolution: ["480p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 1,
type: JSON.stringify(["endFrameOptional", "text"]),
audio: 0,
type: JSON.stringify(["endFrameOptional"]),
},
{
manufacturer: "formal",
model: "Seedance-1.5-Pro-NotAudio",
durationResolutionMap: JSON.stringify([{ duration: [4, 5, 6, 7, 8, 9, 10, 11, 12], resolution: ["480p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 0,
type: JSON.stringify(["endFrameOptional"]),
},
{
manufacturer: "formal",
model: "Seedance-1.0-Pro",
durationResolutionMap: JSON.stringify([{ duration: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], resolution: ["480p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 0,
type: JSON.stringify(["text", "endFrameOptional"]),
type: JSON.stringify(["endFrameOptional"]),
},
{
manufacturer: "formal",
model: "Seedance-1.0-Pro-Fast",
durationResolutionMap: JSON.stringify([{ duration: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], resolution: ["480p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 0,
type: JSON.stringify(["text", "singleImage"]),
},
{
manufacturer: "formal",
model: "Seedance-1.0-Lite-I2V",
durationResolutionMap: JSON.stringify([{ duration: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], resolution: ["480p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["endFrameOptional", "reference"]),
},
{
manufacturer: "formal",
model: "Seedance-1.0-Lite-T2V",
durationResolutionMap: JSON.stringify([{ duration: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], resolution: ["480p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 0,
type: JSON.stringify(["text"]),
},
{
manufacturer: "formal",
model: "ViduQ3-turbo",
@ -1115,7 +1051,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
]),
aspectRatio: JSON.stringify(["16:9", "9:16", "3:4", "4:3", "1:1"]),
audio: 1,
type: JSON.stringify(["text", "singleImage"]),
type: JSON.stringify(["singleImage"]),
},
{
manufacturer: "formal",
@ -1125,7 +1061,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
]),
aspectRatio: JSON.stringify(["16:9", "9:16", "3:4", "4:3", "1:1"]),
audio: 1,
type: JSON.stringify(["text", "singleImage"]),
type: JSON.stringify(["singleImage"]),
},
{
manufacturer: "formal",
@ -1141,7 +1077,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
durationResolutionMap: JSON.stringify([{ duration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], resolution: ["540p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired", "text"]),
type: JSON.stringify(["singleImage", "reference", "startEndRequired"]),
},
{
manufacturer: "formal",
@ -1149,7 +1085,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
durationResolutionMap: JSON.stringify([{ duration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], resolution: ["540p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired", "text"]),
type: JSON.stringify(["singleImage", "reference", "startEndRequired"]),
},
{
manufacturer: "formal",
@ -1157,59 +1093,32 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
durationResolutionMap: JSON.stringify([{ duration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], resolution: ["540p", "720p", "1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired", "text"]),
},
{
manufacturer: "formal",
model: "ViduQ1",
durationResolutionMap: JSON.stringify([{ duration: [5], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired", "text"]),
},
{
manufacturer: "formal",
model: "ViduQ1-classic",
durationResolutionMap: JSON.stringify([{ duration: [5], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "startEndRequired"]),
},
{
manufacturer: "formal",
model: "Vidu2.0",
durationResolutionMap: JSON.stringify([
{ duration: [4], resolution: ["360p", "720p", "1080p"] },
{ duration: [8], resolution: ["720p"] },
]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["singleImage", "reference", "startEndRequired"]),
type: JSON.stringify(["singleImage", "reference"]),
},
{
manufacturer: "formal",
model: "Hailuo-2.3-I2V",
durationResolutionMap: JSON.stringify([{ duration: [6, 7, 8, 9, 10], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
model: "Sora-2-I2V",
durationResolutionMap: JSON.stringify([{ duration: [4, 8, 12], resolution: [] }]),
aspectRatio: JSON.stringify([]),
audio: 0,
type: JSON.stringify(["endFrameOptional"]),
type: JSON.stringify(["singleImage", "reference"]),
},
{
manufacturer: "formal",
model: "Hailuo-2.3-Fast",
durationResolutionMap: JSON.stringify([{ duration: [6, 7, 8, 9, 10], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 0,
type: JSON.stringify(["endFrameOptional"]),
model: "Wan2.6-I2V-720P",
durationResolutionMap: JSON.stringify([{ duration: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], resolution: ["720p"] }]),
aspectRatio: JSON.stringify([]),
audio: 1,
type: JSON.stringify(["singleImage"]),
},
{
manufacturer: "formal",
model: "Hailuo-2.3-T2V",
durationResolutionMap: JSON.stringify([{ duration: [6, 7, 8, 9, 10], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify(["16:9", "9:16"]),
audio: 0,
type: JSON.stringify(["text"]),
model: "Wan2.6-I2V-720P-1080P",
durationResolutionMap: JSON.stringify([{ duration: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], resolution: ["1080p"] }]),
aspectRatio: JSON.stringify([]),
audio: 1,
type: JSON.stringify(["singleImage"]),
},
]);
},

View File

@ -1,6 +1,192 @@
// @db-hash a7e02eb0ccc2f0608c1cafc9191f3291
// @db-hash f991a54893850ab9ff4a67665391191d
//该文件由脚本自动生成,请勿手动修改
export interface memories {
'access_count'?: number;
'content': string;
'created_at': number;
'embedding': string;
'id'?: string;
'type': string;
}
export interface o_agentDeploy {
'id'?: number;
'name'?: string | null;
'startTime'?: number | null;
}
export interface o_artStyle {
'id'?: number;
'name'?: string | null;
'styles'?: string | null;
}
export interface o_assets {
'id'?: number;
'name'?: string | null;
'startTime'?: number | null;
}
export interface o_chatHistory {
'data'?: string | null;
'id'?: number;
'novel'?: string | null;
'projectId'?: number | null;
'type'?: string | null;
}
export interface o_event {
'createTime'?: number | null;
'detail'?: string | null;
'id'?: number;
'name'?: string | null;
}
export interface o_eventChapter {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_image {
'assetsId'?: number | null;
'filePath'?: string | null;
'id'?: number;
'projectId'?: number | null;
'scriptId'?: number | null;
'state'?: string | null;
'type'?: string | null;
'videoId'?: number | null;
}
export interface o_model {
'id'?: number;
'name'?: string | null;
'startTime'?: number | null;
}
export interface o_myTasks {
'describe'?: string | null;
'id'?: number;
'model'?: string | null;
'projectId'?: number | null;
'reason'?: string | null;
'relatedObjects'?: string | null;
'startTime'?: number | null;
'state'?: string | null;
'taskClass'?: string | null;
}
export interface o_novel {
'chapter'?: string | null;
'chapterData'?: string | null;
'chapterIndex'?: number | null;
'createTime'?: number | null;
'id'?: number;
'projectId'?: number | null;
'reel'?: string | null;
}
export interface o_outline {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_outlineNovel {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_project {
'artStyle'?: string | null;
'createTime'?: number | null;
'id'?: number | null;
'intro'?: string | null;
'name'?: string | null;
'projectType'?: string | null;
'type'?: string | null;
'userId'?: number | null;
'videoRatio'?: string | null;
}
export interface o_prompts {
'code'?: string | null;
'customValue'?: string | null;
'defaultValue'?: string | null;
'id'?: number;
'name'?: string | null;
'parentCode'?: string | null;
'type'?: string | null;
}
export interface o_script {
'content'?: string | null;
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
'projectId'?: number | null;
}
export interface o_scriptAssets {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_scriptOutline {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_setting {
'id'?: number;
'imageModel'?: string | null;
'languageModel'?: string | null;
'projectId'?: number | null;
'tokenKey'?: string | null;
'userId'?: number | null;
}
export interface o_skills {
'id'?: number;
'name'?: string | null;
'startTime'?: number | null;
}
export interface o_storyboard {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_storyboardScript {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_user {
'id'?: number;
'name'?: string | null;
'password'?: string | null;
'tokenKey'?: string | null;
}
export interface o_vendorConfig {
'code'?: string | null;
'createTime'?: number | null;
'icon'?: string | null;
'id'?: number;
'inputs'?: string | null;
'inputValues'?: string | null;
'models'?: string | null;
'name'?: string | null;
'version'?: string | null;
}
export interface o_video {
'createTime'?: number | null;
'id'?: number;
'name'?: string | null;
}
export interface o_videoConfig {
'aiConfigId'?: number | null;
'audioEnabled'?: number | null;
'createTime'?: number | null;
'duration'?: number | null;
'endFrame'?: string | null;
'id'?: number;
'images'?: string | null;
'manufacturer'?: string | null;
'mode'?: string | null;
'projectId'?: number | null;
'prompt'?: string | null;
'resolution'?: string | null;
'scriptId'?: number | null;
'selectedResultId'?: number | null;
'startFrame'?: string | null;
'updateTime'?: number | null;
}
export interface t_aiModelMap {
'configId'?: number | null;
'id'?: number;
@ -178,6 +364,32 @@ export interface t_videoModel {
}
export interface DB {
"memories": memories;
"o_agentDeploy": o_agentDeploy;
"o_artStyle": o_artStyle;
"o_assets": o_assets;
"o_chatHistory": o_chatHistory;
"o_event": o_event;
"o_eventChapter": o_eventChapter;
"o_image": o_image;
"o_model": o_model;
"o_myTasks": o_myTasks;
"o_novel": o_novel;
"o_outline": o_outline;
"o_outlineNovel": o_outlineNovel;
"o_project": o_project;
"o_prompts": o_prompts;
"o_script": o_script;
"o_scriptAssets": o_scriptAssets;
"o_scriptOutline": o_scriptOutline;
"o_setting": o_setting;
"o_skills": o_skills;
"o_storyboard": o_storyboard;
"o_storyboardScript": o_storyboardScript;
"o_user": o_user;
"o_vendorConfig": o_vendorConfig;
"o_video": o_video;
"o_videoConfig": o_videoConfig;
"t_aiModelMap": t_aiModelMap;
"t_artStyle": t_artStyle;
"t_assets": t_assets;

View File

@ -17,7 +17,7 @@ export default async (input: ImageConfig, config: AIConfig): Promise<string> =>
if (!config.model) throw new Error("缺少Model名称");
if (!config.apiKey) throw new Error("缺少API Key");
const { requestUrl, queryUrl = null } = modelFn["volcengine"].buildReqUrl("http://192.168.0.74:33332");
const { requestUrl, queryUrl = null } = modelFn["volcengine"].buildReqUrl(config.baseURL || "https://api.toonflow.net");
const taskBody = modelFn["volcengine"].buildReqBody(input, config);
const apiKey = config.apiKey.replace("Bearer ", "");

View File

@ -6,12 +6,15 @@ export function buildReqBody(input: VideoConfig, config: AIConfig) {
...(input.imageBase64 && input.imageBase64.length ? { images: input.imageBase64 } : {}),
prompt: input.prompt,
duration: input.duration,
resolution: input.resolution,
audio: input?.audio ?? false,
aspect_ratio: input.aspectRatio,
off_peak: false,
size: input.resolution,
metadata: {
aspect_ratio: input.aspectRatio,
audio: input?.audio ?? false,
off_peak: false,
},
};
console.log("%c Line:5 🍔 requestBody", "background:#465975", requestBody);
return requestBody;
}

View File

@ -34,6 +34,7 @@ export function buildReqBody(input: VideoConfig, config: AIConfig) {
size: input.resolution,
metadata: {
generate_audio: input?.audio ?? false,
ratio: input.aspectRatio,
image_roles: ["first_frame", "last_frame"],
},
};

View File

@ -26,26 +26,25 @@ export function buildReqBody(input: VideoConfig, config: AIConfig) {
},
};
const hasStartEnd = input.mode == "startEnd";
console.log("%c Line:29 🎂 hasStartEnd", "background:#2eafb0", hasStartEnd);
const imageReq: Record<string, string> = {};
if (hasStartEnd && Array.isArray(images) && images.length) {
if (images[0]) imageReq.img_url = images[0];
if (images[0]) imageReq.first_frame_url = images[0];
if (images[1]) imageReq.last_frame_url = images[1];
} else if (!hasStartEnd && Array.isArray(images) && images[0]) {
console.log("%c Line:35 🍤", "background:#f5ce50");
imageReq.img_url = images[0];
}
const resolutionKey = input.resolution.toLowerCase();
console.log("%c Line:43 🍑 resolutionKey", "background:#e41a6a", resolutionKey);
const resolutionKey = input.resolution;
const size = sizeMap[resolutionKey]?.[input.aspectRatio];
const requestBody: any = {
model: config.model,
...(imageReq?.img_url ? { input_reference: imageReq.img_url } : {}),
prompt: input.prompt,
size,
duration: input.duration,
size: !images.length ? size : input.resolution.toUpperCase(),
metadata: {
...imageReq,
audio: input?.audio ?? false,

View File

@ -82,7 +82,7 @@ export default async (input: VideoConfig, config: AIConfig): Promise<string> =>
// 根据模型名称获取对应的适配器
const modelAdapter = getModelAdapter(config.model);
const { requestUrl, queryUrl, downLoadUrl = null } = modelAdapter.buildReqUrl("http://192.168.0.74:33332");
const { requestUrl, queryUrl, downLoadUrl = null } = modelAdapter.buildReqUrl(config.baseURL || "https://api.toonflow.net");
const taskBody = await modelAdapter.buildReqBody(input, config);
const apiKey = config.apiKey.replace("Bearer ", "");
@ -98,7 +98,7 @@ export default async (input: VideoConfig, config: AIConfig): Promise<string> =>
const { data: queryData } = await axios.get(template({ id: taskId }, queryUrl), {
headers: { Authorization: `Bearer ${apiKey}` },
});
console.log("%c Line:99 🥝 queryData", "background:#e41a6a", queryData);
console.log("%c Line:99 🥝 queryData", "background:#e41a6a", queryData);
// const { status, result_url, fail_reason } = queryData.data || {};

View File

@ -71,29 +71,15 @@ export default async (input: VideoConfig, config: AIConfig) => {
const requestBody: any = {
model: config.model,
images: [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg",
],
prompt:
"The camera zooms in on the bird, which then flies to the right. With its flight being smooth and natural, the bird soars in the sky. with a red light effect following and surrounding it from behind.",
duration: 5,
seed: 0,
resolution: "1080p",
audio: true,
off_peak: false,
prompt: input.prompt,
aspect_ratio: input.aspectRatio || "16:9",
size: "720p",
};
if (input.imageBase64 && input.imageBase64.length) {
requestBody.images = [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg",
];
requestBody.images = input.imageBase64;
}
console.log("%c Line:86 🍷 requestUrl", "background:#4fff4B", requestUrl);
console.log("%c Line:89 🥪 authorization", "background:#3f7cff", authorization);
const response = await axios.post(requestUrl, JSON.stringify(requestBody), {
headers: {
Authorization: authorization,
@ -102,7 +88,6 @@ export default async (input: VideoConfig, config: AIConfig) => {
});
taskId = response.data.id;
resData = response.data;
console.log("%c Line:91 🍎 resData", "background:#ed9ec7", resData);
}
console.log("%c Line:87 🥒 taskId", "background:#f5ce50", taskId);
@ -110,7 +95,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
return await pollTask(async () => {
// 构建查询URL两个地址模式时使用URL参数
const finalQueryUrl = isThreeUrlMode ? template({ id: taskId }, queryUrl) : template({ id: taskId }, queryUrl);
const finalQueryUrl = isThreeUrlMode ? template({ id: taskId }, queryUrl) : `${queryUrl}?id=${taskId}`;
const { data: queryData } = await axios.get(finalQueryUrl, {
headers: { Authorization: authorization },
@ -126,8 +111,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
for (let i = 0; i < retries; i++) {
try {
// 构建下载URL
const finalDownloadUrl =
isThreeUrlMode && downLoadUrl ? template({ id: taskId }, downLoadUrl) : queryData.video_url || queryData.url || queryData.metadata.url; // 从响应中获取视频URL
const finalDownloadUrl = isThreeUrlMode && downLoadUrl ? template({ id: taskId }, downLoadUrl) : queryData.video_url || queryData.url; // 从响应中获取视频URL
videoRes = await axios.get(finalDownloadUrl, {
headers: isThreeUrlMode ? { Authorization: authorization } : {},

View File

@ -71,15 +71,29 @@ export default async (input: VideoConfig, config: AIConfig) => {
const requestBody: any = {
model: config.model,
prompt: input.prompt,
aspect_ratio: input.aspectRatio || "16:9",
size: "720p",
images: [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg",
],
prompt:
"The camera zooms in on the bird, which then flies to the right. With its flight being smooth and natural, the bird soars in the sky. with a red light effect following and surrounding it from behind.",
duration: 5,
seed: 0,
resolution: "1080p",
audio: true,
off_peak: false,
};
if (input.imageBase64 && input.imageBase64.length) {
requestBody.images = input.imageBase64;
requestBody.images = [
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-1.jpeg",
"https://prod-ss-images.s3.cn-northwest-1.amazonaws.com.cn/vidu-maas/template/startend2video-2.jpeg",
];
}
console.log("%c Line:86 🍷 requestUrl", "background:#4fff4B", requestUrl);
console.log("%c Line:89 🥪 authorization", "background:#3f7cff", authorization);
const response = await axios.post(requestUrl, JSON.stringify(requestBody), {
headers: {
Authorization: authorization,
@ -88,6 +102,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
});
taskId = response.data.id;
resData = response.data;
console.log("%c Line:91 🍎 resData", "background:#ed9ec7", resData);
}
console.log("%c Line:87 🥒 taskId", "background:#f5ce50", taskId);
@ -95,7 +110,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
return await pollTask(async () => {
// 构建查询URL两个地址模式时使用URL参数
const finalQueryUrl = isThreeUrlMode ? template({ id: taskId }, queryUrl) : `${queryUrl}?id=${taskId}`;
const finalQueryUrl = isThreeUrlMode ? template({ id: taskId }, queryUrl) : template({ id: taskId }, queryUrl);
const { data: queryData } = await axios.get(finalQueryUrl, {
headers: { Authorization: authorization },
@ -111,7 +126,8 @@ export default async (input: VideoConfig, config: AIConfig) => {
for (let i = 0; i < retries; i++) {
try {
// 构建下载URL
const finalDownloadUrl = isThreeUrlMode && downLoadUrl ? template({ id: taskId }, downLoadUrl) : queryData.video_url || queryData.url; // 从响应中获取视频URL
const finalDownloadUrl =
isThreeUrlMode && downLoadUrl ? template({ id: taskId }, downLoadUrl) : queryData.video_url || queryData.url || queryData.metadata.url; // 从响应中获取视频URL
videoRes = await axios.get(finalDownloadUrl, {
headers: isThreeUrlMode ? { Authorization: authorization } : {},

View File

@ -1 +0,0 @@
resizedBuffer

View File

@ -21,6 +21,8 @@ export default async (input: VideoConfig, config: AIConfig) => {
};
if (isStartEndMode) {
item.role = index === 0 ? "first_frame" : "last_frame";
} else {
item.role = "reference_image";
}
return item;
});
@ -35,7 +37,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
};
// 仅当模型支持音频时才添加 generate_audio 字段
if (input?.audio) {
if (typeof input?.audio == "boolean") {
requestBody.generate_audio = input.audio ?? false;
}
@ -46,7 +48,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
Authorization: authorization,
},
});
console.log("%c Line:44 🍡 createResponse", "background:#2eafb0", createResponse);
console.log("%c Line:44 🍡 createResponse", "background:#2eafb0", createResponse.data);
const taskId = createResponse.data.id;
@ -54,7 +56,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
// 轮询任务状态
return await pollTask(async () => {
const data = await axios.get(`${baseUrl}/query/${taskId}`, {
const data = await axios.get(`${baseUrl}/${taskId}`, {
headers: { Authorization: authorization },
});
console.log("%c Line:62 🥕 data.data", "background:#e41a6a", data.data);