How aidc-ai/pixelle-video works
1. What this repo is
Pixelle-Video is a Python-based AI video generation platform with two user-facing entry points: a Streamlit web UI for interactive creation and a FastAPI backend for programmatic control. The core product is an orchestration engine that turns a topic or script into a finished short video.
2. Top-level architecture
The repository is split into four main layers:
- Presentation: web/ for the Streamlit app, api/ for HTTP endpoints
- Orchestration/core: pixelle_video/ for pipelines, services, prompts, and config
- Assets and execution artifacts: templates/, workflows/, bgm/, output/-style generated files
- Docs and packaging: docs/, packaging/, Docker and Windows packaging scripts
3. Primary generation flow
The central data flow is: topic/script input → script generation → storyboard/media planning → image/video generation → TTS narration → frame assembly → final video composition. The README’s “one topic to full video” workflow is reflected in the pixelle_video/pipelines/ and pixelle_video/services/ modules.
4. Core orchestration layer
pixelle_video/service.py and the pipeline modules under pixelle_video/pipelines/ are the main coordination layer. The available pipeline variants indicate the system can generate videos in different modes:
- standard / linear: default end-to-end automation
- asset_based: builds videos from user-provided assets
- custom: user-defined workflow composition
This layer is the boundary that decides which services to call and in what order.
5. Service layer responsibilities
pixelle_video/services/ contains the concrete integrations and media-processing logic:
- llm_service.py for language-model calls and text generation
- tts_service.py for text-to-speech generation
- video.py and media.py for media assembly/handling
- frame_processor.py and frame_html.py for template-driven frame rendering
- image_analysis.py and video_analysis.py for understanding uploaded media
- persistence.py and history_manager.py for saving and retrieving past jobs
This layer sits between the orchestration pipelines and external AI/media systems.
6. External AI/runtime boundaries
The repo is designed around pluggable AI backends rather than one fixed model provider:
- LLMs: GPT, Qwen, DeepSeek, Ollama, etc.
- Image/video generation: primarily ComfyUI-compatible workflows
- Cloud or self-hosted execution: workflows/runninghub/ and workflows/selfhost/ show two deployment modes
- TTS: Edge-TTS, Index-TTS, and other workflow-backed voice engines
These are not embedded models; they are called through configured services and workflow JSON files.
7. Workflow-as-configuration model
The workflows/ directory is a major architectural boundary. It stores JSON definitions for ComfyUI-style workflows for image generation, video generation, TTS, and media analysis. The application scans these workflows and lets the user choose them at runtime, which makes the system highly extensible without changing Python code.
8. Template-driven rendering
templates/ contains HTML templates grouped by resolution and media type:
- static_*.html
- image_*.html
- video_*.html
These templates define the visual layout of each video frame. The frame processor and template utilities turn generated content into rendered frames, so the template layer is a separate presentation subsystem from the web UI.
9. API backend
api/ exposes functional endpoints for the generation platform. The router split shows the backend surface area:
- content/script generation
- file handling
- frame generation
- image, LLM, TTS, and video endpoints
- resources/config discovery
- task management
- health checks
This API is likely the integration point for external clients and for the web app if it delegates generation work over HTTP.
10. Async job management
api/tasks/ contains task models and a manager, indicating generation is handled as background work rather than a single synchronous request. That fits the long-running nature of LLM, image, TTS, and video composition jobs. The UI likely polls task status or receives progress updates from this layer.
11. Web UI composition
web/ is a Streamlit application with reusable components, page modules, i18n, session state, and UI-side pipeline helpers. It provides the interactive experience described in the README: configuration panels, content input, voice settings, visual settings, generation, preview, and history. The web layer is presentation-only; it orchestrates user input and displays progress/results.
12. Config and runtime state
Configuration is handled through pixelle_video/config/ plus api/config.py, with a sample YAML config at the repo root. The system supports first-run setup for model endpoints, API keys, and workflow selection. UI session state in web/state/session.py keeps per-user runtime choices separate from persistent project configuration.
13. Media and history storage
The project appears to use the filesystem as the primary persistence boundary: background music under bgm/, generated outputs saved locally, and history managed through service classes rather than a relational database. That means the architecture is closer to a file-backed media pipeline than a database-centered application.
14. Deployment and packaging
The repo supports several delivery modes: local source execution, Docker, devcontainer, and a Windows bundled release. The packaging and startup scripts show that the app is meant to run as a self-hosted creative workstation, with optional cloud services for generation workloads.
15. How to draw the diagram
A good architecture diagram should show:
- User → Streamlit UI / FastAPI API
- UI/API → orchestration pipelines
- Pipelines → services
- Services → external LLM / ComfyUI / TTS providers
- Rendering services → templates/workflows/filesystem
- Background task manager → progress/history storage
The key idea is that Pixelle-Video is an orchestration platform for multi-step AI media generation, not a single-model app.
Main entry points: service.py Service Core · linear.py Linear · workflows Workflows · manager.py Config
Components 23
Presentation
User-facing entry points for interactive and programmatic use
- Web UI · Interactive creation interface for content input, settings, generation, preview, and history
web/app.py - API · HTTP backend exposing generation, files, tasks, and health endpoints
api/app.py - Standard UI · Main Streamlit flow for guided video creation
web/pipelines/standard.py - Asset UI · UI flow for assembling videos from uploaded or user-provided assets
web/pipelines/asset_based.py - Action Transfer · Bridges UI actions into the underlying generation pipeline
web/pipelines/action_transfer.py
Orchestration Core
Central pipelines and coordination logic for video generation
- Service Core · Coordinates pipeline execution and service calls across generation modes
pixelle_video/service.py - Standard · Default end-to-end topic-to-video pipeline
pixelle_video/pipelines/standard.py - Linear · Sequential pipeline implementation for the core generation flow
pixelle_video/pipelines/linear.py - Asset Based · Pipeline for building videos from provided assets
pixelle_video/pipelines/asset_based.py - Custom · User-composed workflow pipeline
pixelle_video/pipelines/custom.py - Pipeline Base · Shared pipeline interface and common execution behavior
pixelle_video/pipelines/base.py - Storyboards · Structured video planning objects used by orchestration and services
pixelle_video/models/storyboard.py - Media Models · Media and progress data structures shared across generation and API layers
pixelle_video/models/media.py
Media Services
Concrete integrations for LLM, TTS, analysis, rendering, and assembly
- LLM Service · Language-model integration for scripts, titles, prompts, and narration text
pixelle_video/services/llm_service.py - TTS Service · Text-to-speech generation and voice configuration integration
pixelle_video/services/tts_service.py - Frame Processor · Transforms content into rendered video frames using templates
pixelle_video/services/frame_processor.py - Video Service · Assembles frames, audio, and media into final video outputs
pixelle_video/services/video.py - Analysis · Image and video analysis for uploaded media and workflow selection
pixelle_video/services/image_analysis.py
Workflows and Templates
Workflow JSON and HTML templates used at runtime
Config and State
Configuration, task management, and stored job history
- History Store · File-backed persistence and job history management
pixelle_video/services/persistence.py - Task Manager · Manages asynchronous long-running generation tasks and status tracking
api/tasks/manager.py - Config · Loads and validates application configuration and presets
pixelle_video/config/manager.py
Connections 29
- Web UI → Standard UI: drives · The UI routes user actions into the standard generation flow
- Web UI → Asset UI: drives · The UI supports asset-based creation when users provide source media
- Standard UI → Action Transfer: delegates · UI pipeline helpers transfer requests into execution logic
- Asset UI → Action Transfer: delegates · Asset-based UI shares the same action-transfer layer
- API → Task Manager: dispatches · API endpoints submit long-running work to background tasks
- Task Manager → Service Core: runs · Tasks invoke orchestration for generation jobs
- Service Core → Pipeline Base: uses · The coordinator selects a pipeline implementation
- Service Core → Standard: selects · Default end-to-end automation path
- Service Core → Asset Based: selects · Asset-driven generation path
- Service Core → Custom: selects · User-defined composition path
- Standard → Linear: implements · Standard mode is realized through the linear execution flow
- Linear → LLM Service: calls · Generates topic, script, titles, and narration text
- Linear → Analysis: calls · Analyzes source images and videos when needed
- Linear → TTS Service: calls · Produces narration audio
- Linear → Frame Processor: calls · Renders frames from generated content and templates
- Linear → Video Service: calls · Composes final video artifacts
- Frame Processor → Templates: renders with · Uses HTML templates as frame layouts
- LLM Service → Workflows: backs onto · LLM and related generation modes can be driven by workflow definitions
- TTS Service → Workflows: backs onto · Voice synthesis may use workflow-backed engines
- Analysis → Workflows: backs onto · Media understanding integrations can be workflow-defined
- Video Service → Workflows: uses · Video generation and enhancement can delegate to workflow JSON
- Config → Workflows: discovers · Configuration resolves available workflows and runtime choices
- Config → Task Manager: configures · Task behavior depends on runtime configuration
- History Store → Task Manager: stores · History and persisted job data support background execution
- API → Config: loads · API bootstrapping uses shared configuration
- Web UI → Config: loads · Web UI initializes from the shared runtime configuration
- Service Core → Storyboards: builds · Pipelines produce and consume storyboard structures
- Service Core → Media Models: tracks · Generation outputs and progress move through shared media models
- API → History Store: reads/writes · API surfaces stored histories and media artifacts