项目简介
ViMax 是一个全能智能体视频生成平台,集导演、编剧、制片人及视频生成于一身。它能够根据原始创意、完整小说或剧本自主创建分镜、角色和最终视频,支持创意转视频、小说改编、剧本创作及个人出镜等多种模式。
README 预览
\n \n \n \n\n ViMax: Agentic Video Generation\n\n \n \n\n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n\n\n \n\n \n \n\n \n \n \n\n\n\n---\n\n### 🚨 Current Video Generation Limitations:\n- ❌ **Limited to Short Clips** - Most AI tools generate only seconds of footage. \n- ❌ **Consistency Chaos** - Characters and scenes change unpredictably across frames. \n- ❌ **Visual-Only Focus** - Missing scripts, audio, narrative structure, and storytelling depth. \n\n### 💡 ViMax Solution:\n🎬 **Director**, **Screenwriter**, **Producer**, and **Video Generator** **All-in-One**! We're exploring a future where AI becomes a complete creative powerhouse. 💡 Simply input your concept. ViMax autonomously handles the rest. It orchestrates scriptwriting, storyboarding, character creation, and final video generation—all end-to-end. 🚀\n\nhttps://github.com/user-attachments/assets/5bad46b2-8276-4e1d-9480-3522640744b2\n\n\n\n\n\n---\n\n\n## 📑 Table of Contents\n\n- [💡 Key Features](#key-features)\n- [🔮 Demos](#Video-Demos-Generated-from-Scratch)\n- [🏗️ Architecture](#️-architecture)\n- [🚀 Quick Start](#quick-start)\n\n---\n## 💡Key Features\n\n\n\n\n\n\n\n\n🌟 Idea2Video\n\n\n\n \n\n\n\nFrom Spark to Screen\n\n\n\nTransform raw ideas into complete video stories through intelligent multi-agent workflows automating storytelling, character design, and production .\n\n\n\n\n\n\n\n\n\n🎨 Novel2Video\n\n\n\n \n\n\n\nSmart Literary Adaptation Engine\n\n\n\nTransform complete novels into episodic video content with intelligent narrative compression, character tracking, and scene-by-scene visual adaptation\n\n\n\n\n\n\n\n\n⚙️ Script2Video\n\n\n\n \n\n\n\nUnlimited Screenplay Video Creation\n\n\n\nUnleash your creativity by writing any screenplay from personal stories to epic adventures, giving you complete control over every aspect of your visual storytelling.\n\n\n\n\n\n\n\n\n\n\n🤳 AutoCameo\n\n\n\n \n\n\n\nGenerate Video from Your Photo\n\n\n\n Crea
常见问题 (2)
故障排除当 LLM 为非 Optional 的 Pydantic 字段返回 null 时,如何修复 LangChain OutputParserException?
故障排除
当 LLM 为非 Optional 的 Pydantic 字段返回 null 时,如何修复 LangChain OutputParserException?出现此错误是因为 Pydantic 会拒绝为类型标注为 int、bool 或 str 的必填字段传入 null。请将 LLM 可能返回为 null 的每个字段都声明为 Optional,并为其设置默认值 None:
from typing import Optional
from pydantic import BaseModel, Field, model_validator
class CameraParentItem(BaseModel):
parent_cam_idx: Optional[int] = Field(
default=None,
description="The index of the parent camera. Use null for the root camera.",
examples=[0, 1, None],
)
parent_shot_idx: Optional[int] = Field(
default=None,
description="The index of the dependent shot. Use null for the root shot.",
examples=[0, 3, None],
)
reason: Optional[str] = Field(
default=None,
description="The reason for selecting the parent camera.",
)
is_parent_fully_covers_child: Optional[bool] = Field(
default=None,
description="Whether the parent camera fully covers the child camera's content.",
examples=[True, False, None],
)
missing_info: Optional[str] = Field(
default=None,
description="Elements in the child shot not covered by the parent shot. Set to null when fully covered.",
)
如果只有根项允许具有 null 父级引用,请添加验证,以确保非根项仍能保持有效:
@model_validator(mode="after")
def validate_root_item(self):
if self.parent_cam_idx is None or self.parent_shot_idx is None:
if self.reason is None or "root" not in self.reason.lower():
raise ValueError("Only the root camera/shot may have null parent indices")
return self
同时,请更新 LLM 的提示词,明确说明 parent_cam_idx 和 parent_shot_idx 仅在根项中应为 null;在其他情况下它们必须是整数。
故障排除如何修复 ViMax 中的 "'Novel2MoviePipeline' object has no attribute 'working_dir'" 错误?
故障排除
如何修复 ViMax 中的 "'Novel2MoviePipeline' object has no attribute 'working_dir'" 错误?在 Novel2MoviePipeline.__init__ 中定义缺失的属性。该 pipeline 使用了 self.working_dir、self.embeddings 和 self.novel_compressor,但并未对它们进行赋值。添加如下初始化方法:
from pathlib import Path
class Novel2MoviePipeline:
def __init__(self, embeddings, novel_compressor, working_dir="output", ...):
self.embeddings = embeddings
self.novel_compressor = novel_compressor
self.working_dir = Path(working_dir)
self.working_dir.mkdir(parents=True, exist_ok=True)
在实例化该 pipeline 时传入所需的依赖项,并更新过时的导入,使其使用当前的 interfaces 包。此问题已由针对 issue #43 的 PR "fix: initialize Novel2MoviePipeline dependencies" 修复。