no message

This commit is contained in:
ACT丶流星雨 2026-02-09 16:41:13 +08:00
parent 5d92896eb4
commit eb8eb94b57
10 changed files with 1767 additions and 414 deletions

View File

@ -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

View File

@ -700,7 +700,6 @@ ${task}
const envContext = await this.buildEnvironmentContext();
const prompts = await u.db("t_prompts").where("code", "outlineScript-main").first();
console.log("%c Line:703 🍭 prompts", "background:#f5ce50", prompts);
const promptConfig = await u.getPromptAi("outlineScriptAgent");
const mainPrompts = prompts?.customValue || prompts?.defaultValue || "不论用户说什么请直接输出Agent配置异常";

View File

@ -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

View File

@ -212,7 +212,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.integer("id").notNullable();
table.integer("scriptId"); // 关联的脚本ID
table.integer("projectId"); // 关联的项目ID
table.integer("aiConfigId");//ai配置ID
table.integer("aiConfigId"); //ai配置ID
table.text("manufacturer"); // 厂商volcengine/runninghub/openAi
table.text("mode"); // 模式startEnd/multi/single
table.text("startFrame"); // 首帧图片信息 JSON
@ -522,6 +522,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) {

View File

@ -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 {

View File

@ -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

View File

@ -1,4 +1,4 @@
// @db-hash 4cd44aef6bb6ffb02c4619525966496d
// @db-hash c6deb23c67bf5d27c997e299cd878da1
//该文件由脚本自动生成,请勿手动修改
export interface t_aiModelMap {
@ -123,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;

View File

@ -22,7 +22,6 @@ const modelInstance = {
} as const;
export default async (input: VideoConfig, config?: AIConfig) => {
console.log("%c Line:25 🥛 config", "background:#2eafb0", config);
const { model, apiKey, baseURL, manufacturer } = { ...config };
if (!config || !config?.model || !config?.apiKey) throw new Error("请检查模型配置是否正确");