no message
This commit is contained in:
parent
5d92896eb4
commit
eb8eb94b57
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "toonflow-app",
|
"name": "toonflow-app",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6-dev",
|
||||||
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
|
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
|
||||||
"author": "HBAI-Ltd <ltlctools@outlook.com>",
|
"author": "HBAI-Ltd <ltlctools@outlook.com>",
|
||||||
"homepage": "https://github.com/HBAI-Ltd/Toonflow-app#readme",
|
"homepage": "https://github.com/HBAI-Ltd/Toonflow-app#readme",
|
||||||
@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nodemon --inspect --exec tsx src/app.ts",
|
"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",
|
"lint": "tsc --noEmit",
|
||||||
"build": "tsx scripts/build.ts",
|
"build": "tsx scripts/build.ts",
|
||||||
"pack": "electron-builder --dir",
|
"pack": "electron-builder --dir",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -700,7 +700,6 @@ ${task}
|
|||||||
const envContext = await this.buildEnvironmentContext();
|
const envContext = await this.buildEnvironmentContext();
|
||||||
|
|
||||||
const prompts = await u.db("t_prompts").where("code", "outlineScript-main").first();
|
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 promptConfig = await u.getPromptAi("outlineScriptAgent");
|
||||||
|
|
||||||
const mainPrompts = prompts?.customValue || prompts?.defaultValue || "不论用户说什么,请直接输出Agent配置异常";
|
const mainPrompts = prompts?.customValue || prompts?.defaultValue || "不论用户说什么,请直接输出Agent配置异常";
|
||||||
|
|||||||
@ -36,18 +36,6 @@ interface ResourceItem {
|
|||||||
intro: string;
|
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> {
|
async function compressImage(buffer: Buffer, maxSizeBytes: number = 3 * 1024 * 1024): Promise<Buffer> {
|
||||||
if (buffer.length <= maxSizeBytes) {
|
if (buffer.length <= maxSizeBytes) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -212,7 +212,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
|||||||
table.integer("id").notNullable();
|
table.integer("id").notNullable();
|
||||||
table.integer("scriptId"); // 关联的脚本ID
|
table.integer("scriptId"); // 关联的脚本ID
|
||||||
table.integer("projectId"); // 关联的项目ID
|
table.integer("projectId"); // 关联的项目ID
|
||||||
table.integer("aiConfigId");//ai配置ID
|
table.integer("aiConfigId"); //ai配置ID
|
||||||
table.text("manufacturer"); // 厂商:volcengine/runninghub/openAi
|
table.text("manufacturer"); // 厂商:volcengine/runninghub/openAi
|
||||||
table.text("mode"); // 模式:startEnd/multi/single
|
table.text("mode"); // 模式:startEnd/multi/single
|
||||||
table.text("startFrame"); // 首帧图片信息 JSON
|
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) {
|
for (const t of tables) {
|
||||||
|
|||||||
@ -4,9 +4,6 @@ import * as zod from "zod";
|
|||||||
import { error, success } from "@/lib/responseFormat";
|
import { error, success } from "@/lib/responseFormat";
|
||||||
import { validateFields } from "@/middleware/middleware";
|
import { validateFields } from "@/middleware/middleware";
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
const jsonSchema = zod.object({
|
|
||||||
prompt: zod.string().describe("提示词"),
|
|
||||||
});
|
|
||||||
interface OutlineItem {
|
interface OutlineItem {
|
||||||
description: string;
|
description: string;
|
||||||
name: string;
|
name: string;
|
||||||
@ -206,26 +203,6 @@ export default router.post(
|
|||||||
},
|
},
|
||||||
apiConfigData,
|
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;
|
return result.prompt;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -3,17 +3,10 @@ import u from "@/utils";
|
|||||||
import { error, success } from "@/lib/responseFormat";
|
import { error, success } from "@/lib/responseFormat";
|
||||||
import { validateFields } from "@/middleware/middleware";
|
import { validateFields } from "@/middleware/middleware";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import path from "path";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
const cellsResultSchema = z.object({
|
|
||||||
time: z.number().describe("时长,镜头时长 1-15"),
|
|
||||||
content: z.string().describe("提示词内容"),
|
|
||||||
name: z.string().describe("分镜名称"),
|
|
||||||
});
|
|
||||||
|
|
||||||
const prompt = `
|
const prompt = `
|
||||||
你是一名资深动画导演,擅长将静态分镜转化为简洁、专业、详尽的 Motion Prompt(视频生成动作提示)。你理解镜头语言、情绪节奏,能补充丰富但不重复静态元素,只突出变化与动态。
|
你是一名资深动画导演,擅长将静态分镜转化为简洁、专业、详尽的 Motion Prompt(视频生成动作提示)。你理解镜头语言、情绪节奏,能补充丰富但不重复静态元素,只突出变化与动态。
|
||||||
|
|
||||||
|
|||||||
3
src/types/database.d.ts
vendored
3
src/types/database.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
// @db-hash 4cd44aef6bb6ffb02c4619525966496d
|
// @db-hash c6deb23c67bf5d27c997e299cd878da1
|
||||||
//该文件由脚本自动生成,请勿手动修改
|
//该文件由脚本自动生成,请勿手动修改
|
||||||
|
|
||||||
export interface t_aiModelMap {
|
export interface t_aiModelMap {
|
||||||
@ -123,6 +123,7 @@ export interface t_user {
|
|||||||
'password'?: string | null;
|
'password'?: string | null;
|
||||||
}
|
}
|
||||||
export interface t_video {
|
export interface t_video {
|
||||||
|
'aiConfigId'?: number | null;
|
||||||
'configId'?: number | null;
|
'configId'?: number | null;
|
||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
'firstFrame'?: string | null;
|
'firstFrame'?: string | null;
|
||||||
|
|||||||
@ -22,7 +22,6 @@ const modelInstance = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export default async (input: VideoConfig, config?: AIConfig) => {
|
export default async (input: VideoConfig, config?: AIConfig) => {
|
||||||
console.log("%c Line:25 🥛 config", "background:#2eafb0", config);
|
|
||||||
const { model, apiKey, baseURL, manufacturer } = { ...config };
|
const { model, apiKey, baseURL, manufacturer } = { ...config };
|
||||||
if (!config || !config?.model || !config?.apiKey) throw new Error("请检查模型配置是否正确");
|
if (!config || !config?.model || !config?.apiKey) throw new Error("请检查模型配置是否正确");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user