# mherick/open-generative-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mherick/open-generative-ai
- Repository: https://github.com/mherick/open-generative-ai
- Video tour (about a minute): https://gitdiagram.com/mherick/open-generative-ai/video

## Overview

Open Generative AI is a multi-studio generative-media application with hosted web and Electron desktop entry points. The principal workflow is selecting a studio, configuring a generation, submitting it through the MuAPI-facing client/API, and receiving generated media. The README also identifies workflow, agent, clipping, marketing, and other specialized studios. The graph includes the documented studio surface and the sampled desktop local-inference path; implementation details for unsampled studio internals are limited to what the tree and README support.

Main entry points: [`app/studio/[[...slug]]/page.js`](https://github.com/mherick/open-generative-ai/blob/main/app/studio/%5B%5B...slug%5D%5D/page.js) (Web app routes), [`packages/studio/src/muapi.js`](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/muapi.js) (Studio API client), [`app/api/app/[[...path]]/route.js`](https://github.com/mherick/open-generative-ai/blob/main/app/api/app/%5B%5B...path%5D%5D/route.js) (App API proxy), [`src/lib/localInferenceClient.js`](https://github.com/mherick/open-generative-ai/blob/main/src/lib/localInferenceClient.js) (Local inference client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Studio experience"]
  node_web["Web app routes<br/>[page.js]"]
  node_desktop_shell["Desktop shell<br/>[main.js]"]
  node_image["Image studio<br/>[ImageStudio.jsx]"]
  node_video["Video studio<br/>[VideoStudio.jsx]"]
  node_audio["Audio studio<br/>[AudioStudio.jsx]"]
  node_lipsync["Lip sync studio<br/>[LipSyncStudio.jsx]"]
  node_cinema["Cinema studio<br/>[CinemaStudio.jsx]"]
  node_workflow["Workflow studio<br/>[WorkflowStudio.jsx]"]
  node_agents["Agent studios<br/>[AgentStudio.jsx]"]
  node_specialized["Specialized studios<br/>[ClippingStudio.jsx]"]
  node_workflow_page["Workflow pages<br/>[page.js]"]
  node_agent_pages["Agent pages<br/>[page.js]"]
end

subgraph group_generation["Generation services"]
  node_studio_api["Studio API client<br/>[muapi.js]"]
  node_app_proxy["App API proxy<br/>[route.js]"]
  node_workflow_proxy["Workflow API proxy<br/>[route.js]"]
  node_agent_proxy["Agent API proxy<br/>[route.js]"]
  node_upload_proxy["Binary upload proxy<br/>[route.js]"]
end

subgraph group_desktop["Desktop local AI"]
  node_manager["Local model manager"]
  node_local_client["Local inference client"]
  node_electron_main["Electron IPC host<br/>[main.js]"]
  node_local_engine["Local inference providers<br/>[localInference.js]"]
  node_wan_provider["Wan2GP provider<br/>[wan2gpProvider.js]"]
end

node_user(("User"))
node_muapi{{"MuAPI service"}}
node_wan_server{{"Wan2GP server"}}
node_s3[("S3 upload storage")]

node_user -->|"opens studio"| node_web
node_user -->|"opens desktop"| node_desktop_shell
node_web -->|"selects studio"| node_image
node_web -->|"selects studio"| node_video
node_web -->|"selects studio"| node_audio
node_web -->|"selects studio"| node_lipsync
node_web -->|"selects studio"| node_cinema
node_web -->|"selects studio"| node_workflow
node_web -->|"selects studio"| node_agents
node_web -->|"selects studio"| node_specialized
node_user -->|"opens workflow"| node_workflow_page
node_user -->|"opens agent"| node_agent_pages
node_image -->|"submits generation"| node_studio_api
node_video -->|"submits generation"| node_studio_api
node_audio -->|"submits generation"| node_studio_api
node_lipsync -->|"submits generation"| node_studio_api
node_cinema -->|"submits generation"| node_studio_api
node_studio_api -->|"requests API"| node_app_proxy
node_app_proxy -->|"forwards request"| node_muapi
node_workflow_page -->|"requests workflow"| node_workflow_proxy
node_workflow -->|"requests workflow"| node_workflow_proxy
node_workflow_proxy -->|"forwards request"| node_muapi
node_agent_pages -->|"requests agent"| node_agent_proxy
node_agents -->|"requests agent"| node_agent_proxy
node_agent_proxy -->|"forwards request"| node_muapi
node_manager -->|"manages models"| node_local_client
node_local_client -->|"invokes IPC"| node_electron_main
node_electron_main -->|"registers handlers"| node_local_engine
node_electron_main -->|"registers handlers"| node_wan_provider
node_local_client -->|"dispatches generation"| node_wan_provider
node_wan_provider -.->|"uploads and generates"| node_wan_server
node_app_proxy -->|"redirects binary upload"| node_upload_proxy
node_upload_proxy -->|"posts file"| node_s3

click node_web "https://github.com/mherick/open-generative-ai/blob/main/app/studio/%5B%5B...slug%5D%5D/page.js"
click node_desktop_shell "https://github.com/mherick/open-generative-ai/blob/main/src/main.js"
click node_image "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/ImageStudio.jsx"
click node_video "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/VideoStudio.jsx"
click node_audio "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/AudioStudio.jsx"
click node_lipsync "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/LipSyncStudio.jsx"
click node_cinema "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/CinemaStudio.jsx"
click node_workflow "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/WorkflowStudio.jsx"
click node_agents "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/AgentStudio.jsx"
click node_specialized "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/ClippingStudio.jsx"
click node_workflow_page "https://github.com/mherick/open-generative-ai/blob/main/app/workflow/%5Bid%5D/page.js"
click node_agent_pages "https://github.com/mherick/open-generative-ai/blob/main/app/agents/%5Bagent_id%5D/page.js"
click node_studio_api "https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/muapi.js"
click node_app_proxy "https://github.com/mherick/open-generative-ai/blob/main/app/api/app/%5B%5B...path%5D%5D/route.js"
click node_workflow_proxy "https://github.com/mherick/open-generative-ai/blob/main/app/api/workflow/%5B%5B...path%5D%5D/route.js"
click node_agent_proxy "https://github.com/mherick/open-generative-ai/blob/main/app/api/agents/%5B%5B...path%5D%5D/route.js"
click node_manager "https://github.com/mherick/open-generative-ai/blob/main/src/components/LocalModelManager.js"
click node_local_client "https://github.com/mherick/open-generative-ai/blob/main/src/lib/localInferenceClient.js"
click node_electron_main "https://github.com/mherick/open-generative-ai/blob/main/electron/main.js"
click node_local_engine "https://github.com/mherick/open-generative-ai/blob/main/electron/lib/localInference.js"
click node_wan_provider "https://github.com/mherick/open-generative-ai/blob/main/electron/lib/wan2gpProvider.js"
click node_upload_proxy "https://github.com/mherick/open-generative-ai/blob/main/app/api/upload-binary/route.js"

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_web,node_desktop_shell,node_image,node_video,node_audio,node_lipsync,node_cinema,node_workflow,node_agents,node_specialized,node_workflow_page,node_agent_pages,node_user toneBlue
class node_studio_api,node_app_proxy,node_workflow_proxy,node_agent_proxy,node_upload_proxy,node_s3 toneAmber
class node_manager,node_local_client,node_electron_main,node_local_engine,node_wan_provider,node_muapi,node_wan_server toneMint
```

## Components

### Studio experience

- [Web app routes](https://github.com/mherick/open-generative-ai/blob/main/app/studio/%5B%5B...slug%5D%5D/page.js): `app/studio/[[...slug]]/page.js`
- [Desktop shell](https://github.com/mherick/open-generative-ai/blob/main/src/main.js): `src/main.js`
- [Image studio](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/ImageStudio.jsx): `packages/studio/src/components/ImageStudio.jsx`
- [Video studio](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/VideoStudio.jsx): `packages/studio/src/components/VideoStudio.jsx`
- [Audio studio](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/AudioStudio.jsx): `packages/studio/src/components/AudioStudio.jsx`
- [Lip sync studio](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/LipSyncStudio.jsx): `packages/studio/src/components/LipSyncStudio.jsx`
- [Cinema studio](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/CinemaStudio.jsx): `packages/studio/src/components/CinemaStudio.jsx`
- [Workflow studio](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/WorkflowStudio.jsx): `packages/studio/src/components/WorkflowStudio.jsx`
- [Agent studios](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/AgentStudio.jsx): `packages/studio/src/components/AgentStudio.jsx`
- [Specialized studios](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/components/ClippingStudio.jsx): `packages/studio/src/components/ClippingStudio.jsx`
- [Workflow pages](https://github.com/mherick/open-generative-ai/blob/main/app/workflow/%5Bid%5D/page.js): `app/workflow/[id]/page.js`
- [Agent pages](https://github.com/mherick/open-generative-ai/blob/main/app/agents/%5Bagent_id%5D/page.js): `app/agents/[agent_id]/page.js`

### Generation services

- [Studio API client](https://github.com/mherick/open-generative-ai/blob/main/packages/studio/src/muapi.js): `packages/studio/src/muapi.js`
- [App API proxy](https://github.com/mherick/open-generative-ai/blob/main/app/api/app/%5B%5B...path%5D%5D/route.js): `app/api/app/[[...path]]/route.js`
- [Workflow API proxy](https://github.com/mherick/open-generative-ai/blob/main/app/api/workflow/%5B%5B...path%5D%5D/route.js): `app/api/workflow/[[...path]]/route.js`
- [Agent API proxy](https://github.com/mherick/open-generative-ai/blob/main/app/api/agents/%5B%5B...path%5D%5D/route.js): `app/api/agents/[[...path]]/route.js`
- [Binary upload proxy](https://github.com/mherick/open-generative-ai/blob/main/app/api/upload-binary/route.js): `app/api/upload-binary/route.js`

### Desktop local AI

- [Local model manager](https://github.com/mherick/open-generative-ai/blob/main/src/components/LocalModelManager.js): `src/components/LocalModelManager.js`
- [Local inference client](https://github.com/mherick/open-generative-ai/blob/main/src/lib/localInferenceClient.js): `src/lib/localInferenceClient.js`
- [Electron IPC host](https://github.com/mherick/open-generative-ai/blob/main/electron/main.js): `electron/main.js`
- [Local inference providers](https://github.com/mherick/open-generative-ai/blob/main/electron/lib/localInference.js): `electron/lib/localInference.js`
- [Wan2GP provider](https://github.com/mherick/open-generative-ai/blob/main/electron/lib/wan2gpProvider.js): `electron/lib/wan2gpProvider.js`

### Other components

- **User**
- **MuAPI service**
- **Wan2GP server**
- **S3 upload storage**

## Connections

- User → Web app routes: opens studio
- User → Desktop shell: opens desktop
- Web app routes → Image studio: selects studio
- Web app routes → Video studio: selects studio
- Web app routes → Audio studio: selects studio
- Web app routes → Lip sync studio: selects studio
- Web app routes → Cinema studio: selects studio
- Web app routes → Workflow studio: selects studio
- Web app routes → Agent studios: selects studio
- Web app routes → Specialized studios: selects studio
- User → Workflow pages: opens workflow
- User → Agent pages: opens agent
- Image studio → Studio API client: submits generation
- Video studio → Studio API client: submits generation
- Audio studio → Studio API client: submits generation
- Lip sync studio → Studio API client: submits generation
- Cinema studio → Studio API client: submits generation
- Studio API client → App API proxy: requests API
- App API proxy → MuAPI service: forwards request
- Workflow pages → Workflow API proxy: requests workflow
- Workflow studio → Workflow API proxy: requests workflow
- Workflow API proxy → MuAPI service: forwards request
- Agent pages → Agent API proxy: requests agent
- Agent studios → Agent API proxy: requests agent
- Agent API proxy → MuAPI service: forwards request
- Local model manager → Local inference client: manages models
- Local inference client → Electron IPC host: invokes IPC
- Electron IPC host → Local inference providers: registers handlers
- Electron IPC host → Wan2GP provider: registers handlers
- Local inference client → Wan2GP provider: dispatches generation
- Wan2GP provider → Wan2GP server: uploads and generates
- App API proxy → Binary upload proxy: redirects binary upload
- Binary upload proxy → S3 upload storage: posts file
