重构pipeline的UI架构,支持后续pipeline的动态拓展
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
"t": {
|
||||
"app.title": "⚡ Pixelle-Video - AI Auto Short Video Engine",
|
||||
"app.subtitle": "Powered by Pixelle.AI",
|
||||
|
||||
"section.content_input": "📝 Video Script",
|
||||
"section.bgm": "🎵 Background Music",
|
||||
"section.tts": "🎤 Voiceover",
|
||||
@@ -12,29 +11,22 @@
|
||||
"section.media": "🎨 Media Generation",
|
||||
"section.template": "📐 Storyboard Template",
|
||||
"section.video_generation": "🎬 Generate Video",
|
||||
|
||||
"input_mode.topic": "💡 Topic",
|
||||
"input_mode.custom": "✍️ Custom Content",
|
||||
|
||||
"mode.generate": "💡 AI Creation",
|
||||
"mode.fixed": "✍️ Custom Script",
|
||||
|
||||
"input.topic": "Topic",
|
||||
"input.topic_placeholder": "AI automatically creates specified number of narrations\nExample: How to build passive income, 如何增加被动收入",
|
||||
"input.topic_help": "Enter a topic, AI will generate content based on it",
|
||||
|
||||
"input.text": "Text Input",
|
||||
"input.text_help_generate": "Enter topic or theme (AI will create narrations)",
|
||||
"input.text_help_fixed": "Enter complete narration script (used directly without modification, one narration per line)",
|
||||
|
||||
"input.content": "Content",
|
||||
"input.content_placeholder": "Used directly without modification, one narration per line\nExample:\nHello everyone, today I'll share three study tips\nThe first tip is focus training, meditate for 10 minutes daily\nThe second tip is active recall, review immediately after learning",
|
||||
"input.content_help": "Provide your own content for video generation",
|
||||
|
||||
"input.title": "Title (Optional)",
|
||||
"input.title_placeholder": "Video title (auto-generated if empty)",
|
||||
"input.title_help": "Optional: Custom title for the video",
|
||||
|
||||
"voice.title": "🎤 Voice Selection",
|
||||
"voice.male_professional": "🎤 Male-Professional",
|
||||
"voice.male_young": "🎙️ Male-Young",
|
||||
@@ -43,7 +35,6 @@
|
||||
"voice.preview": "▶ Preview Voice",
|
||||
"voice.previewing": "Generating voice preview...",
|
||||
"voice.preview_failed": "Preview failed: {error}",
|
||||
|
||||
"style.workflow": "Workflow Selection",
|
||||
"style.workflow_what": "Determines how each frame's illustration is generated and its effect (e.g., using FLUX, SD models)",
|
||||
"style.workflow_how": "Place the exported image_xxx.json workflow file(API format) into the workflows/selfhost/ folder (for local ComfyUI) or the workflows/runninghub/ folder (for cloud)",
|
||||
@@ -75,7 +66,6 @@
|
||||
"style.preview_failed_general": "Failed to generate preview image",
|
||||
"style.final_prompt_label": "Final Prompt",
|
||||
"style.generated_prompt": "Generated prompt: {prompt}",
|
||||
|
||||
"template.selector": "Template Selection",
|
||||
"template.select": "Select Template",
|
||||
"template.select_help": "Select template and video size",
|
||||
@@ -95,7 +85,6 @@
|
||||
"template.type.static_hint": "Uses template's built-in styles, no AI-generated media required. You can customize background images and other parameters in the template.",
|
||||
"template.type.image_hint": "AI automatically generates illustrations matching the narration content. Image size is determined by the template.",
|
||||
"template.type.video_hint": "AI automatically generates video clips matching the narration content. Video size is determined by the template.",
|
||||
|
||||
"orientation.portrait": "Portrait",
|
||||
"orientation.landscape": "Landscape",
|
||||
"orientation.square": "Square",
|
||||
@@ -114,16 +103,13 @@
|
||||
"template.preview_image_help": "Supports local path or URL",
|
||||
"template.preview_caption": "Template Preview: {template}",
|
||||
"template.custom_parameters": "Custom Parameters",
|
||||
|
||||
"image.not_required": "Current template does not require image generation",
|
||||
"image.not_required_hint": "The selected template is text-only and does not need images. Benefits: ⚡ Faster generation 💰 Lower cost",
|
||||
|
||||
"video.title": "🎬 Video Settings",
|
||||
"video.frames": "Scenes",
|
||||
"video.frames_help": "More scenes = longer video",
|
||||
"video.frames_label": "Scenes: {n}",
|
||||
"video.frames_fixed_mode_hint": "💡 Fixed mode: scene count is determined by actual script segments",
|
||||
|
||||
"bgm.selector": "Music Selection",
|
||||
"bgm.none": "🔇 No BGM",
|
||||
"bgm.volume": "Volume",
|
||||
@@ -132,13 +118,11 @@
|
||||
"bgm.preview_failed": "❌ Music file not found: {file}",
|
||||
"bgm.what": "Adds background music to your video, making it more atmospheric and professional",
|
||||
"bgm.how": "Place audio files (MP3/WAV/FLAC, etc.) in the bgm/ folder for automatic detection",
|
||||
|
||||
"btn.generate": "🎬 Generate Video",
|
||||
"btn.save_config": "💾 Save Configuration",
|
||||
"btn.reset_config": "🔄 Reset to Default",
|
||||
"btn.save_and_start": "Save and Start",
|
||||
"btn.test_connection": "Test Connection",
|
||||
|
||||
"status.initializing": "🔧 Initializing...",
|
||||
"status.generating": "🚀 Generating video...",
|
||||
"status.success": "✅ Video generated successfully!",
|
||||
@@ -149,7 +133,6 @@
|
||||
"status.config_reset": "✅ Configuration reset to default",
|
||||
"status.connection_success": "✅ Connected",
|
||||
"status.connection_failed": "❌ Connection failed",
|
||||
|
||||
"progress.generating_title": "Generating title...",
|
||||
"progress.generating_narrations": "Generating narrations...",
|
||||
"progress.splitting_script": "Splitting script...",
|
||||
@@ -167,11 +150,9 @@
|
||||
"progress.concatenating": "Concatenating video...",
|
||||
"progress.finalizing": "Finalizing...",
|
||||
"progress.completed": "✅ Completed",
|
||||
|
||||
"error.input_required": "❌ Please provide topic or content",
|
||||
"error.api_key_required": "❌ Please enter API Key",
|
||||
"error.missing_field": "Please enter {field}",
|
||||
|
||||
"info.duration": "Duration",
|
||||
"info.file_size": "File Size",
|
||||
"info.frames": "Scenes",
|
||||
@@ -180,7 +161,6 @@
|
||||
"info.video_information": "📊 Video Information",
|
||||
"info.no_video_yet": "Video preview will appear here after generation",
|
||||
"info.generation_time": "Generation Time",
|
||||
|
||||
"settings.title": "⚙️ System Configuration (Required)",
|
||||
"settings.not_configured": "⚠️ Please complete system configuration before generating videos",
|
||||
"settings.llm.title": "🤖 Large Language Model",
|
||||
@@ -193,7 +173,6 @@
|
||||
"settings.llm.base_url_help": "API service address",
|
||||
"settings.llm.model": "Model",
|
||||
"settings.llm.model_help": "Model name",
|
||||
|
||||
"settings.comfyui.title": "🔧 ComfyUI Configuration",
|
||||
"settings.comfyui.local_title": "Local/Self-hosted ComfyUI",
|
||||
"settings.comfyui.cloud_title": "RunningHub Cloud",
|
||||
@@ -203,17 +182,14 @@
|
||||
"settings.comfyui.runninghub_api_key_help": "Visit https://runninghub.ai to register and get API Key",
|
||||
"settings.comfyui.runninghub_hint": "No local ComfyUI? Use RunningHub Cloud:",
|
||||
"settings.comfyui.runninghub_get_api_key": "Get RunningHub API Key",
|
||||
|
||||
"tts.inference_mode": "Synthesis Mode",
|
||||
"tts.mode.local": "Local Synthesis",
|
||||
"tts.mode.comfyui": "ComfyUI Synthesis",
|
||||
"tts.mode.local_hint": "💡 Using Edge TTS, no configuration required, ready to use",
|
||||
"tts.mode.comfyui_hint": "⚙️ Using ComfyUI workflows, flexible and powerful",
|
||||
|
||||
"tts.voice_selector": "Voice Selection",
|
||||
"tts.speed": "Speed",
|
||||
"tts.speed_label": "{speed}x",
|
||||
|
||||
"tts.voice.zh_CN_XiaoxiaoNeural": "zh-CN-XiaoxiaoNeural",
|
||||
"tts.voice.zh_CN_XiaoyiNeural": "zh-CN-XiaoyiNeural",
|
||||
"tts.voice.zh_CN_YunjianNeural": "zh-CN-YunjianNeural",
|
||||
@@ -228,7 +204,6 @@
|
||||
"tts.voice.en_US_DavisNeural": "en-US-DavisNeural",
|
||||
"tts.voice.en_GB_SoniaNeural": "en-GB-SoniaNeural",
|
||||
"tts.voice.en_GB_RyanNeural": "en-GB-RyanNeural",
|
||||
|
||||
"tts.selector": "Workflow Selection",
|
||||
"tts.what": "Converts narration text to natural human-like speech (some workflows support reference audio for voice cloning)",
|
||||
"tts.how": "Place the exported tts_xxx.json workflow file(API format) into the workflows/selfhost/ folder (for local ComfyUI) or the workflows/runninghub/ folder (for cloud)",
|
||||
@@ -241,29 +216,21 @@
|
||||
"tts.previewing": "Generating TTS preview...",
|
||||
"tts.preview_success": "✅ Preview generated successfully!",
|
||||
"tts.preview_failed": "❌ Preview failed: {error}",
|
||||
|
||||
"welcome.first_time": "🎉 Welcome to Pixelle-Video! Please complete basic configuration",
|
||||
"welcome.config_hint": "💡 First-time setup requires API Key configuration, you can modify it in advanced settings later",
|
||||
|
||||
"wizard.llm_required": "🤖 Large Language Model Configuration (Required)",
|
||||
"wizard.image_optional": "🎨 Image Generation Configuration (Optional)",
|
||||
"wizard.image_hint": "💡 If not configured, default template will be used (no AI image generation)",
|
||||
"wizard.configure_image": "Configure Image Generation (Recommended)",
|
||||
|
||||
"label.required": "(Required)",
|
||||
"label.optional": "(Optional)",
|
||||
|
||||
"help.feature_description": "💡 Feature Description",
|
||||
"help.what": "Purpose",
|
||||
"help.how": "Customization",
|
||||
|
||||
"language.select": "🌐 Language",
|
||||
|
||||
"version.title": "📦 Version Info",
|
||||
"version.current": "Current Version",
|
||||
|
||||
"github.title": "⭐ Open Source Support",
|
||||
|
||||
"history.page_title": "📚 Generation History",
|
||||
"history.total_tasks": "Total Tasks",
|
||||
"history.completed_count": "Completed",
|
||||
@@ -321,7 +288,6 @@
|
||||
"history.action.delete_success": "✅ Task deleted",
|
||||
"history.action.delete_failed": "❌ Deletion failed: {error}",
|
||||
"history.page_info": "Page {page} / {total_pages}",
|
||||
|
||||
"batch.mode_label": "🔢 Batch Generation Mode",
|
||||
"batch.mode_help": "Generate multiple videos, one topic per line",
|
||||
"batch.section_title": "Batch Topics Input",
|
||||
@@ -364,7 +330,9 @@
|
||||
"batch.failed_list": "❌ Failed Tasks",
|
||||
"batch.task": "Task",
|
||||
"batch.error": "Error",
|
||||
"batch.error_detail": "View detailed error stack"
|
||||
"batch.error_detail": "View detailed error stack",
|
||||
"pipeline.standard.name": "Standard Video",
|
||||
"pipeline.demo.name": "Demo Feature",
|
||||
"pipeline.demo.description": "A demo pipeline with a custom layout"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
"t": {
|
||||
"app.title": "⚡ Pixelle-Video - AI 全自动短视频引擎",
|
||||
"app.subtitle": "Pixelle.AI 提供支持",
|
||||
|
||||
"section.content_input": "📝 视频脚本",
|
||||
"section.bgm": "🎵 背景音乐",
|
||||
"section.tts": "🎤 配音合成",
|
||||
@@ -12,29 +11,22 @@
|
||||
"section.media": "🎨 媒体生成",
|
||||
"section.template": "📐 分镜模板",
|
||||
"section.video_generation": "🎬 生成视频",
|
||||
|
||||
"input_mode.topic": "💡 主题",
|
||||
"input_mode.custom": "✍️ 自定义内容",
|
||||
|
||||
"mode.generate": "💡 AI 创作",
|
||||
"mode.fixed": "✍️ 自行创作",
|
||||
|
||||
"input.topic": "主题",
|
||||
"input.topic_placeholder": "AI 自动创作指定数量的旁白\n例如:如何增加被动收入、How to build passive income",
|
||||
"input.topic_help": "输入一个主题,AI 将根据主题生成内容",
|
||||
|
||||
"input.text": "文本输入",
|
||||
"input.text_help_generate": "输入主题或话题(AI 将创作旁白)",
|
||||
"input.text_help_fixed": "输入完整的旁白脚本(直接使用,不做改写,每行一个旁白)",
|
||||
|
||||
"input.content": "内容",
|
||||
"input.content_placeholder": "直接使用,不做改写,每行一个旁白\n例如:\n大家好,今天跟你分享三个学习技巧\n第一个技巧是专注力训练,每天冥想10分钟\n第二个技巧是主动回忆,学完立即复述",
|
||||
"input.content_help": "提供您自己的内容用于视频生成",
|
||||
|
||||
"input.title": "标题(可选)",
|
||||
"input.title_placeholder": "视频标题(留空则自动生成)",
|
||||
"input.title_help": "可选:自定义视频标题",
|
||||
|
||||
"voice.title": "🎤 语音选择",
|
||||
"voice.male_professional": "🎤 男声-专业",
|
||||
"voice.male_young": "🎙️ 男声-年轻",
|
||||
@@ -43,7 +35,6 @@
|
||||
"voice.preview": "▶ 试听语音",
|
||||
"voice.previewing": "正在生成语音预览...",
|
||||
"voice.preview_failed": "预览失败:{error}",
|
||||
|
||||
"style.workflow": "工作流选择",
|
||||
"style.workflow_what": "决定视频中每帧插图的生成方式和效果(如使用 FLUX、SD 等模型)",
|
||||
"style.workflow_how": "将导出的 image_xxx.json 工作流文件(API格式)放入 workflows/selfhost/(本地 ComfyUI)或 workflows/runninghub/(云端)文件夹",
|
||||
@@ -75,7 +66,6 @@
|
||||
"style.preview_failed_general": "预览图片生成失败",
|
||||
"style.final_prompt_label": "最终提示词",
|
||||
"style.generated_prompt": "生成的提示词:{prompt}",
|
||||
|
||||
"template.selector": "模板选择",
|
||||
"template.select": "选择模板",
|
||||
"template.select_help": "选择模板和视频尺寸",
|
||||
@@ -95,7 +85,6 @@
|
||||
"template.type.static_hint": "使用模板自带样式,无需AI生成媒体。可在模板中自定义背景图片等参数。",
|
||||
"template.type.image_hint": "AI自动根据文案内容生成与之匹配的插图,插图尺寸由模板决定。",
|
||||
"template.type.video_hint": "AI自动根据文案内容生成与之匹配的视频片段,视频尺寸由模板决定。",
|
||||
|
||||
"orientation.portrait": "竖屏",
|
||||
"orientation.landscape": "横屏",
|
||||
"orientation.square": "方形",
|
||||
@@ -114,16 +103,13 @@
|
||||
"template.preview_image_help": "支持本地路径或 URL",
|
||||
"template.preview_caption": "模板预览:{template}",
|
||||
"template.custom_parameters": "自定义参数",
|
||||
|
||||
"image.not_required": "当前模板不需要插图生成",
|
||||
"image.not_required_hint": "您选择的模板是纯文本模板,无需生成图片。这将:⚡ 加快生成速度 💰 降低生成成本",
|
||||
|
||||
"video.title": "🎬 视频设置",
|
||||
"video.frames": "分镜数",
|
||||
"video.frames_help": "更多分镜 = 更长视频",
|
||||
"video.frames_label": "分镜数:{n}",
|
||||
"video.frames_fixed_mode_hint": "💡 固定模式:分镜数由脚本实际段落数决定",
|
||||
|
||||
"bgm.selector": "音乐选择",
|
||||
"bgm.none": "🔇 无背景音乐",
|
||||
"bgm.volume": "音量",
|
||||
@@ -132,13 +118,11 @@
|
||||
"bgm.preview_failed": "❌ 音乐文件未找到:{file}",
|
||||
"bgm.what": "为视频添加背景音乐,让视频更有氛围感和专业性",
|
||||
"bgm.how": "将音频文件(MP3/WAV/FLAC 等)放入 bgm/ 文件夹即可自动识别",
|
||||
|
||||
"btn.generate": "🎬 生成视频",
|
||||
"btn.save_config": "💾 保存配置",
|
||||
"btn.reset_config": "🔄 重置默认",
|
||||
"btn.save_and_start": "保存并开始",
|
||||
"btn.test_connection": "测试连接",
|
||||
|
||||
"status.initializing": "🔧 正在初始化...",
|
||||
"status.generating": "🚀 正在生成视频...",
|
||||
"status.success": "✅ 视频生成成功!",
|
||||
@@ -149,7 +133,6 @@
|
||||
"status.config_reset": "✅ 配置已重置为默认值",
|
||||
"status.connection_success": "✅ 连接成功",
|
||||
"status.connection_failed": "❌ 连接失败",
|
||||
|
||||
"progress.generating_title": "生成标题...",
|
||||
"progress.generating_narrations": "生成旁白...",
|
||||
"progress.splitting_script": "切分脚本...",
|
||||
@@ -167,11 +150,9 @@
|
||||
"progress.concatenating": "正在拼接视频...",
|
||||
"progress.finalizing": "完成中...",
|
||||
"progress.completed": "✅ 生成完成",
|
||||
|
||||
"error.input_required": "❌ 请提供主题或内容",
|
||||
"error.api_key_required": "❌ 请填写 API Key",
|
||||
"error.missing_field": "请填写 {field}",
|
||||
|
||||
"info.duration": "时长",
|
||||
"info.file_size": "文件大小",
|
||||
"info.frames": "分镜数",
|
||||
@@ -180,7 +161,6 @@
|
||||
"info.video_information": "📊 视频信息",
|
||||
"info.no_video_yet": "生成视频后,预览将显示在这里",
|
||||
"info.generation_time": "生成耗时",
|
||||
|
||||
"settings.title": "⚙️ 系统配置(必需)",
|
||||
"settings.not_configured": "⚠️ 请先完成系统配置才能生成视频",
|
||||
"settings.llm.title": "🤖 大语言模型",
|
||||
@@ -193,7 +173,6 @@
|
||||
"settings.llm.base_url_help": "API 服务地址",
|
||||
"settings.llm.model": "Model",
|
||||
"settings.llm.model_help": "模型名称",
|
||||
|
||||
"settings.comfyui.title": "🔧 ComfyUI 配置",
|
||||
"settings.comfyui.local_title": "本地/自建 ComfyUI",
|
||||
"settings.comfyui.cloud_title": "RunningHub 云端",
|
||||
@@ -203,17 +182,14 @@
|
||||
"settings.comfyui.runninghub_api_key_help": "访问 https://runninghub.ai 注册并获取 API Key",
|
||||
"settings.comfyui.runninghub_hint": "没有本地 ComfyUI?可用 RunningHub 云端:",
|
||||
"settings.comfyui.runninghub_get_api_key": "点此获取 RunningHub API Key",
|
||||
|
||||
"tts.inference_mode": "合成方式",
|
||||
"tts.mode.local": "本地合成",
|
||||
"tts.mode.comfyui": "ComfyUI 合成",
|
||||
"tts.mode.local_hint": "💡 使用 Edge TTS,无需配置,开箱即用(请确保网络环境可用)",
|
||||
"tts.mode.comfyui_hint": "⚙️ 使用 ComfyUI 工作流,灵活强大",
|
||||
|
||||
"tts.voice_selector": "音色选择",
|
||||
"tts.speed": "语速",
|
||||
"tts.speed_label": "{speed}x",
|
||||
|
||||
"tts.voice.zh_CN_XiaoxiaoNeural": "女声-温柔(晓晓)",
|
||||
"tts.voice.zh_CN_XiaoyiNeural": "女声-甜美(晓伊)",
|
||||
"tts.voice.zh_CN_YunjianNeural": "男声-专业(云健)",
|
||||
@@ -228,7 +204,6 @@
|
||||
"tts.voice.en_US_DavisNeural": "男声-友好(Davis)",
|
||||
"tts.voice.en_GB_SoniaNeural": "女声-英式(Sonia)",
|
||||
"tts.voice.en_GB_RyanNeural": "男声-英式(Ryan)",
|
||||
|
||||
"tts.selector": "工作流选择",
|
||||
"tts.what": "将旁白文本转换为真人般的自然语音(部分工作流支持参考音频克隆声音)",
|
||||
"tts.how": "将导出的 tts_xxx.json 工作流文件(API格式)放入 workflows/selfhost/(本地 ComfyUI)或 workflows/runninghub/(云端)文件夹",
|
||||
@@ -241,29 +216,21 @@
|
||||
"tts.previewing": "正在生成 TTS 预览...",
|
||||
"tts.preview_success": "✅ 预览生成成功!",
|
||||
"tts.preview_failed": "❌ 预览失败:{error}",
|
||||
|
||||
"welcome.first_time": "🎉 欢迎使用 Pixelle-Video!请先完成基础配置",
|
||||
"welcome.config_hint": "💡 首次使用需要配置 API Key,后续可以在高级设置中修改",
|
||||
|
||||
"wizard.llm_required": "🤖 大语言模型配置(必需)",
|
||||
"wizard.image_optional": "🎨 图像生成配置(可选)",
|
||||
"wizard.image_hint": "💡 如果不配置图像生成,将使用默认模板(无 AI 生图)",
|
||||
"wizard.configure_image": "配置图像生成(推荐)",
|
||||
|
||||
"label.required": "(必需)",
|
||||
"label.optional": "(可选)",
|
||||
|
||||
"help.feature_description": "💡 功能说明",
|
||||
"help.what": "作用",
|
||||
"help.how": "自定义方式",
|
||||
|
||||
"language.select": "🌐 语言",
|
||||
|
||||
"version.title": "📦 版本信息",
|
||||
"version.current": "当前版本",
|
||||
|
||||
"github.title": "⭐ 开源支持",
|
||||
|
||||
"history.page_title": "📚 生成历史",
|
||||
"history.total_tasks": "总任务数",
|
||||
"history.completed_count": "已完成",
|
||||
@@ -321,7 +288,6 @@
|
||||
"history.action.delete_success": "✅ 任务已删除",
|
||||
"history.action.delete_failed": "❌ 删除失败:{error}",
|
||||
"history.page_info": "第 {page} 页 / 共 {total_pages} 页",
|
||||
|
||||
"batch.mode_label": "🔢 批量生成模式",
|
||||
"batch.mode_help": "批量生成多个视频,每行一个主题",
|
||||
"batch.section_title": "批量主题输入",
|
||||
@@ -364,7 +330,9 @@
|
||||
"batch.failed_list": "❌ 失败的任务",
|
||||
"batch.task": "任务",
|
||||
"batch.error": "错误信息",
|
||||
"batch.error_detail": "查看详细错误堆栈"
|
||||
"batch.error_detail": "查看详细错误堆栈",
|
||||
"pipeline.standard.name": "标准视频",
|
||||
"pipeline.demo.name": "演示功能",
|
||||
"pipeline.demo.description": "具有自定义布局的演示 Pipeline"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,9 +31,6 @@ from web.state.session import init_session_state, init_i18n, get_pixelle_video
|
||||
# Import components
|
||||
from web.components.header import render_header
|
||||
from web.components.settings import render_advanced_settings
|
||||
from web.components.content_input import render_content_input, render_bgm_section, render_version_info
|
||||
from web.components.style_config import render_style_config
|
||||
from web.components.output_preview import render_output_preview
|
||||
|
||||
# Page config
|
||||
st.set_page_config(
|
||||
@@ -59,42 +56,28 @@ def main():
|
||||
# Render system configuration (LLM + ComfyUI)
|
||||
render_advanced_settings()
|
||||
|
||||
# Three-column layout
|
||||
left_col, middle_col, right_col = st.columns([1, 1, 1])
|
||||
# ========================================================================
|
||||
# Pipeline Selection & Delegation
|
||||
# ========================================================================
|
||||
from web.pipelines import get_all_pipeline_uis
|
||||
|
||||
# ========================================================================
|
||||
# Left Column: Content Input & BGM
|
||||
# ========================================================================
|
||||
with left_col:
|
||||
# Content input (mode, text, title, n_scenes)
|
||||
content_params = render_content_input()
|
||||
|
||||
# BGM selection (bgm_path, bgm_volume)
|
||||
bgm_params = render_bgm_section()
|
||||
|
||||
# Version info & GitHub link
|
||||
render_version_info()
|
||||
# Get all registered pipelines
|
||||
pipelines = get_all_pipeline_uis()
|
||||
|
||||
# ========================================================================
|
||||
# Middle Column: Style Configuration
|
||||
# ========================================================================
|
||||
with middle_col:
|
||||
# Style configuration (TTS, template, workflow, etc.)
|
||||
style_params = render_style_config(pixelle_video)
|
||||
# Use Tabs for pipeline selection
|
||||
# Note: st.tabs returns a list of containers, one for each tab
|
||||
tab_labels = [f"{p.icon} {p.display_name}" for p in pipelines]
|
||||
tabs = st.tabs(tab_labels)
|
||||
|
||||
# ========================================================================
|
||||
# Right Column: Output Preview
|
||||
# ========================================================================
|
||||
with right_col:
|
||||
# Combine all parameters
|
||||
video_params = {
|
||||
**content_params,
|
||||
**bgm_params,
|
||||
**style_params
|
||||
}
|
||||
|
||||
# Render output preview (generate button, progress, video preview)
|
||||
render_output_preview(pixelle_video, video_params)
|
||||
# Render each pipeline in its corresponding tab
|
||||
for i, pipeline in enumerate(pipelines):
|
||||
with tabs[i]:
|
||||
# Show description if available
|
||||
if pipeline.description:
|
||||
st.caption(pipeline.description)
|
||||
|
||||
# Delegate rendering
|
||||
pipeline.render(pixelle_video)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
35
web/pipelines/__init__.py
Normal file
35
web/pipelines/__init__.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# Copyright (C) 2025 AIDC-AI
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
Pipeline UI Package
|
||||
|
||||
Exports registry functions and automatically registers available pipelines.
|
||||
"""
|
||||
|
||||
from web.pipelines.base import (
|
||||
PipelineUI,
|
||||
register_pipeline_ui,
|
||||
get_pipeline_ui,
|
||||
get_all_pipeline_uis
|
||||
)
|
||||
|
||||
# Import all pipeline UI modules to ensure they register themselves
|
||||
from web.pipelines import standard
|
||||
from web.pipelines import demo
|
||||
|
||||
__all__ = [
|
||||
"PipelineUI",
|
||||
"register_pipeline_ui",
|
||||
"get_pipeline_ui",
|
||||
"get_all_pipeline_uis"
|
||||
]
|
||||
57
web/pipelines/base.py
Normal file
57
web/pipelines/base.py
Normal file
@@ -0,0 +1,57 @@
|
||||
# Copyright (C) 2025 AIDC-AI
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
Pipeline UI Base & Registry
|
||||
|
||||
Defines the PipelineUI protocol and the registration mechanism.
|
||||
"""
|
||||
|
||||
from typing import Dict, Any, List, Type
|
||||
|
||||
class PipelineUI:
|
||||
"""
|
||||
Base class for Pipeline UI plugins.
|
||||
|
||||
Each pipeline should implement a subclass to define its own full-page UI.
|
||||
"""
|
||||
name: str = "base"
|
||||
display_name: str = "Base Pipeline"
|
||||
icon: str = "🔌"
|
||||
description: str = ""
|
||||
|
||||
def render(self, pixelle_video: Any):
|
||||
"""
|
||||
Render the full page content for this pipeline (below settings).
|
||||
|
||||
Args:
|
||||
pixelle_video: The initialized PixelleVideoCore instance.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
# ==================== Registry ====================
|
||||
|
||||
_pipeline_uis: Dict[str, PipelineUI] = {}
|
||||
|
||||
def register_pipeline_ui(ui_class: Type[PipelineUI]):
|
||||
"""Register a pipeline UI class"""
|
||||
instance = ui_class()
|
||||
_pipeline_uis[instance.name] = instance
|
||||
|
||||
def get_pipeline_ui(name: str) -> PipelineUI:
|
||||
"""Get a pipeline UI instance by name"""
|
||||
return _pipeline_uis.get(name)
|
||||
|
||||
def get_all_pipeline_uis() -> List[PipelineUI]:
|
||||
"""Get all registered pipeline UI instances"""
|
||||
return list(_pipeline_uis.values())
|
||||
69
web/pipelines/demo.py
Normal file
69
web/pipelines/demo.py
Normal file
@@ -0,0 +1,69 @@
|
||||
# Copyright (C) 2025 AIDC-AI
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
Demo Pipeline UI
|
||||
|
||||
Implements a custom layout for the Demo Pipeline.
|
||||
"""
|
||||
|
||||
import streamlit as st
|
||||
from typing import Any
|
||||
from web.i18n import tr
|
||||
|
||||
from web.pipelines.base import PipelineUI, register_pipeline_ui
|
||||
|
||||
|
||||
class DemoPipelineUI(PipelineUI):
|
||||
"""
|
||||
Demo UI to verify the full-page plugin system.
|
||||
Uses a completely different layout (2 columns).
|
||||
"""
|
||||
name = "demo"
|
||||
icon = "✨"
|
||||
|
||||
@property
|
||||
def display_name(self):
|
||||
return tr("pipeline.demo.name")
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
return tr("pipeline.demo.description")
|
||||
|
||||
def render(self, pixelle_video: Any):
|
||||
st.markdown("### ✨ Demo Pipeline Custom Layout")
|
||||
st.info("This pipeline uses a custom 2-column layout, demonstrating full UI control.")
|
||||
|
||||
col1, col2 = st.columns([2, 1])
|
||||
|
||||
with col1:
|
||||
with st.container(border=True):
|
||||
st.subheader("1. Input")
|
||||
topic = st.text_input("Enter Topic", placeholder="e.g. AI News")
|
||||
mood = st.selectbox("Mood", ["Happy", "Serious", "Funny"])
|
||||
|
||||
st.markdown("---")
|
||||
st.subheader("2. Settings")
|
||||
# Simplified settings for demo
|
||||
n_scenes = st.slider("Scenes", 3, 10, 5)
|
||||
|
||||
with col2:
|
||||
with st.container(border=True):
|
||||
st.subheader("3. Generate")
|
||||
if st.button("🚀 Generate Demo Video", type="primary", use_container_width=True):
|
||||
# Mock generation logic or call backend
|
||||
st.success(f"Generating video for '{topic}' ({mood}) with {n_scenes} scenes...")
|
||||
st.balloons()
|
||||
|
||||
|
||||
# Register self
|
||||
register_pipeline_ui(DemoPipelineUI)
|
||||
84
web/pipelines/standard.py
Normal file
84
web/pipelines/standard.py
Normal file
@@ -0,0 +1,84 @@
|
||||
# Copyright (C) 2025 AIDC-AI
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
Standard Pipeline UI
|
||||
|
||||
Implements the classic 3-column layout for the Standard Pipeline.
|
||||
"""
|
||||
|
||||
import streamlit as st
|
||||
from typing import Any
|
||||
from web.i18n import tr
|
||||
|
||||
from web.pipelines.base import PipelineUI, register_pipeline_ui
|
||||
|
||||
# Import components
|
||||
from web.components.content_input import render_content_input, render_bgm_section, render_version_info
|
||||
from web.components.style_config import render_style_config
|
||||
from web.components.output_preview import render_output_preview
|
||||
|
||||
|
||||
class StandardPipelineUI(PipelineUI):
|
||||
"""
|
||||
UI for the Standard Video Generation Pipeline.
|
||||
Implements the classic 3-column layout.
|
||||
"""
|
||||
name = "standard"
|
||||
icon = "🎬"
|
||||
|
||||
@property
|
||||
def display_name(self):
|
||||
return tr("pipeline.standard.name")
|
||||
|
||||
def render(self, pixelle_video: Any):
|
||||
# Three-column layout
|
||||
left_col, middle_col, right_col = st.columns([1, 1, 1])
|
||||
|
||||
# ====================================================================
|
||||
# Left Column: Content Input & BGM
|
||||
# ====================================================================
|
||||
with left_col:
|
||||
# Content input (mode, text, title, n_scenes)
|
||||
content_params = render_content_input()
|
||||
|
||||
# BGM selection (bgm_path, bgm_volume)
|
||||
bgm_params = render_bgm_section()
|
||||
|
||||
# Version info & GitHub link
|
||||
render_version_info()
|
||||
|
||||
# ====================================================================
|
||||
# Middle Column: Style Configuration
|
||||
# ====================================================================
|
||||
with middle_col:
|
||||
# Style configuration (TTS, template, workflow, etc.)
|
||||
style_params = render_style_config(pixelle_video)
|
||||
|
||||
# ====================================================================
|
||||
# Right Column: Output Preview
|
||||
# ====================================================================
|
||||
with right_col:
|
||||
# Combine all parameters
|
||||
video_params = {
|
||||
"pipeline": self.name,
|
||||
**content_params,
|
||||
**bgm_params,
|
||||
**style_params
|
||||
}
|
||||
|
||||
# Render output preview (generate button, progress, video preview)
|
||||
render_output_preview(pixelle_video, video_params)
|
||||
|
||||
|
||||
# Register self
|
||||
register_pipeline_ui(StandardPipelineUI)
|
||||
Reference in New Issue
Block a user