# anil-matcha/open-higgsfield-ai architecture

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

- Interactive diagram: https://gitdiagram.com/anil-matcha/open-higgsfield-ai
- Repository: https://github.com/anil-matcha/open-higgsfield-ai

## Overview

Open Generative AI is a generative-media studio spanning image, video, audio, and workflow-oriented tools, with a standalone desktop app and a hosted Next.js surface. The standalone user flow starts at the app shell, selects a studio, configures a prompt/model, and submits generation through a MuAPI client or— for supported image models—local inference. The README documents additional studios whose runtime wiring was not sampled; those are represented as capability nodes without guessed call paths. The graph reflects source-index references and excerpts; unsampled implementations limit some relationships.

Main entry points: [`src/main.js`](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/main.js) (App Shell), [`src/components/ImageStudio.js`](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/ImageStudio.js) (Image Studio), [`app/studio/[[...slug]]/page.js`](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/studio/%5B%5B...slug%5D%5D/page.js) (Hosted Studio Routes), [`src/components/CinemaStudio.js`](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/CinemaStudio.js) (Cinema Studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_standalone["Standalone Studio"]
  node_shell["App Shell<br/>[main.js]"]
  node_image_ui["Image Studio<br/>[ImageStudio.js]"]
  node_video_ui["Video Studio<br/>[VideoStudio.js]"]
  node_cinema_ui["Cinema Studio<br/>[CinemaStudio.js]"]
  node_lipsync_ui["Lip Sync Studio<br/>[LipSyncStudio.js]"]
  node_workflow_ui["Workflow Studio<br/>[WorkflowStudio.js]"]
  node_agent_ui["Agent Studio<br/>[AgentStudio.js]"]
  node_mcp_ui["MCP &amp; CLI<br/>[McpCliStudio.js]"]
  node_auth["API Key Entry<br/>[AuthModal.js]"]
  node_upload["Media Upload<br/>[UploadPicker.js]"]
  node_api_client["Generation Client<br/>[muapi.js]"]
  node_prompt["Prompt Utilities<br/>[promptUtils.js]"]
  node_job_state["Pending Jobs<br/>[pendingJobs.js]"]
end

subgraph group_studio_pkg["Studio Capabilities"]
  node_model_catalog["Remote Model Catalog<br/>[models.js]"]
  node_studio_api["Studio Generation API<br/>[muapi.js]"]
  node_studio_components["Model Studio Components"]
  node_audio_studio["Audio Studio<br/>[AudioStudio.jsx]"]
  node_clipping_studio["AI Clipping<br/>[ClippingStudio.jsx]"]
  node_marketing_studio["Marketing Studio"]
end

subgraph group_hosted["Hosted App"]
  node_hosted_routes["Hosted Studio Routes<br/>[page.js]"]
  node_hosted_api["Hosted Generation Routes<br/>[route.js]"]
  node_workflow_routes["Workflow Routes<br/>[route.js]"]
  node_agent_routes["Agent Routes<br/>[route.js]"]
  node_upload_proxy["Upload Proxy<br/>[route.js]"]
  node_upload_validation["Upload Validation"]
end

subgraph group_desktop["Desktop Inference"]
  node_local_client["Local AI Client"]
  node_local_models["Local Model Catalog<br/>[localModels.js]"]
  node_electron_host["Electron Host<br/>[main.js]"]
  node_local_engine["Local Inference Runtime<br/>[localInference.js]"]
  node_wan_provider["Wan2GP Provider<br/>[wan2gpProvider.js]"]
end

node_user(("Studio User"))
node_muapi_service["MuAPI Service"]

node_user -->|"opens"| node_shell
node_shell -->|"mounts"| node_image_ui
node_shell -->|"loads"| node_video_ui
node_shell -->|"loads"| node_cinema_ui
node_shell -->|"loads"| node_lipsync_ui
node_shell -->|"loads"| node_workflow_ui
node_shell -->|"loads"| node_agent_ui
node_shell -->|"loads"| node_mcp_ui
node_image_ui -->|"calls"| node_api_client
node_image_ui -->|"calls"| node_local_client
node_image_ui -->|"uses"| node_upload
node_image_ui -->|"uses"| node_prompt
node_image_ui -->|"records jobs"| node_job_state
node_image_ui -->|"uses"| node_auth
node_cinema_ui -->|"calls"| node_api_client
node_cinema_ui -->|"uses"| node_prompt
node_cinema_ui -->|"uses"| node_auth
node_lipsync_ui -->|"calls"| node_api_client
node_lipsync_ui -->|"uses"| node_upload
node_api_client -.->|"requests generation"| node_muapi_service
node_local_client -->|"looks up model"| node_local_models
node_local_client -->|"IPC calls"| node_electron_host
node_electron_host -->|"registers"| node_local_engine
node_electron_host -->|"registers"| node_wan_provider
node_local_client -.->|"dispatches to"| node_wan_provider
node_user -.->|"uses"| node_hosted_routes
node_hosted_routes -.->|"renders"| node_studio_components
node_studio_api -->|"looks up models"| node_model_catalog
node_studio_components -.->|"submits generation"| node_studio_api
node_hosted_routes -.->|"offers"| node_audio_studio
node_hosted_routes -.->|"offers"| node_clipping_studio
node_hosted_routes -.->|"offers"| node_marketing_studio
node_user -.->|"uses"| node_workflow_routes
node_user -.->|"uses"| node_agent_routes
node_upload_proxy -->|"validates"| node_upload_validation

click node_shell "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/main.js"
click node_image_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/ImageStudio.js"
click node_video_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/VideoStudio.js"
click node_cinema_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/CinemaStudio.js"
click node_lipsync_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/LipSyncStudio.js"
click node_workflow_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/WorkflowStudio.js"
click node_agent_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/AgentStudio.js"
click node_mcp_ui "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/McpCliStudio.js"
click node_auth "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/AuthModal.js"
click node_upload "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/UploadPicker.js"
click node_api_client "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/muapi.js"
click node_prompt "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/promptUtils.js"
click node_job_state "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/pendingJobs.js"
click node_local_client "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/localInferenceClient.js"
click node_local_models "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/localModels.js"
click node_electron_host "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/electron/main.js"
click node_local_engine "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/electron/lib/localInference.js"
click node_wan_provider "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/electron/lib/wan2gpProvider.js"
click node_model_catalog "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/models.js"
click node_studio_api "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/muapi.js"
click node_studio_components "https://github.com/anil-matcha/open-higgsfield-ai/tree/main/packages/studio/src/components"
click node_audio_studio "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/components/AudioStudio.jsx"
click node_clipping_studio "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/components/ClippingStudio.jsx"
click node_marketing_studio "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/components/MarketingStudio.jsx"
click node_hosted_routes "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/studio/%5B%5B...slug%5D%5D/page.js"
click node_hosted_api "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/api/v1/%5B%5B...path%5D%5D/route.js"
click node_workflow_routes "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/workflow/%5B%5B...path%5D%5D/route.js"
click node_agent_routes "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/agents/%5B%5B...path%5D%5D/route.js"
click node_upload_proxy "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/upload-binary/route.js"
click node_upload_validation "https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/uploadProxyTarget.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_shell,node_image_ui,node_video_ui,node_cinema_ui,node_lipsync_ui,node_workflow_ui,node_agent_ui,node_mcp_ui,node_auth,node_upload,node_api_client,node_prompt,node_job_state,node_user toneBlue
class node_model_catalog,node_studio_api,node_studio_components,node_audio_studio,node_clipping_studio,node_marketing_studio toneAmber
class node_hosted_routes,node_hosted_api,node_workflow_routes,node_agent_routes,node_upload_proxy,node_upload_validation,node_muapi_service toneMint
class node_local_client,node_local_models,node_electron_host,node_local_engine,node_wan_provider toneRose
```

## Components

### Standalone Studio

- [App Shell](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/main.js): `src/main.js`
- [Image Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/ImageStudio.js): `src/components/ImageStudio.js`
- [Video Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/VideoStudio.js): `src/components/VideoStudio.js`
- [Cinema Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/CinemaStudio.js): `src/components/CinemaStudio.js`
- [Lip Sync Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/LipSyncStudio.js): `src/components/LipSyncStudio.js`
- [Workflow Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/WorkflowStudio.js): `src/components/WorkflowStudio.js`
- [Agent Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/AgentStudio.js): `src/components/AgentStudio.js`
- [MCP & CLI](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/McpCliStudio.js): `src/components/McpCliStudio.js`
- [API Key Entry](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/AuthModal.js): `src/components/AuthModal.js`
- [Media Upload](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/components/UploadPicker.js): `src/components/UploadPicker.js`
- [Generation Client](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/muapi.js): `src/lib/muapi.js`
- [Prompt Utilities](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/promptUtils.js): `src/lib/promptUtils.js`
- [Pending Jobs](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/pendingJobs.js): `src/lib/pendingJobs.js`

### Studio Capabilities

- [Remote Model Catalog](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/models.js): `packages/studio/src/models.js`
- [Studio Generation API](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/muapi.js): `packages/studio/src/muapi.js`
- [Model Studio Components](https://github.com/anil-matcha/open-higgsfield-ai/tree/main/packages/studio/src/components): `packages/studio/src/components`
- [Audio Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/components/AudioStudio.jsx): `packages/studio/src/components/AudioStudio.jsx`
- [AI Clipping](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/components/ClippingStudio.jsx): `packages/studio/src/components/ClippingStudio.jsx`
- [Marketing Studio](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/packages/studio/src/components/MarketingStudio.jsx): `packages/studio/src/components/MarketingStudio.jsx`

### Hosted App

- [Hosted Studio Routes](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/studio/%5B%5B...slug%5D%5D/page.js): `app/studio/[[...slug]]/page.js`
- [Hosted Generation Routes](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/api/v1/%5B%5B...path%5D%5D/route.js): `app/api/api/v1/[[...path]]/route.js`
- [Workflow Routes](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/workflow/%5B%5B...path%5D%5D/route.js): `app/api/workflow/[[...path]]/route.js`
- [Agent Routes](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/agents/%5B%5B...path%5D%5D/route.js): `app/api/agents/[[...path]]/route.js`
- [Upload Proxy](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/app/api/upload-binary/route.js): `app/api/upload-binary/route.js`
- [Upload Validation](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/uploadProxyTarget.js): `src/lib/uploadProxyTarget.js`

### Desktop Inference

- [Local AI Client](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/localInferenceClient.js): `src/lib/localInferenceClient.js`
- [Local Model Catalog](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/src/lib/localModels.js): `src/lib/localModels.js`
- [Electron Host](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/electron/main.js): `electron/main.js`
- [Local Inference Runtime](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/electron/lib/localInference.js): `electron/lib/localInference.js`
- [Wan2GP Provider](https://github.com/anil-matcha/open-higgsfield-ai/blob/main/electron/lib/wan2gpProvider.js): `electron/lib/wan2gpProvider.js`

### Other components

- **Studio User**
- **MuAPI Service**

## Connections

- Studio User → App Shell: opens (evidence: `src/main.js`)
- App Shell → Image Studio: mounts (evidence: `src/main.js`)
- App Shell → Video Studio: loads (evidence: `src/main.js`)
- App Shell → Cinema Studio: loads (evidence: `src/main.js`)
- App Shell → Lip Sync Studio: loads (evidence: `src/main.js`)
- App Shell → Workflow Studio: loads (evidence: `src/main.js`)
- App Shell → Agent Studio: loads (evidence: `src/main.js`)
- App Shell → MCP & CLI: loads (evidence: `src/main.js`)
- Image Studio → Generation Client: calls (evidence: `src/components/ImageStudio.js`)
- Image Studio → Local AI Client: calls (evidence: `src/components/ImageStudio.js`)
- Image Studio → Media Upload: uses (evidence: `src/components/ImageStudio.js`)
- Image Studio → Prompt Utilities: uses (evidence: `src/components/ImageStudio.js`)
- Image Studio → Pending Jobs: records jobs (evidence: `src/components/ImageStudio.js`)
- Image Studio → API Key Entry: uses (evidence: `src/components/ImageStudio.js`)
- Cinema Studio → Generation Client: calls (evidence: `src/components/CinemaStudio.js`)
- Cinema Studio → Prompt Utilities: uses (evidence: `src/components/CinemaStudio.js`)
- Cinema Studio → API Key Entry: uses (evidence: `src/components/CinemaStudio.js`)
- Lip Sync Studio → Generation Client: calls (evidence: `src/components/LipSyncStudio.js`)
- Lip Sync Studio → Media Upload: uses (evidence: `src/components/LipSyncStudio.js`)
- Generation Client → MuAPI Service: requests generation
- Local AI Client → Local Model Catalog: looks up model (evidence: `src/lib/localInferenceClient.js`)
- Local AI Client → Electron Host: IPC calls (evidence: `src/lib/localInferenceClient.js`)
- Electron Host → Local Inference Runtime: registers (evidence: `electron/main.js`)
- Electron Host → Wan2GP Provider: registers (evidence: `electron/main.js`)
- Local AI Client → Wan2GP Provider: dispatches to
- Studio User → Hosted Studio Routes: uses
- Hosted Studio Routes → Model Studio Components: renders
- Studio Generation API → Remote Model Catalog: looks up models (evidence: `packages/studio/src/muapi.js`)
- Model Studio Components → Studio Generation API: submits generation (evidence: `packages/studio/src/components/LayersStudio.jsx`)
- Hosted Studio Routes → Audio Studio: offers
- Hosted Studio Routes → AI Clipping: offers
- Hosted Studio Routes → Marketing Studio: offers
- Studio User → Workflow Routes: uses
- Studio User → Agent Routes: uses
- Upload Proxy → Upload Validation: validates (evidence: `app/api/upload-binary/route.js`)
