+
+

+
+# Toonflow
+
+
+
+ AI Short Drama Factory
+
+ Turn novels into episodes with just a tap!
+
+ AI Script × AI Visuals × Rapid Generation 🔥
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ > 🚀 **One-stop Short Drama Production**: From text to characters, from storyboards to videos, zero-barrier full-process AI automation, boosting creative efficiency by 10x+!
+
+
+---
+
+# 🌟 Main Features
+
+Toonflow is an AI tool that leverages AI technology to automatically convert novels into scripts, combined with AI-generated images and videos for efficient short drama creation. With Toonflow, you can easily complete the entire workflow from text to visuals, making short drama production smarter and more convenient.
+
+- ✅ **Character Generation**
+ Automatically analyzes original novel text, intelligently identifies and generates character settings including appearance, personality, identity, and other detailed information, providing a reliable foundation for subsequent script and visual creation.
+- ✅ **Script Generation**
+ Based on selected events and chapters, the system automatically generates structured scripts covering dialogue, scene descriptions, and plot progression, achieving efficient conversion from literary text to film scripts.
+- ✅ **Storyboard Production**
+ Based on script content, intelligently generates storyboard prompts and visual designs, detailing foreground, midground, background, character dynamics, prop settings, and scene layouts. Automatically generates storyboards from scripts, providing a complete blueprint for video production.
+- ✅ **Video Synthesis**
+ Integrates AI image and video technology, enabling AI-generated video clips. Incorporates online editing with support for personalized output adjustments, making film production efficient and streamlined.
+
+---
+
+# 📦 Application Scenarios
+
+- Short video content creation
+- Novel-to-film experimentation
+- AI Literary Adaptation Tools
+- Script development and rapid prototyping
+- Video material generation
+
+---
+
+# 🚀 Installation and Usage Guide
+
+## Prerequisites
+
+Before installing and using this software, please prepare the following:
+
+- ✅ Large Language Model AI service API endpoint.
+- ✅ Sora or Doubao video service API endpoint
+- ✅ Nano Banana Pro image generation model service API endpoint
+
+## Local Installation
+
+### 1. Download and Install
+
+| Operating System | Download Link | Description |
+| :--------------: | :------------------------------------------------------------ | :------------------------------ |
+| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | Official release package, click to download |
+| Linux | ⚙️ Coming Soon | Coming soon, stay tuned |
+| macOS | ⚙️ Coming Soon | Coming soon, stay tuned |
+
+> Note: Currently only Windows version is supported, other systems will be available soon.
+
+### 2. Start Service
+
+After installation, launch the program to start using the service.
+
+## Cloud Deployment
+
+Cloud installation and deployment tutorials are being prepared, stay tuned.
+
+---
+
+# 🔧 Development Process Guide
+
+## Development Environment Setup
+
+- **Node.js**: Version 23.11.1 or above required
+- **Yarn**: Recommended as the project package manager
+
+## Quick Start
+
+1. **Install Dependencies**
+
+ Please first run the following command in the project root directory to install dependencies:
+
+ ```bash
+ yarn install
+ ```
+
+2. **Start Development Environment**
+
+ - Run development service with Node.js:
+
+ ```bash
+ yarn dev #port 60000
+ ```
+
+ - Run development service quickly with Bun:
+
+ ```bash
+ yarn bun:dev #port 60000
+ ```
+
+3. **Project Build**
+
+ - Compile and generate TypeScript files:
+
+ ```bash
+ yarn build
+ ```
+
+ - Package as Windows platform executable:
+
+ ```bash
+ yarn dist:win
+ ```
+
+4. **Code Quality Check**
+
+ - Perform global syntax and standard checks:
+
+ ```bash
+ yarn lint
+ ```
+
+## Project Structure
+
+```
+📂 docs/ # Documentation resources
+📂 scripts/ # Build scripts and static resources
+📂 src/
+├─ 📂 agents/ # AI Agent modules
+├─ 📂 lib/ # Common libraries (database initialization, response format)
+├─ 📂 middleware/ # Middleware
+├─ 📂 routes/ # Route modules
+│ ├─ 📂 assets/ # Asset management
+│ ├─ 📂 index/ # Homepage
+│ ├─ 📂 novel/ # Novel management
+│ ├─ 📂 other/ # Other features
+│ ├─ 📂 outline/ # Outline management
+│ ├─ 📂 project/ # Project management
+│ ├─ 📂 prompt/ # Prompt management
+│ ├─ 📂 script/ # Script generation
+│ ├─ 📂 setting/ # System settings
+│ ├─ 📂 storyboard/ # Storyboard management
+│ ├─ 📂 task/ # Task management
+│ ├─ 📂 user/ # User management
+│ └─ 📂 video/ # Video generation
+├─ 📂 types/ # TypeScript type declarations
+├─ 📂 utils/ # Utility functions
+├─ 📄 app.ts # Application entry
+├─ 📄 core.ts # Route core
+├─ 📄 env.ts # Environment variable handling
+├─ 📄 err.ts # Error handling
+├─ 📄 router.ts # Route registration
+└─ 📄 utils.ts # General utilities
+📂 uploads/ # Upload file directory
+📄 LICENSE # License
+📄 NOTICES.txt # Third-party dependency declarations
+📄 package.json # Project configuration
+📄 README.md # Project description
+📄 tsconfig.json # TypeScript configuration
+```
+
+---
+
+# 📝 Development Roadmap
+
+We are continuously optimizing the product. Here are the recent development priorities:
+
+1. Core Feature Upgrades
+
+- `🧩 Prompt Enhancement Generation Agent` AI-powered intelligent video prompt enhancement, automatic storyboard script decomposition, supporting multi-shot intelligent fusion and smooth transitions
+- `📄 Multi-format Text Support` Extending intelligent parsing beyond novels to scripts, comic scripts, game dialogue texts, and other formats
+
+2. Production Workflow Optimization
+
+- `👗 Character Costume and Props Management` Strengthen costume, makeup, and prop consistency for long-form content, supporting multi-episode associated memory and automatic outfit generation
+- `📦 Batch Processing/Task Queue` Support multi-chapter simultaneous processing, background task management, real-time progress monitoring, and interruption recovery
+
+3. Visual Generation Enhancement
+
+- `🎭 Multi-style Template Library` Built-in multiple visual style packages, supporting one-click style conversion and user-defined style saving
+- `⏱️ Intelligent Rhythm Analysis/Optimization` Analyze plot emotion curves, automatically suggest climax points and rhythm changes, optimize storyboard arrangement and production workflow
+
+---
+
+# 📜 License
+
+Toonflow is open-sourced under the AGPL-3.0 license. License details: https://www.gnu.org/licenses/agpl-3.0.html
+
+You may use Toonflow for various purposes including commercial use, in compliance with the terms and conditions of AGPL-3.0.
+
+For proprietary commercial licenses exempt from AGPL-3.0 restrictions, please contact us via email.
+
+---
+
+# 💌 Contact Us
+
+📧 Email: [ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow Inquiry)
+
+---
+
+# ⭐️ Star History
+
+[](https://star-history.com/#HBAI-Ltd/Toonflow-app&Date)
+
+# Third-party Dependency List
+
+Please refer to `NOTICES.txt`
\ No newline at end of file
diff --git a/docs/logo.png b/docs/logo.png
new file mode 100644
index 0000000..c0248fa
Binary files /dev/null and b/docs/logo.png differ
diff --git a/electron-builder.yml b/electron-builder.yml
new file mode 100644
index 0000000..20b083a
--- /dev/null
+++ b/electron-builder.yml
@@ -0,0 +1,55 @@
+appId: net.toonflow.www
+productName: ToonFlow
+copyright: Copyright © 2026
+
+directories:
+ output: dist
+ buildResources: build
+
+files:
+ - build/**/*
+ - scripts/web/**/*
+ - package.json
+ - node_modules/**/*
+ - "!node_modules/**/*.{md,ts,map}"
+ - "!node_modules/**/LICENSE*"
+ - "!node_modules/**/{README,readme}*"
+ - "!**/*.d.ts"
+ - "!src/**/*"
+ - "!scripts/**/*.ts"
+
+asar: true
+
+win:
+ target:
+ - nsis
+ - portable
+ icon: ./scripts/logo.ico
+ artifactName: ${productName}-${version}-${os}-${arch}.${ext}
+
+nsis:
+ oneClick: false
+ allowToChangeInstallationDirectory: true
+ perMachine: true
+ shortcutName: ${productName}
+ artifactName: ${productName}-Setup-${version}.${ext}
+ installerIcon: './scripts/logo.ico'
+ uninstallerIcon: './scripts/logo.ico'
+
+mac:
+ target:
+ - dmg
+ - zip
+ icon: ./scripts/logo.icns
+ category: public.app-category.developer-tools
+ artifactName: ${productName}-${version}-${os}-${arch}.${ext}
+
+linux:
+ target:
+ - AppImage
+ - deb
+ icon: ./scripts/logo.png
+ category: Development
+ artifactName: ${productName}-${version}-${os}-${arch}.${ext}
+
+publish: null
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..291bfa8
--- /dev/null
+++ b/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "toonflow-serve",
+ "version": "1.0.0",
+ "description": "ToonFlow Serve - Electron Application",
+ "main": "build/main.js",
+ "author": "ToonFlow Team",
+ "packageManager": "yarn@1.0.0",
+ "engines": {
+ "node": ">=1.0.0"
+ },
+ "scripts": {
+ "dev": "nodemon --inspect --exec tsx src/app.ts",
+ "dev:win": "chcp 65001 && electronmon -r tsx scripts/main.ts",
+ "lint": "tsc --noEmit",
+ "build": "tsx scripts/build.ts",
+ "pack": "electron-builder --dir",
+ "dist": "yarn build && electron-builder",
+ "dist:win": "yarn build && electron-builder --win",
+ "dist:mac": "yarn build && electron-builder --mac",
+ "dist:linux": "yarn build && electron-builder --linux",
+ "test": "node build/app.js",
+ "license": "bun run scripts/license.ts"
+ },
+ "dependencies": {
+ "@aigne/core": "^1.72.0",
+ "@aigne/openai": "^0.16.16",
+ "@langchain/core": "^1.1.15",
+ "@langchain/openai": "^1.2.1",
+ "@rmp135/sql-ts": "^2.2.0",
+ "axios": "^1.13.2",
+ "axios-retry": "^4.5.0",
+ "better-sqlite3": "^12.6.2",
+ "cors": "^2.8.5",
+ "dotenv": "^17.2.3",
+ "express": "^5.2.1",
+ "express-ws": "^5.0.2",
+ "fast-glob": "^3.3.3",
+ "form-data": "^4.0.5",
+ "is-path-inside": "^4.0.0",
+ "js-md5": "^0.8.3",
+ "jsonwebtoken": "^9.0.3",
+ "knex": "^3.1.0",
+ "langchain": "^1.2.10",
+ "morgan": "^1.10.1",
+ "sharp": "^0.34.5",
+ "sqlite3": "^5.1.7",
+ "zod": "^4.3.5"
+ },
+ "devDependencies": {
+ "@types/cors": "^2.8.19",
+ "@types/express": "^5.0.6",
+ "@types/express-ws": "^3.0.6",
+ "@types/jsonwebtoken": "^9.0.10",
+ "@types/license-checker": "^25.0.6",
+ "@types/morgan": "^1.9.10",
+ "electron": "^40.0.0",
+ "electron-builder": "^26.4.0",
+ "electronmon": "^2.0.4",
+ "license-checker": "^25.0.1",
+ "nodemon": "^3.1.11",
+ "tsx": "^4.21.0",
+ "typescript": "^5.9.3"
+ }
+}
diff --git a/scripts/build.ts b/scripts/build.ts
new file mode 100644
index 0000000..5f57955
--- /dev/null
+++ b/scripts/build.ts
@@ -0,0 +1,55 @@
+import esbuild from "esbuild";
+
+const external = ["electron", "sqlite3", "better-sqlite3", "mysql", "mysql2", "pg", "pg-query-stream", "oracledb", "tedious", "mssql"];
+
+// 后端服务打包配置
+const appBuildConfig: esbuild.BuildOptions = {
+ entryPoints: ["src/app.ts"],
+ bundle: true,
+ minify: false,
+ format: "cjs",
+ allowOverwrite: true,
+ outfile: `build/app.js`,
+ platform: "node",
+ target: "esnext",
+ tsconfig: "./tsconfig.json",
+ alias: {
+ "@": "./src",
+ },
+ sourcemap: false,
+ external,
+};
+
+// Electron 主进程打包配置
+const mainBuildConfig: esbuild.BuildOptions = {
+ entryPoints: ["scripts/main.ts"],
+ bundle: true,
+ minify: false,
+ format: "cjs",
+ outfile: `build/main.js`,
+ allowOverwrite: true,
+ platform: "node",
+ target: "esnext",
+ tsconfig: "./tsconfig.json",
+ alias: {
+ "@": "./src",
+ },
+ sourcemap: false,
+ external,
+};
+
+(async () => {
+ try {
+ console.log("🔨 开始构建...\n");
+
+ // 并行构建
+ await Promise.all([esbuild.build(appBuildConfig), esbuild.build(mainBuildConfig)]);
+
+ console.log("✅ 后端服务构建完成: build/app.js");
+ console.log("✅ Electron主进程构建完成: build/main.js");
+ console.log("\n🎉 所有构建任务完成!\n");
+ } catch (err) {
+ console.error("❌ 构建失败:", err);
+ process.exit(1);
+ }
+})();
diff --git a/scripts/license.ts b/scripts/license.ts
new file mode 100644
index 0000000..36d4ce1
--- /dev/null
+++ b/scripts/license.ts
@@ -0,0 +1,72 @@
+import * as fs from "fs";
+import * as path from "path";
+import checker from "license-checker";
+
+const excludeNames = ["toonflow-serve"];
+// const strictWhiteList = ["MIT", "BSD-2-Clause", "BSD-3-Clause", "BSD", "0BSD"];
+const strictWhiteList: string[] = [];
+
+// 检查是否在白名单协议
+function isStrictWhiteLicense(license: string): boolean {
+ const normalized = license.replace(/[\(\)]/g, "").trim();
+ const parts = normalized.split(/\s*(OR|AND|\/)\s*/i).map((part) => part.trim());
+ return parts.every((part) => strictWhiteList.some((wl) => part === wl || part.replace(/ with .*/i, "") === wl));
+}
+
+// 读取 package.json 里的直接依赖
+function getDirectDependencyNames(): string[] {
+ const pkg = JSON.parse(fs.readFileSync(path.join(process.cwd(), "package.json"), "utf-8"));
+ const deps = Object.keys(pkg.dependencies ?? {});
+ const devDeps = Object.keys(pkg.devDependencies ?? {});
+ return [...deps, ...devDeps];
+}
+
+// 执行主逻辑
+checker.init({ start: process.cwd() }, (err: Error, packages: Record