AI ContentCraft is a versatile content creation tool that integrates text generation, speech synthesis, and image generation capabilities. It helps creators quickly generate stories, podcast scripts, and accompanying audio-visual content.
- 🎯 Story Generation: Automatically generate short stories based on themes
- 📝 Script Conversion: Convert stories into standard script format
- 🎙️ Podcast Content: Generate podcast outlines and dialogue scripts
- 🗣️ Speech Synthesis: Text-to-speech support with multiple voices
- 🎨 Image Generation: Generate illustrations for story scenes
- 🌐 Bilingual Support: Support for Chinese-English content conversion
- 📊 Batch Processing: Support batch generation and download of content
- Frontend: HTML/JavaScript
- Backend: Node.js + Express
- AI Services:
- DeepSeek AI: Text generation (using DeepSeek Chat API)
- Kokoro TTS: Speech synthesis (using Kokoro-82M-ONNX model)
- Replicate: Image generation (using Replicate API)
- Other tools: FFmpeg (audio processing) (FFmpeg official site)
- Node.js 16+
- FFmpeg
- API keys for AI services
- DeepSeek AI account and API key
- Replicate account and API token
- Stable internet connection
- Clone the project and install dependencies:
git clone https://github.com/nicekate/AI-ContentCraft.git
cd AI-ContentCraft
# Install project dependencies
npm install dotenv express kokoro-js openai replicate
# Install dev dependencies
npm install -D nodemon
- Configure environment variables:
Create a
.env
file and add the following configuration:
DEEPSEEK_API_KEY=your_deepseek_api_key
REPLICATE_API_TOKEN=your_replicate_token
- Install FFmpeg:
Ensure FFmpeg is installed on your system and update the FFmpeg path in
server.js
:
const ffmpegPath = 'your_ffmpeg_path';
- Start the server:
npm run dev
- Access the application:
Open your browser and visit
http://localhost:3000
- Input story theme
- Click to generate story
- Optionally convert to script format
- Generate accompanying scene images
- Input podcast theme
- Generate podcast outline
- Convert to dialogue script
- Choose different voices for dubbing
- Support voiceover for multiple text segments
- Automatically merge multiple audio clips
- Provide audio preview and download
- Automatically generate prompts for scenes
- Batch generate scene images
- Provide image preview and batch download
- Auto-generate image showcase page
Main endpoints include:
/generate-story
: Generate story/generate-script
: Convert script/generate-podcast
: Generate podcast content/generate
: Single text to speech/generate-and-merge
: Multiple text to speech and merge/generate-image
: Generate image/translate-podcast
: Podcast script translation/translate-story-script
: Story script translation
- Valid API keys are required for AI services
- Audio merging requires proper FFmpeg configuration
- Recommended for local development environment
- Mind API call limits and costs
Common issues and solutions:
-
API Call Failures
- Check if API keys are correct
- Verify API call quota
- Check specific error messages
-
Audio Processing Issues
- Confirm FFmpeg installation
- Check audio file format
- Review server logs
-
Image Generation Failures
- Check Replicate API quota
- Verify prompt compliance
- Review error responses
- Fork the project
- Create feature branch
- Submit changes
- Create Pull Request
MIT
AI ContentCraft 是一个多功能的内容创作工具,集成了文本生成、语音合成、图像生成等功能。它可以帮助创作者快速生成故事、播客脚本和配套的音视频内容。
- 🎯 故事生成:基于主题自动生成短篇故事
- 📝 脚本转换:将故事转换为标准剧本格式
- 🎙️ 播客内容:生成播客大纲和对话脚本
- 🗣️ 语音合成:支持多种声音的文本转语音
- 🎨 图像生成:为故事场景生成配图
- 🌐 双语支持:支持内容的中英文转换
- 📊 批量处理:支持批量生成和下载内容
- Frontend: HTML/JavaScript
- Backend: Node.js + Express
- AI Services:
- DeepSeek AI: 文本生成(使用 DeepSeek Chat API)
- Kokoro TTS: 语音合成(使用 Kokoro-82M-ONNX 模型)
- Replicate: 图像生成(使用 Replicate API)
- 其他工具:FFmpeg (音频处理) (FFmpeg 官网)
- Node.js 16+
- FFmpeg
- 各 AI 服务的 API 密钥
- DeepSeek AI 账号和 API 密钥
- Replicate 账号和 API Token
- 稳定的网络连接
- 克隆项目并安装依赖:
git clone https://github.com/nicekate/AI-ContentCraft.git
cd AI-ContentCraft
# 安装项目依赖
npm install dotenv express kokoro-js openai replicate
# 安装开发依赖
npm install -D nodemon
- 配置环境变量:
创建
.env
文件并添加以下配置:
DEEPSEEK_API_KEY=your_deepseek_api_key
REPLICATE_API_TOKEN=your_replicate_token
- 安装 FFmpeg:
确保系统中已安装 FFmpeg,并更新
server.js
中的 FFmpeg 路径:
const ffmpegPath = 'your_ffmpeg_path';
- 启动服务器:
npm run dev
- 访问应用:
打开浏览器访问
http://localhost:3000
- 输入故事主题
- 点击生成故事
- 可选择转换为脚本格式
- 支持生成配套的场景图片
- 输入播客主题
- 生成播客大纲
- 转换为对话脚本
- 选择不同声音进行配音
- 支持多段文本分别配音
- 自动合并多个音频片段
- 提供音频预览和下载
- 自动为场景生成提示词
- 批量生成场景图片
- 提供图片预览和批量下载
- 自动生成图片展示页面
主要接口包括:
/generate-story
: 生成故事/generate-script
: 转换脚本/generate-podcast
: 生成播客内容/generate
: 单段文本转语音/generate-and-merge
: 多段文本转语音并合并/generate-image
: 生成图片/translate-podcast
: 播客脚本翻译/translate-story-script
: 故事脚本翻译
- 需要有效的 API 密钥才能使用 AI 服务
- 音频合并功能需要正确配置 FFmpeg
- 建议在本地开发环境中使用
- 注意 API 调用限制和费用
常见问题及解决方案:
-
API 调用失败
- 检查 API 密钥是否正确
- 确认 API 调用限额
- 查看具体错误信息
-
音频处理问题
- 确认 FFmpeg 安装正确
- 检查音频文件格式
- 查看服务器日志
-
图片生成失败
- 检查 Replicate API 配额
- 确认提示词是否合规
- 查看错误响应
- Fork 项目
- 创建功能分支
- 提交变更
- 发起 Pull Request
MIT