# clabstreamteam/open-higgsfield-ai architecture

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

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

## Overview

Clabstream AI Studio is an internal creative-generation interface with image, video, lip-sync, and cinema workflows. Users choose a studio, configure a model and inputs, upload media where needed, and submit generation requests through a Muapi client to a provider. The repository contains both a Next.js shell around a shared React studio package and a separate vanilla-JS studio frontend. The graph focuses on the shared package and the sampled vanilla workflows; API route internals are unsampled, so their behavior and connections are not inferred.

Main entry points: [`packages/studio/src/muapi.js`](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/muapi.js) (Muapi client), [`src/lib/muapi.js`](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/muapi.js) (Muapi client (vanilla)), [`packages/studio/src/index.js`](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/index.js) (Studio exports), [`src/main.js`](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/main.js) (Vanilla router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry points"]
  node_shell["Standalone shell<br/>[StandaloneShell.js]"]
  node_package_index["Studio exports<br/>[index.js]"]
  node_vanilla_router["Vanilla router<br/>[main.js]"]
end

subgraph group_studios["Creative studios"]
  node_image_studio["Image studio<br/>[ImageStudio.jsx]"]
  node_video_studio["Video studio<br/>[VideoStudio.jsx]"]
  node_lipsync_studio["Lip-sync studio<br/>[LipSyncStudio.jsx]"]
  node_cinema_studio["Cinema studio<br/>[CinemaStudio.jsx]"]
  node_legacy_image["Image studio &#40;vanilla&#41;<br/>[ImageStudio.js]"]
  node_legacy_video["Video studio &#40;vanilla&#41;<br/>[VideoStudio.js]"]
  node_legacy_lipsync["Lip-sync studio &#40;vanilla&#41;<br/>[LipSyncStudio.js]"]
  node_legacy_cinema["Cinema studio &#40;vanilla&#41;<br/>[CinemaStudio.js]"]
  node_camera_controls["Camera controls<br/>[CameraControls.js]"]
  node_prompt_tools["Prompt utilities<br/>[promptUtils.js]"]
end

subgraph group_integration["Provider integration"]
  node_package_models["Model catalog<br/>[models.js]"]
  node_vanilla_models["Model catalog &#40;vanilla&#41;<br/>[models.js]"]
  node_package_client["Muapi client<br/>[muapi.js]"]
  node_vanilla_client["Muapi client &#40;vanilla&#41;<br/>[muapi.js]"]
end

subgraph group_state["Local state and assets"]
  node_upload_picker["Upload picker<br/>[UploadPicker.js]"]
  node_upload_history[("Upload history<br/>[uploadHistory.js]")]
  node_pending_jobs[("Pending jobs<br/>[pendingJobs.js]")]
  node_upload_route["Upload API route<br/>[route.js]"]
end

node_user(("Internal user"))
node_provider{{"Muapi API"}}

node_user -->|"opens studio"| node_shell
node_shell -->|"renders studios"| node_package_index
node_package_index -->|"exports"| node_image_studio
node_package_index -->|"exports"| node_video_studio
node_package_index -->|"exports"| node_lipsync_studio
node_package_index -->|"exports"| node_cinema_studio
node_user -->|"navigates studios"| node_vanilla_router
node_vanilla_router -->|"routes to"| node_legacy_image
node_vanilla_router -->|"routes to"| node_legacy_video
node_vanilla_router -->|"routes to"| node_legacy_lipsync
node_vanilla_router -->|"routes to"| node_legacy_cinema
node_image_studio -->|"submits generation"| node_package_client
node_video_studio -->|"uploads and generates"| node_package_client
node_lipsync_studio -->|"submits generation"| node_package_client
node_cinema_studio -->|"uses provider client"| node_package_client
node_package_client -->|"resolves models"| node_package_models
node_package_client -->|"sends API requests"| node_provider
node_legacy_image -->|"submits generation"| node_vanilla_client
node_legacy_image -->|"configures models"| node_vanilla_models
node_legacy_image -->|"uses prompt tools"| node_prompt_tools
node_legacy_video -->|"uploads and generates"| node_vanilla_client
node_legacy_video -->|"configures models"| node_vanilla_models
node_legacy_lipsync -->|"submits generation"| node_vanilla_client
node_legacy_lipsync -->|"configures models"| node_vanilla_models
node_legacy_cinema -->|"uses provider client"| node_vanilla_client
node_legacy_cinema -->|"uses controls"| node_camera_controls
node_camera_controls -->|"uses prompt tools"| node_prompt_tools
node_vanilla_client -->|"resolves models"| node_vanilla_models
node_vanilla_client -->|"sends API requests"| node_provider
node_upload_picker -->|"uploads files"| node_vanilla_client
node_upload_picker -->|"reads and writes"| node_upload_history
node_legacy_image -->|"tracks generation jobs"| node_pending_jobs
node_legacy_video -->|"tracks generation jobs"| node_pending_jobs
node_package_client -->|"uploads via route"| node_upload_route

click node_shell "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/components/StandaloneShell.js"
click node_package_index "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/index.js"
click node_vanilla_router "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/main.js"
click node_image_studio "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/ImageStudio.jsx"
click node_video_studio "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/VideoStudio.jsx"
click node_lipsync_studio "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/LipSyncStudio.jsx"
click node_cinema_studio "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/CinemaStudio.jsx"
click node_legacy_image "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/ImageStudio.js"
click node_legacy_video "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/VideoStudio.js"
click node_legacy_lipsync "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/LipSyncStudio.js"
click node_legacy_cinema "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/CinemaStudio.js"
click node_camera_controls "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/CameraControls.js"
click node_prompt_tools "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/promptUtils.js"
click node_package_models "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/models.js"
click node_vanilla_models "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/models.js"
click node_package_client "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/muapi.js"
click node_vanilla_client "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/muapi.js"
click node_upload_picker "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/UploadPicker.js"
click node_upload_history "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/uploadHistory.js"
click node_pending_jobs "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/pendingJobs.js"
click node_upload_route "https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/app/api/upload/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_shell,node_package_index,node_vanilla_router,node_user toneBlue
class node_image_studio,node_video_studio,node_lipsync_studio,node_cinema_studio,node_legacy_image,node_legacy_video,node_legacy_lipsync,node_legacy_cinema,node_camera_controls,node_prompt_tools toneAmber
class node_package_models,node_vanilla_models,node_package_client,node_vanilla_client,node_provider toneMint
class node_upload_picker,node_upload_history,node_pending_jobs,node_upload_route toneRose
```

## Components

### Application entry points

- [Standalone shell](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/components/StandaloneShell.js): `components/StandaloneShell.js`
- [Studio exports](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/index.js): `packages/studio/src/index.js`
- [Vanilla router](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/main.js): `src/main.js`

### Creative studios

- [Image studio](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/ImageStudio.jsx): `packages/studio/src/components/ImageStudio.jsx`
- [Video studio](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/VideoStudio.jsx): `packages/studio/src/components/VideoStudio.jsx`
- [Lip-sync studio](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/LipSyncStudio.jsx): `packages/studio/src/components/LipSyncStudio.jsx`
- [Cinema studio](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/components/CinemaStudio.jsx): `packages/studio/src/components/CinemaStudio.jsx`
- [Image studio (vanilla)](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/ImageStudio.js): `src/components/ImageStudio.js`
- [Video studio (vanilla)](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/VideoStudio.js): `src/components/VideoStudio.js`
- [Lip-sync studio (vanilla)](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/LipSyncStudio.js): `src/components/LipSyncStudio.js`
- [Cinema studio (vanilla)](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/CinemaStudio.js): `src/components/CinemaStudio.js`
- [Camera controls](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/CameraControls.js): `src/components/CameraControls.js`
- [Prompt utilities](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/promptUtils.js): `src/lib/promptUtils.js`

### Provider integration

- [Model catalog](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/models.js): `packages/studio/src/models.js`
- [Model catalog (vanilla)](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/models.js): `src/lib/models.js`
- [Muapi client](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/packages/studio/src/muapi.js): `packages/studio/src/muapi.js`
- [Muapi client (vanilla)](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/muapi.js): `src/lib/muapi.js`

### Local state and assets

- [Upload picker](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/components/UploadPicker.js): `src/components/UploadPicker.js`
- [Upload history](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/uploadHistory.js): `src/lib/uploadHistory.js`
- [Pending jobs](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/src/lib/pendingJobs.js): `src/lib/pendingJobs.js`
- [Upload API route](https://github.com/clabstreamteam/open-higgsfield-ai/blob/main/app/api/upload/route.js): `app/api/upload/route.js`

### Other components

- **Internal user**
- **Muapi API**

## Connections

- Internal user → Standalone shell: opens studio (evidence: `README.md`)
- Standalone shell → Studio exports: renders studios (evidence: `components/StandaloneShell.js`)
- Studio exports → Image studio: exports (evidence: `packages/studio/src/index.js`)
- Studio exports → Video studio: exports (evidence: `packages/studio/src/index.js`)
- Studio exports → Lip-sync studio: exports (evidence: `packages/studio/src/index.js`)
- Studio exports → Cinema studio: exports (evidence: `packages/studio/src/index.js`)
- Internal user → Vanilla router: navigates studios (evidence: `src/main.js`)
- Vanilla router → Image studio (vanilla): routes to (evidence: `src/main.js`)
- Vanilla router → Video studio (vanilla): routes to (evidence: `src/main.js`)
- Vanilla router → Lip-sync studio (vanilla): routes to (evidence: `src/main.js`)
- Vanilla router → Cinema studio (vanilla): routes to (evidence: `src/main.js`)
- Image studio → Muapi client: submits generation (evidence: `packages/studio/src/components/ImageStudio.jsx`)
- Video studio → Muapi client: uploads and generates (evidence: `packages/studio/src/components/VideoStudio.jsx`)
- Lip-sync studio → Muapi client: submits generation (evidence: `packages/studio/src/components/LipSyncStudio.jsx`)
- Cinema studio → Muapi client: uses provider client (evidence: `packages/studio/src/components/CinemaStudio.jsx`)
- Muapi client → Model catalog: resolves models (evidence: `packages/studio/src/muapi.js`)
- Muapi client → Muapi API: sends API requests (evidence: `packages/studio/src/muapi.js`)
- Image studio (vanilla) → Muapi client (vanilla): submits generation (evidence: `src/components/ImageStudio.js`)
- Image studio (vanilla) → Model catalog (vanilla): configures models (evidence: `src/components/ImageStudio.js`)
- Image studio (vanilla) → Prompt utilities: uses prompt tools (evidence: `src/components/ImageStudio.js`)
- Video studio (vanilla) → Muapi client (vanilla): uploads and generates (evidence: `src/components/VideoStudio.js`)
- Video studio (vanilla) → Model catalog (vanilla): configures models (evidence: `src/components/VideoStudio.js`)
- Lip-sync studio (vanilla) → Muapi client (vanilla): submits generation (evidence: `src/components/LipSyncStudio.js`)
- Lip-sync studio (vanilla) → Model catalog (vanilla): configures models (evidence: `src/components/LipSyncStudio.js`)
- Cinema studio (vanilla) → Muapi client (vanilla): uses provider client (evidence: `src/components/CinemaStudio.js`)
- Cinema studio (vanilla) → Camera controls: uses controls (evidence: `src/components/CinemaStudio.js`)
- Camera controls → Prompt utilities: uses prompt tools (evidence: `src/components/CameraControls.js`)
- Muapi client (vanilla) → Model catalog (vanilla): resolves models (evidence: `src/lib/muapi.js`)
- Muapi client (vanilla) → Muapi API: sends API requests (evidence: `src/lib/muapi.js`)
- Upload picker → Muapi client (vanilla): uploads files (evidence: `src/components/UploadPicker.js`)
- Upload picker → Upload history: reads and writes (evidence: `src/components/UploadPicker.js`)
- Image studio (vanilla) → Pending jobs: tracks generation jobs (evidence: `src/components/ImageStudio.js`)
- Video studio (vanilla) → Pending jobs: tracks generation jobs (evidence: `src/components/VideoStudio.js`)
- Muapi client → Upload API route: uploads via route (evidence: `packages/studio/src/muapi.js`)
