Skip to content

Introduce a scene-based video generation pipeline with AI-powered visual validation - #1771

Open
cr7guez wants to merge 1 commit into
harry0703:mainfrom
cr7guez:main
Open

cr7guez wants to merge 1 commit into
harry0703:mainfrom
cr7guez:main

Conversation

@cr7guez

@cr7guez cr7guez commented Nov 4, 2026

Copy link
Copy Markdown

Overview

This PR introduces a new scene-based video generation pipeline for MoneyPrinterTurbo v1.3.9, designed to improve narrative coherence, visual relevance, and synchronization between narration and video content.

The new pipeline moves beyond the traditional approach of generating a script and distributing stock footage across the audio timeline. Instead, it introduces structured scene planning, scene-specific media selection, timeline orchestration, visual validation, and more advanced audiovisual composition.

The existing legacy pipeline remains available and is preserved as the default option to ensure backward compatibility.

Key Features & Improvements

1. Structured Scene Planning

  • Introduces versioned Pydantic models for structured video plans and individual scenes.
  • Generates scene plans from the existing LLM infrastructure.
  • Validates narration coverage, scene structure, and textual consistency.
  • Persists scene plans as video_plan.v1.json.
  • Keeps the existing script.json artifact unchanged.

2. Scene-Specific Media Search & Selection

  • Introduces media retrieval and selection at the individual scene level.
  • Uses scene descriptions and visual requirements to identify relevant footage.
  • Integrates with the existing stock media providers.
  • Supports visual matching workflows using TwelveLabs Pegasus.
  • Prevents scenes from being treated as validated when visual acceptance has not been established.

3. Timeline & Video Composition

  • Integrates scene plans into the video composition workflow.
  • Organizes selected media according to the planned narrative structure.
  • Connects scene timing, narration, subtitles, and audiovisual composition.
  • Preserves the existing rendering infrastructure.

4. AI-Assisted Visual Quality Control

  • Introduces TwelveLabs-based visual validation.
  • Supports evaluating whether selected footage actually represents the intended scene.
  • Applies configurable failure policies when visual validation or subsequent pipeline stages fail.

5. Subtitles & Scene Graphics

  • Extends subtitle and visual presentation capabilities.
  • Adds scene title labels.
  • Provides additional subtitle styling and background configuration.
  • Improves the presentation of scene-based content.

6. Audio & Rendering Improvements

  • Integrates the new scene workflow with audio composition.
  • Supports the updated export configuration and rendering pipeline.
  • Includes an offline audiovisual rendering test covering timeline alignment, subtitles, audio mixing, effects, export, and technical quality checks.

7. WebUI & Configuration

  • Adds WebUI controls for selecting the video generation pipeline.
  • Adds configurable scene pipeline failure policies.
  • Adds export profile selection.
  • Exposes visual validation configuration.
  • Updates configuration defaults and config.example.toml.
  • Documents the new pipeline in docs/scene-pipeline.md.

Pipeline Configuration

The new pipeline can be selected through the video_pipeline configuration:

  • legacy: Uses the existing video generation workflow.
  • scene: Uses the new structured scene-based workflow.

The scene pipeline also supports configurable failure policies:

  • legacy: Allows fallback to the traditional workflow when a scene pipeline stage fails.
  • fail: Stops generation when a required scene pipeline stage fails.

The legacy pipeline remains the default to avoid changing existing behavior for current users.

Testing & Validation

The implementation includes:

  • Unit tests for scene plan models and validation.
  • Tests for scene planning and artifact persistence.
  • Pipeline integration and fallback tests.
  • Offline end-to-end audiovisual rendering tests.
  • Configuration and translation validation.
  • Python compilation checks.
  • Git diff whitespace validation.

Latest reported test results:

  • 227 targeted tests passed.
  • 2 tests skipped.
  • Additional final validation: 23 tests passed.

The offline rendering test verifies the technical composition and export workflow using synthetic visual and audio assets.

Note: Full end-to-end validation with real external providers and real-world video content is still pending. Semantic visual matching with TwelveLabs Pegasus also requires a configured API key.

Backward Compatibility

  • The traditional pipeline remains available.
  • Existing providers and integrations are preserved.
  • Existing script artifacts remain unchanged.
  • The new scene-based workflow is opt-in.
  • Existing local configuration and unrelated working-tree changes have been preserved.

Documentation

  • Added docs/scene-pipeline.md.
  • Updated the project README documentation to reference the new pipeline.

Final Notes

This PR establishes the foundation for a more structured and content-aware video generation workflow, enabling MoneyPrinterTurbo to move from approximate footage distribution towards scene-driven video production with explicit narrative and visual relationships.

Real-provider acceptance testing and qualitative video assessment remain the next validation steps.

…ioned scene plans, media manifests, quality reports, and timelines to plan narration, search stock footage, validate visual matches with TwelveLabs, and synchronize selected media with subtitles or TTS cues. Preserve the legacy workflow as the default and configure whether scene failures fall back or stop task generation.\n\nExtend video rendering with configurable export profiles, render metrics, subtitle style presets, optional scene labels, and audio mixing controls for ducking, normalization, peak protection, fades, and local sound effects. Add WebUI controls, English and Chinese translations, example configuration, and scene pipeline documentation.\n\nAdd comprehensive service and integration coverage for scene planning, media selection, timeline rendering, audio, exports, task artifacts, API settings, and WebUI behavior. Include a Streamlit development skill with reference guides, app templates, and theme configurations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants