# alibaba/lumenx architecture

> Architecture diagram of the GitHub repository alibaba/lumenx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alibaba/lumenx
- Repository: https://github.com/alibaba/lumenx

## Overview

LumenX turns scripts and creative prompts into motion-comic/video assets, with a separate standalone generation workspace. The documented Studio workflow spans script analysis, art direction and assets, storyboard/video generation, audio, timeline assembly and export; Playground supports independent multi-model generation. Backend call edges use the source index or excerpts, while major product-stage links are documented in the README. Several UI and backend subsystems are represented by their exact source paths, but their internal wiring was not sampled.

Main entry points: [`src/apps/comic_gen/pipeline.py`](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/pipeline.py) (Studio pipeline), [`src/apps/playground/service.py`](https://github.com/alibaba/lumenx/blob/main/src/apps/playground/service.py) (Generation service), [`src/models/image.py`](https://github.com/alibaba/lumenx/blob/main/src/models/image.py) (Image adapter), [`src/apps/comic_gen/api.py`](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/api.py) (Studio API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Studio workflow"]
  node_project["Project workspace<br/>[ProjectClient.tsx]"]
  node_scriptui["Script editor<br/>[index.tsx]"]
  node_analysis["Script analysis<br/>[llm.py]"]
  node_entities["Entity and asset workbench"]
  node_artdirection["Art direction<br/>[ArtDirection.tsx]"]
  node_storyboard["Storyboard<br/>[storyboard.py]"]
  node_storyboardui["Storyboard R2V<br/>[StoryboardR2V.tsx]"]
  node_timeline["Timeline assembly<br/>[Timeline.tsx]"]
end

subgraph group_playground["Playground"]
  node_playui["Playground UI<br/>[PlaygroundPage.tsx]"]
  node_playapi["Playground API<br/>[api.py]"]
  node_playservice["Generation service<br/>[service.py]"]
  node_playstorage[("History and templates<br/>[storage.py]")]
  node_playmodels["Generation records<br/>[models.py]"]
end

subgraph group_backend["Studio backend"]
  node_assetgen["Asset generation<br/>[assets.py]"]
  node_videogen["Video generation<br/>[video.py]"]
  node_audio["Voice and audio<br/>[audio.py]"]
  node_export["Video export<br/>[export.py]"]
  node_comicapi["Studio API<br/>[api.py]"]
  node_pipeline["Studio pipeline<br/>[pipeline.py]"]
end

subgraph group_providers["AI and media services"]
  node_llmadapter["LLM adapter<br/>[llm_adapter.py]"]
  node_tts["TTS service<br/>[tts.py]"]
  node_modelcatalog["Model catalog<br/>[model_catalog.py]"]
  node_registry["Provider routing"]
  node_imageadapter["Image adapter<br/>[image.py]"]
  node_mulerouter["MuleRouter adapter<br/>[mulerouter.py]"]
  node_vidu["Vidu adapter<br/>[vidu.py]"]
  node_wanx["Wanx adapter<br/>[wanx.py]"]
  node_kling["Kling adapter<br/>[kling.py]"]
  node_base["Model interface<br/>[base.py]"]
  node_endpoints["Provider endpoints<br/>[endpoints.py]"]
  node_mediarefs["Media reference handling<br/>[media_refs.py]"]
  node_providermedia["Provider media resolver<br/>[provider_media.py]"]
end

subgraph group_frontend["Application shell"]
  node_app["Studio UI<br/>[page.tsx]"]
end

node_creator(("Creator"))

node_creator -->|"creates with"| node_app
node_app -->|"opens workspace"| node_project
node_project -->|"edits script"| node_scriptui
node_scriptui -.->|"submits script"| node_comicapi
node_comicapi -->|"delegates to"| node_pipeline
node_pipeline -->|"uses analysis"| node_analysis
node_analysis -->|"calls"| node_llmadapter
node_analysis -->|"extracts entities"| node_entities
node_entities -->|"generates assets"| node_assetgen
node_artdirection -->|"guides style"| node_assetgen
node_pipeline -->|"uses asset generation"| node_assetgen
node_pipeline -->|"uses storyboard"| node_storyboard
node_storyboard -->|"feeds video generation"| node_videogen
node_storyboardui -.->|"configures shots"| node_comicapi
node_pipeline -->|"uses video generation"| node_videogen
node_pipeline -->|"uses audio"| node_audio
node_audio -.->|"synthesizes speech"| node_tts
node_timeline -->|"assembles for export"| node_export
node_pipeline -->|"uses export"| node_export
node_creator -->|"uses independently"| node_playui
node_playui -.->|"requests generation"| node_playapi
node_playapi -.->|"dispatches"| node_playservice
node_playservice -->|"persists history"| node_playstorage
node_playstorage -->|"loads records"| node_playmodels
node_playservice -->|"generates images"| node_imageadapter
node_playservice -->|"routes generation"| node_mulerouter
node_playservice -->|"routes generation"| node_wanx
node_playservice -->|"routes generation"| node_kling
node_playservice -->|"routes generation"| node_vidu
node_pipeline -->|"uses catalog"| node_modelcatalog
node_modelcatalog -->|"builds routing"| node_registry
node_pipeline -->|"routes providers"| node_registry
node_imageadapter -->|"resolves provider"| node_registry
node_mulerouter -->|"implements"| node_base
node_vidu -->|"implements"| node_base
node_kling -->|"implements"| node_base
node_wanx -->|"implements"| node_base
node_imageadapter -->|"gets provider URL"| node_endpoints
node_providermedia -->|"resolves input mode"| node_registry
node_providermedia -->|"classifies references"| node_mediarefs
node_imageadapter -->|"resolves media inputs"| node_providermedia
node_comicapi -->|"mounts routes"| node_playapi

click node_app "https://github.com/alibaba/lumenx/blob/main/frontend/src/app/page.tsx"
click node_project "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/project/ProjectClient.tsx"
click node_scriptui "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/ScriptEditor/index.tsx"
click node_analysis "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/llm.py"
click node_llmadapter "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/llm_adapter.py"
click node_entities "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/CharacterWorkbench.tsx"
click node_assetgen "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/assets.py"
click node_artdirection "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/ArtDirection.tsx"
click node_storyboard "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/storyboard.py"
click node_storyboardui "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/StoryboardR2V.tsx"
click node_videogen "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/video.py"
click node_audio "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/audio.py"
click node_tts "https://github.com/alibaba/lumenx/blob/main/src/audio/tts.py"
click node_timeline "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/Timeline.tsx"
click node_export "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/export.py"
click node_comicapi "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/api.py"
click node_pipeline "https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/pipeline.py"
click node_playui "https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/playground/PlaygroundPage.tsx"
click node_playapi "https://github.com/alibaba/lumenx/blob/main/src/apps/playground/api.py"
click node_playservice "https://github.com/alibaba/lumenx/blob/main/src/apps/playground/service.py"
click node_playstorage "https://github.com/alibaba/lumenx/blob/main/src/apps/playground/storage.py"
click node_playmodels "https://github.com/alibaba/lumenx/blob/main/src/apps/playground/models.py"
click node_modelcatalog "https://github.com/alibaba/lumenx/blob/main/src/utils/model_catalog.py"
click node_registry "https://github.com/alibaba/lumenx/blob/main/src/utils/provider_registry.py"
click node_imageadapter "https://github.com/alibaba/lumenx/blob/main/src/models/image.py"
click node_mulerouter "https://github.com/alibaba/lumenx/blob/main/src/models/mulerouter.py"
click node_vidu "https://github.com/alibaba/lumenx/blob/main/src/models/vidu.py"
click node_wanx "https://github.com/alibaba/lumenx/blob/main/src/models/wanx.py"
click node_kling "https://github.com/alibaba/lumenx/blob/main/src/models/kling.py"
click node_base "https://github.com/alibaba/lumenx/blob/main/src/models/base.py"
click node_endpoints "https://github.com/alibaba/lumenx/blob/main/src/utils/endpoints.py"
click node_mediarefs "https://github.com/alibaba/lumenx/blob/main/src/utils/media_refs.py"
click node_providermedia "https://github.com/alibaba/lumenx/blob/main/src/utils/provider_media.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_project,node_scriptui,node_analysis,node_entities,node_artdirection,node_storyboard,node_storyboardui,node_timeline toneBlue
class node_playui,node_playapi,node_playservice,node_playstorage,node_playmodels toneAmber
class node_assetgen,node_videogen,node_audio,node_export,node_comicapi,node_pipeline toneMint
class node_llmadapter,node_tts,node_modelcatalog,node_registry,node_imageadapter,node_mulerouter,node_vidu,node_wanx,node_kling,node_base,node_endpoints,node_mediarefs,node_providermedia toneRose
class node_app,node_creator toneIndigo
```

## Components

### Studio workflow

- [Project workspace](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/project/ProjectClient.tsx): `frontend/src/components/project/ProjectClient.tsx`
- [Script editor](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/ScriptEditor/index.tsx): `frontend/src/components/modules/ScriptEditor/index.tsx`
- [Script analysis](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/llm.py): `src/apps/comic_gen/llm.py`
- [Entity and asset workbench](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/CharacterWorkbench.tsx): `frontend/src/components/modules/CharacterWorkbench.tsx`
- [Art direction](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/ArtDirection.tsx): `frontend/src/components/modules/ArtDirection.tsx`
- [Storyboard](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/storyboard.py): `src/apps/comic_gen/storyboard.py`
- [Storyboard R2V](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/StoryboardR2V.tsx): `frontend/src/components/modules/StoryboardR2V.tsx`
- [Timeline assembly](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/Timeline.tsx): `frontend/src/components/modules/Timeline.tsx`

### Playground

- [Playground UI](https://github.com/alibaba/lumenx/blob/main/frontend/src/components/modules/playground/PlaygroundPage.tsx): `frontend/src/components/modules/playground/PlaygroundPage.tsx`
- [Playground API](https://github.com/alibaba/lumenx/blob/main/src/apps/playground/api.py): `src/apps/playground/api.py`
- [Generation service](https://github.com/alibaba/lumenx/blob/main/src/apps/playground/service.py): `src/apps/playground/service.py`
- [History and templates](https://github.com/alibaba/lumenx/blob/main/src/apps/playground/storage.py): `src/apps/playground/storage.py`
- [Generation records](https://github.com/alibaba/lumenx/blob/main/src/apps/playground/models.py): `src/apps/playground/models.py`

### Studio backend

- [Asset generation](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/assets.py): `src/apps/comic_gen/assets.py`
- [Video generation](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/video.py): `src/apps/comic_gen/video.py`
- [Voice and audio](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/audio.py): `src/apps/comic_gen/audio.py`
- [Video export](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/export.py): `src/apps/comic_gen/export.py`
- [Studio API](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/api.py): `src/apps/comic_gen/api.py`
- [Studio pipeline](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/pipeline.py): `src/apps/comic_gen/pipeline.py`

### AI and media services

- [LLM adapter](https://github.com/alibaba/lumenx/blob/main/src/apps/comic_gen/llm_adapter.py): `src/apps/comic_gen/llm_adapter.py`
- [TTS service](https://github.com/alibaba/lumenx/blob/main/src/audio/tts.py): `src/audio/tts.py`
- [Model catalog](https://github.com/alibaba/lumenx/blob/main/src/utils/model_catalog.py): `src/utils/model_catalog.py`
- [Provider routing](https://github.com/alibaba/lumenx/blob/main/src/utils/provider_registry.py): `src/utils/provider_registry.py`
- [Image adapter](https://github.com/alibaba/lumenx/blob/main/src/models/image.py): `src/models/image.py`
- [MuleRouter adapter](https://github.com/alibaba/lumenx/blob/main/src/models/mulerouter.py): `src/models/mulerouter.py`
- [Vidu adapter](https://github.com/alibaba/lumenx/blob/main/src/models/vidu.py): `src/models/vidu.py`
- [Wanx adapter](https://github.com/alibaba/lumenx/blob/main/src/models/wanx.py): `src/models/wanx.py`
- [Kling adapter](https://github.com/alibaba/lumenx/blob/main/src/models/kling.py): `src/models/kling.py`
- [Model interface](https://github.com/alibaba/lumenx/blob/main/src/models/base.py): `src/models/base.py`
- [Provider endpoints](https://github.com/alibaba/lumenx/blob/main/src/utils/endpoints.py): `src/utils/endpoints.py`
- [Media reference handling](https://github.com/alibaba/lumenx/blob/main/src/utils/media_refs.py): `src/utils/media_refs.py`
- [Provider media resolver](https://github.com/alibaba/lumenx/blob/main/src/utils/provider_media.py): `src/utils/provider_media.py`

### Application shell

- [Studio UI](https://github.com/alibaba/lumenx/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`

### Other components

- **Creator**

## Connections

- Creator → Studio UI: creates with (evidence: `README.md`)
- Studio UI → Project workspace: opens workspace (evidence: `README.md`)
- Project workspace → Script editor: edits script (evidence: `README.md`)
- Script editor → Studio API: submits script
- Studio API → Studio pipeline: delegates to (evidence: `src/apps/comic_gen/api.py`)
- Studio pipeline → Script analysis: uses analysis (evidence: `src/apps/comic_gen/pipeline.py`)
- Script analysis → LLM adapter: calls (evidence: `src/apps/comic_gen/llm.py`)
- Script analysis → Entity and asset workbench: extracts entities (evidence: `README.md`)
- Entity and asset workbench → Asset generation: generates assets (evidence: `README.md`)
- Art direction → Asset generation: guides style (evidence: `README.md`)
- Studio pipeline → Asset generation: uses asset generation (evidence: `src/apps/comic_gen/pipeline.py`)
- Studio pipeline → Storyboard: uses storyboard (evidence: `src/apps/comic_gen/pipeline.py`)
- Storyboard → Video generation: feeds video generation (evidence: `README.md`)
- Storyboard R2V → Studio API: configures shots
- Studio pipeline → Video generation: uses video generation (evidence: `src/apps/comic_gen/pipeline.py`)
- Studio pipeline → Voice and audio: uses audio (evidence: `src/apps/comic_gen/pipeline.py`)
- Voice and audio → TTS service: synthesizes speech
- Timeline assembly → Video export: assembles for export (evidence: `README.md`)
- Studio pipeline → Video export: uses export (evidence: `src/apps/comic_gen/pipeline.py`)
- Creator → Playground UI: uses independently (evidence: `README.md`)
- Playground UI → Playground API: requests generation
- Playground API → Generation service: dispatches
- Generation service → History and templates: persists history (evidence: `src/apps/playground/service.py`)
- History and templates → Generation records: loads records (evidence: `src/apps/playground/storage.py`)
- Generation service → Image adapter: generates images (evidence: `src/apps/playground/service.py`)
- Generation service → MuleRouter adapter: routes generation (evidence: `src/apps/playground/service.py`)
- Generation service → Wanx adapter: routes generation (evidence: `src/apps/playground/service.py`)
- Generation service → Kling adapter: routes generation (evidence: `src/apps/playground/service.py`)
- Generation service → Vidu adapter: routes generation (evidence: `src/apps/playground/service.py`)
- Studio pipeline → Model catalog: uses catalog (evidence: `src/apps/comic_gen/pipeline.py`)
- Model catalog → Provider routing: builds routing (evidence: `src/utils/provider_registry.py`)
- Studio pipeline → Provider routing: routes providers (evidence: `src/apps/comic_gen/pipeline.py`)
- Image adapter → Provider routing: resolves provider (evidence: `src/models/image.py`)
- MuleRouter adapter → Model interface: implements (evidence: `src/models/mulerouter.py`)
- Vidu adapter → Model interface: implements (evidence: `src/models/vidu.py`)
- Kling adapter → Model interface: implements (evidence: `src/models/kling.py`)
- Wanx adapter → Model interface: implements (evidence: `src/models/wanx.py`)
- Image adapter → Provider endpoints: gets provider URL (evidence: `src/models/image.py`)
- Provider media resolver → Provider routing: resolves input mode (evidence: `src/utils/provider_media.py`)
- Provider media resolver → Media reference handling: classifies references (evidence: `src/utils/provider_media.py`)
- Image adapter → Provider media resolver: resolves media inputs (evidence: `src/models/image.py`)
- Studio API → Playground API: mounts routes (evidence: `src/apps/comic_gen/api.py`)
