How vishwaksen21/media-gen works
This is a brand-compliant image and video generation platform with explicit human approval, append-only versions, and asynchronous generation jobs. Users enter through the React workspace; image and video workflows progress through reviewable domain stages, while backend services coordinate providers, validation, media storage, persistence, and finalization. The README documents workflow stages that are not all represented by sampled source, so those relationships are cited to it; uncertain implementation details are omitted.
Main entry points: VideoWorkflowPage.tsx Video workflow · scene_generation_service.py Scene generation service · routes HTTP API · image_service.py Image workflow service
Components 26
User workspace
- Workspace routes
frontend/src/App.tsx
Image workflow
- Image generation
frontend/src/features/images/ImageGenerationPage.tsx
Video workflow
- Video workflow
frontend/src/features/video/VideoWorkflowPage.tsx - Storyline review
frontend/src/features/video/StorylineStep.tsx - Scene review
frontend/src/features/video/ScenesStep.tsx - Reference approval
frontend/src/features/video/ReferencesStep.tsx - Scene generation review
frontend/src/features/video/SceneGenerationStep.tsx - Timeline editing
frontend/src/features/video/TimelineStep.tsx - Final video review
frontend/src/features/video/FinalVideoStep.tsx - FFmpeg composition
backend/app/composition/ffmpeg.py
Backend services
- HTTP API
backend/app/api/routes - Image workflow service
backend/app/application/image_service.py - Story and scene services
backend/app/application/story_service.py - Reference service
backend/app/application/reference_service.py - Scene generation service
backend/app/application/scene_generation_service.py - Prompt compilation
backend/app/application/prompting.py - Media validation
backend/app/validation/validators.py - Job creation
backend/app/application/generation_service.py - Video finalization
backend/app/application/finalization_service.py - Brand guidance
backend/app/brand/projections.py
Runtime infrastructure
- Job execution
backend/app/workers/generation_worker.py - AI provider
backend/app/providers/base.py - Media storage
backend/app/storage - Tenant data
backend/app/infrastructure/db/repositories.py - Job queue
backend/app/infrastructure/queue
Other components
- Reviewer
Connections 42
- Reviewer → Workspace routes: uses
frontend/src/App.tsx - Workspace routes → Image generation: routes to
frontend/src/App.tsx - Workspace routes → Video workflow: routes to
frontend/src/App.tsx - Reviewer → Image generation: submits and reviews
README.md - Image generation → HTTP API: requests workflow
- Video workflow → Storyline review: presents
- Video workflow → Scene review: presents
- Video workflow → Reference approval: presents
- Video workflow → Scene generation review: presents
frontend/src/features/video/SceneGenerationStep.tsx - Video workflow → Timeline editing: presents
- Video workflow → Final video review: presents
- Reviewer → Storyline review: reviews and approves
README.md - Reviewer → Scene review: reviews and approves
README.md - Reviewer → Reference approval: pins versions
README.md - Reviewer → Scene generation review: reviews or regenerates
README.md - Reviewer → Timeline editing: edits
README.md - Reviewer → Final video review: accepts or edits
README.md - HTTP API → Image workflow service: dispatches
- HTTP API → Story and scene services: dispatches
- HTTP API → Reference service: dispatches
- HTTP API → Scene generation service: dispatches
- Image workflow service → Job creation: creates jobs
backend/app/application/image_service.py - Image workflow service → Prompt compilation: compiles prompts
backend/app/application/image_service.py - Image workflow service → Media validation: validates requests
backend/app/application/image_service.py - Story and scene services → Prompt compilation: compiles prompts
backend/app/application/prompting.py - Story and scene services → Job creation: creates jobs
- Reference service → Prompt compilation: uses prompt tools
backend/app/application/reference_service.py - Reference service → Job creation: creates jobs
backend/app/application/reference_service.py - Scene generation service → Prompt compilation: compiles prompts
backend/app/application/scene_generation_service.py - Scene generation service → Job creation: creates jobs
backend/app/application/scene_generation_service.py - Scene generation service → Media validation: validates results
backend/app/application/scene_generation_service.py - Image workflow service → Brand guidance: uses projections
backend/app/application/image_service.py - Scene generation service → Brand guidance: uses projections
backend/app/application/scene_generation_service.py - Job creation → Job queue: enqueues jobs
backend/app/application/generation_service.py - Job execution → AI provider: runs generation
- Job execution → Tenant data: records job state
backend/app/workers/generation_worker.py - AI provider → Media storage: returns media
- Scene generation service → FFmpeg composition: composes approved takes
backend/app/application/scene_generation_service.py - FFmpeg composition → Media validation: probes output
backend/app/composition/ffmpeg.py - Video finalization → Tenant data: finalizes workflow
- Video finalization → Media storage: retains final video
README.md - Reviewer → Image generation: approves asset
README.md