Merge branch 'develop' of https://github.com/HBAI-Ltd/Toonflow-app into develop
# Conflicts: # src/types/database.d.ts
This commit is contained in:
commit
2218379217
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6-dev",
|
||||
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
|
||||
"author": "HBAI-Ltd <ltlctools@outlook.com>",
|
||||
"homepage": "https://github.com/HBAI-Ltd/Toonflow-app#readme",
|
||||
@ -19,7 +19,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nodemon --inspect --exec tsx src/app.ts",
|
||||
"dev:win": "chcp 65001 && electronmon -r tsx scripts/main.ts",
|
||||
"dev:gui": "chcp 65001 && electronmon -r tsx scripts/main.ts",
|
||||
"lint": "tsc --noEmit",
|
||||
"build": "tsx scripts/build.ts",
|
||||
"pack": "electron-builder --dir",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -36,18 +36,6 @@ interface ResourceItem {
|
||||
intro: string;
|
||||
}
|
||||
|
||||
// 资产过滤响应的 schema
|
||||
const filteredAssetsSchema = z.object({
|
||||
relevantAssets: z
|
||||
.array(
|
||||
z.object({
|
||||
name: z.string().describe("资产名称"),
|
||||
reason: z.string().describe("选择该资产的原因"),
|
||||
}),
|
||||
)
|
||||
.describe("与分镜内容相关的资产列表"),
|
||||
});
|
||||
|
||||
// 压缩图片直到不超过指定大小
|
||||
async function compressImage(buffer: Buffer, maxSizeBytes: number = 3 * 1024 * 1024): Promise<Buffer> {
|
||||
if (buffer.length <= maxSizeBytes) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -521,6 +521,28 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
||||
]);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "t_aiModelMap",
|
||||
builder: (table) => {
|
||||
table.integer("id").notNullable();
|
||||
table.integer("configId");
|
||||
table.text("name");
|
||||
table.text("key");
|
||||
table.primary(["id"]);
|
||||
},
|
||||
initData: async (knex) => {
|
||||
await knex("t_aiModelMap").insert([
|
||||
{ id: 1, configId: 3, name: "分镜Agent", key: "storyboardAgent" },
|
||||
{ id: 2, configId: 2, name: "大纲故事线Agent", key: "outlineScriptAgent" },
|
||||
{ id: 3, configId: 4, name: "资产提示词润色", key: "assetsPrompt" },
|
||||
{ id: 4, configId: 5, name: "资产图片生成", key: "assetsImage" },
|
||||
{ id: 5, configId: 3, name: "剧本生成", key: "generateScript" },
|
||||
{ id: 6, configId: 2, name: "视频提示词生成", key: "videoPrompt" },
|
||||
{ id: 7, configId: 5, name: "分镜图片生成", key: "storyboardImage" },
|
||||
{ id: 8, configId: 5, name: "图片编辑", key: "editImage" },
|
||||
]);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
for (const t of tables) {
|
||||
|
||||
@ -4,9 +4,6 @@ import * as zod from "zod";
|
||||
import { error, success } from "@/lib/responseFormat";
|
||||
import { validateFields } from "@/middleware/middleware";
|
||||
const router = express.Router();
|
||||
const jsonSchema = zod.object({
|
||||
prompt: zod.string().describe("提示词"),
|
||||
});
|
||||
interface OutlineItem {
|
||||
description: string;
|
||||
name: string;
|
||||
@ -206,26 +203,6 @@ export default router.post(
|
||||
},
|
||||
apiConfigData,
|
||||
);
|
||||
// const result = await model.invoke({
|
||||
// messages: [
|
||||
// {
|
||||
// role: "system",
|
||||
// content: systemPrompt,
|
||||
// },
|
||||
// {
|
||||
// role: "user",
|
||||
// content: userPrompt,
|
||||
// },
|
||||
// ],
|
||||
// responseFormat: {
|
||||
// type: "json_schema",
|
||||
// jsonSchema: {
|
||||
// name: "json",
|
||||
// strict: true,
|
||||
// schema: zod.toJSONSchema(jsonSchema),
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
return result.prompt;
|
||||
}
|
||||
try {
|
||||
|
||||
@ -3,17 +3,10 @@ import u from "@/utils";
|
||||
import { error, success } from "@/lib/responseFormat";
|
||||
import { validateFields } from "@/middleware/middleware";
|
||||
import { z } from "zod";
|
||||
import path from "path";
|
||||
import axios from "axios";
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
const cellsResultSchema = z.object({
|
||||
time: z.number().describe("时长,镜头时长 1-15"),
|
||||
content: z.string().describe("提示词内容"),
|
||||
name: z.string().describe("分镜名称"),
|
||||
});
|
||||
|
||||
const prompt = `
|
||||
你是一名资深动画导演,擅长将静态分镜转化为简洁、专业、详尽的 Motion Prompt(视频生成动作提示)。你理解镜头语言、情绪节奏,能补充丰富但不重复静态元素,只突出变化与动态。
|
||||
|
||||
|
||||
41
src/types/database.d.ts
vendored
41
src/types/database.d.ts
vendored
@ -1,41 +1,6 @@
|
||||
// @db-hash dd6b6f00da61c815a0ea45cc51644370
|
||||
// @db-hash c6deb23c67bf5d27c997e299cd878da1
|
||||
//该文件由脚本自动生成,请勿手动修改
|
||||
|
||||
export interface _t_videoConfig_old_20260209 {
|
||||
'aiConfigId'?: 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_videoConfig_old_20260209_1 {
|
||||
'aiConfigId'?: number | null;
|
||||
'audio'?: 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;
|
||||
@ -158,6 +123,7 @@ export interface t_user {
|
||||
'password'?: string | null;
|
||||
}
|
||||
export interface t_video {
|
||||
'aiConfigId'?: number | null;
|
||||
'configId'?: number | null;
|
||||
'filePath'?: string | null;
|
||||
'firstFrame'?: string | null;
|
||||
@ -172,7 +138,6 @@ export interface t_video {
|
||||
}
|
||||
export interface t_videoConfig {
|
||||
'aiConfigId'?: number | null;
|
||||
'audioEnabled'?: number | null;
|
||||
'createTime'?: number | null;
|
||||
'duration'?: number | null;
|
||||
'endFrame'?: string | null;
|
||||
@ -190,8 +155,6 @@ export interface t_videoConfig {
|
||||
}
|
||||
|
||||
export interface DB {
|
||||
"_t_videoConfig_old_20260209": _t_videoConfig_old_20260209;
|
||||
"_t_videoConfig_old_20260209_1": _t_videoConfig_old_20260209_1;
|
||||
"t_aiModelMap": t_aiModelMap;
|
||||
"t_assets": t_assets;
|
||||
"t_chatHistory": t_chatHistory;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user