# eutropicai/final2x architecture

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

- Interactive diagram: https://gitdiagram.com/eutropicai/final2x
- Repository: https://github.com/eutropicai/final2x

## Overview

Final2x is a cross-platform desktop image super-resolution tool with a Python core. The user selects images and processing options, starts a run, and the core processes images into an output folder; the desktop process launches the core and relays its output. The graph also includes settings, model selection, localization, and progress support. Several renderer-to-process execution details and unsampled subsystems are inferred only as dashed links; those links have no source evidence cited.

Main entry points: [`src/renderer/src/views/Final2xSettings.vue`](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/views/Final2xSettings.vue) (Processing settings), [`core/Final2x_core/SRqueue.py`](https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/SRqueue.py) (Image processing queue), [`src/main/registerIpcHandlers.ts`](https://github.com/eutropicai/final2x/blob/main/src/main/registerIpcHandlers.ts) (IPC handlers), [`src/renderer/src/router/index.ts`](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/router/index.ts) (View router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_renderer["Desktop interface"]
  node_home["Image workflow<br/>[Final2xHome.vue]"]
  node_settings["Processing settings"]
  node_app["App shell<br/>[App.vue]"]
  node_router["View router<br/>[index.ts]"]
end

subgraph group_desktop["Electron process"]
  node_ipcchannels["IPC channels<br/>[ipc.ts]"]
  node_preload["Renderer bridge<br/>[index.ts]"]
  node_ipc["IPC handlers"]
  node_directory["Directory picker<br/>[openDirectory.ts]"]
  node_launcher["Core launcher<br/>[runCommand.ts]"]
  node_corepath["Core location<br/>[getCorePath.ts]"]
end

subgraph group_core["Super-resolution core"]
  node_coreentry["Core CLI<br/>[__main__.py]"]
  node_config["Run configuration<br/>[config.py]"]
  node_queue["Image processing queue<br/>[SRqueue.py]"]
  node_srwrapper["Super-resolution engine<br/>[SRclass.py]"]
  node_progresslog["Core progress log<br/>[progressLog.py]"]
end

subgraph group_support["Settings and progress"]
  node_progress["Run progress<br/>[MyProgress.vue]"]
  node_globalstore["Global preferences"]
  node_iostore["Image paths<br/>[ioPathStore.ts]"]
  node_iopath["Path management<br/>[IOPath.ts]"]
  node_srsettings["SR preferences<br/>[SRSettingsStore.ts]"]
  node_modeloptions["Model choices<br/>[modelOptions.ts]"]
end

node_user(("User"))
node_filesystem[("Image files")]
node_externalmodels["Custom model files"]

node_user -->|"chooses images"| node_home
node_user -->|"sets options"| node_settings
node_app -->|"renders views"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_settings
node_home -->|"uses paths"| node_iopath
node_iopath -->|"reads and updates"| node_iostore
node_settings -->|"updates preferences"| node_srsettings
node_settings -->|"offers models"| node_modeloptions
node_settings -->|"requests folder dialog"| node_ipcchannels
node_ipc -->|"handles dialog"| node_directory
node_ipc -->|"dispatches commands"| node_launcher
node_ipc -->|"registers channels"| node_ipcchannels
node_preload -.->|"exposes IPC"| node_ipcchannels
node_progress -.->|"starts and monitors run"| node_ipc
node_launcher -->|"resolves executable"| node_corepath
node_launcher -.->|"spawns core"| node_coreentry
node_coreentry -->|"loads configuration"| node_config
node_coreentry -->|"starts processing"| node_queue
node_queue -->|"reads options"| node_config
node_queue -->|"processes images"| node_srwrapper
node_queue -->|"updates progress"| node_progresslog
node_queue -->|"reads inputs and writes outputs"| node_filesystem
node_settings -.->|"can load custom models"| node_externalmodels
node_globalstore -->|"supplies appearance state"| node_app

click node_home "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/views/Final2xHome.vue"
click node_settings "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/views/Final2xSettings.vue"
click node_app "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/App.vue"
click node_router "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/router/index.ts"
click node_ipcchannels "https://github.com/eutropicai/final2x/blob/main/src/shared/const/ipc.ts"
click node_preload "https://github.com/eutropicai/final2x/blob/main/src/preload/index.ts"
click node_ipc "https://github.com/eutropicai/final2x/blob/main/src/main/registerIpcHandlers.ts"
click node_directory "https://github.com/eutropicai/final2x/blob/main/src/main/openDirectory.ts"
click node_launcher "https://github.com/eutropicai/final2x/blob/main/src/main/runCommand.ts"
click node_corepath "https://github.com/eutropicai/final2x/blob/main/src/main/getCorePath.ts"
click node_progress "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/components/MyProgress.vue"
click node_globalstore "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/store/globalSettingsStore.ts"
click node_iostore "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/store/ioPathStore.ts"
click node_iopath "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/utils/IOPath.ts"
click node_srsettings "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/store/SRSettingsStore.ts"
click node_modeloptions "https://github.com/eutropicai/final2x/blob/main/src/renderer/src/utils/modelOptions.ts"
click node_coreentry "https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/__main__.py"
click node_config "https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/config.py"
click node_queue "https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/SRqueue.py"
click node_srwrapper "https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/SRclass.py"
click node_progresslog "https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/util/progressLog.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_home,node_settings,node_app,node_router,node_user toneBlue
class node_ipcchannels,node_preload,node_ipc,node_directory,node_launcher,node_corepath,node_filesystem toneAmber
class node_coreentry,node_config,node_queue,node_srwrapper,node_progresslog toneMint
class node_progress,node_globalstore,node_iostore,node_iopath,node_srsettings,node_modeloptions toneRose
class node_externalmodels toneIndigo
```

## Components

### Desktop interface

- [Image workflow](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/views/Final2xHome.vue): `src/renderer/src/views/Final2xHome.vue`
- [Processing settings](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/views/Final2xSettings.vue): `src/renderer/src/views/Final2xSettings.vue`
- [App shell](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/App.vue): `src/renderer/src/App.vue`
- [View router](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/router/index.ts): `src/renderer/src/router/index.ts`

### Electron process

- [IPC channels](https://github.com/eutropicai/final2x/blob/main/src/shared/const/ipc.ts): `src/shared/const/ipc.ts`
- [Renderer bridge](https://github.com/eutropicai/final2x/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [IPC handlers](https://github.com/eutropicai/final2x/blob/main/src/main/registerIpcHandlers.ts): `src/main/registerIpcHandlers.ts`
- [Directory picker](https://github.com/eutropicai/final2x/blob/main/src/main/openDirectory.ts): `src/main/openDirectory.ts`
- [Core launcher](https://github.com/eutropicai/final2x/blob/main/src/main/runCommand.ts): `src/main/runCommand.ts`
- [Core location](https://github.com/eutropicai/final2x/blob/main/src/main/getCorePath.ts): `src/main/getCorePath.ts`

### Super-resolution core

- [Core CLI](https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/__main__.py): `core/Final2x_core/__main__.py`
- [Run configuration](https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/config.py): `core/Final2x_core/config.py`
- [Image processing queue](https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/SRqueue.py): `core/Final2x_core/SRqueue.py`
- [Super-resolution engine](https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/SRclass.py): `core/Final2x_core/SRclass.py`
- [Core progress log](https://github.com/eutropicai/final2x/blob/main/core/Final2x_core/util/progressLog.py): `core/Final2x_core/util/progressLog.py`

### Settings and progress

- [Run progress](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/components/MyProgress.vue): `src/renderer/src/components/MyProgress.vue`
- [Global preferences](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/store/globalSettingsStore.ts): `src/renderer/src/store/globalSettingsStore.ts`
- [Image paths](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/store/ioPathStore.ts): `src/renderer/src/store/ioPathStore.ts`
- [Path management](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/utils/IOPath.ts): `src/renderer/src/utils/IOPath.ts`
- [SR preferences](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/store/SRSettingsStore.ts): `src/renderer/src/store/SRSettingsStore.ts`
- [Model choices](https://github.com/eutropicai/final2x/blob/main/src/renderer/src/utils/modelOptions.ts): `src/renderer/src/utils/modelOptions.ts`

### Other components

- **User**
- **Image files**
- **Custom model files**

## Connections

- User → Image workflow: chooses images (evidence: `README.md`)
- User → Processing settings: sets options (evidence: `README.md`)
- App shell → View router: renders views (evidence: `src/renderer/src/App.vue`)
- View router → Image workflow: routes to (evidence: `src/renderer/src/router/index.ts`)
- View router → Processing settings: routes to (evidence: `src/renderer/src/router/index.ts`)
- Image workflow → Path management: uses paths (evidence: `src/renderer/src/views/Final2xHome.vue`)
- Path management → Image paths: reads and updates (evidence: `src/renderer/src/utils/IOPath.ts`)
- Processing settings → SR preferences: updates preferences (evidence: `src/renderer/src/views/Final2xSettings.vue`)
- Processing settings → Model choices: offers models (evidence: `src/renderer/src/views/Final2xSettings.vue`)
- Processing settings → IPC channels: requests folder dialog (evidence: `src/renderer/src/views/Final2xSettings.vue`)
- IPC handlers → Directory picker: handles dialog (evidence: `src/main/registerIpcHandlers.ts`)
- IPC handlers → Core launcher: dispatches commands (evidence: `src/main/registerIpcHandlers.ts`)
- IPC handlers → IPC channels: registers channels (evidence: `src/main/registerIpcHandlers.ts`)
- Renderer bridge → IPC channels: exposes IPC
- Run progress → IPC handlers: starts and monitors run
- Core launcher → Core location: resolves executable (evidence: `src/main/runCommand.ts`)
- Core launcher → Core CLI: spawns core
- Core CLI → Run configuration: loads configuration (evidence: `core/Final2x_core/__main__.py`)
- Core CLI → Image processing queue: starts processing (evidence: `core/Final2x_core/__main__.py`)
- Image processing queue → Run configuration: reads options (evidence: `core/Final2x_core/SRqueue.py`)
- Image processing queue → Super-resolution engine: processes images (evidence: `core/Final2x_core/SRqueue.py`)
- Image processing queue → Core progress log: updates progress (evidence: `core/Final2x_core/SRqueue.py`)
- Image processing queue → Image files: reads inputs and writes outputs (evidence: `core/Final2x_core/SRqueue.py`)
- Processing settings → Custom model files: can load custom models
- Global preferences → App shell: supplies appearance state (evidence: `src/renderer/src/App.vue`)
