# xiaollull/xiria-aicanvas architecture

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

- Interactive diagram: https://gitdiagram.com/xiaollull/xiria-aicanvas
- Repository: https://github.com/xiaollull/xiria-aicanvas

## Overview

XiriaCanvas AI is a local image-generation application with a React workspace and a Python inference backend. The principal workflow is configuring a generation in the workspace, running it through a native engine, and viewing results in the gallery. The README also documents model management, image-to-image work, postprocessing, LoRA management, and an AI assistant as product capabilities. Several backend and UI connections are inferred from product documentation rather than sampled call sites, so those links are dashed and unverified.

Main entry points: [`src/App.jsx`](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/App.jsx) (Workspace UI), [`backend/inference_server.py`](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/inference_server.py) (Inference server), [`backend/anima_pipeline.py`](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/anima_pipeline.py) (Anima engine), [`backend/flux_pipeline.py`](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/flux_pipeline.py) (FLUX.1 engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Generation Workspace"]
  node_app["Workspace UI<br/>[App.jsx]"]
  node_settings["Engine settings<br/>[engine-settings.js]"]
  node_image_edit["Image-to-image<br/>[image-to-image.js]"]
end

subgraph group_inference["Inference Runtime"]
  node_inference_server["Inference server"]
  node_anima["Anima engine<br/>[anima_pipeline.py]"]
  node_flux["FLUX.1 engine<br/>[flux_pipeline.py]"]
  node_flux2["FLUX.2 engine<br/>[flux2_pipeline.py]"]
  node_krea["Krea 2 engine<br/>[krea2_pipeline.py]"]
  node_quant["Quantized weights<br/>[comfy_quant.py]"]
  node_prompt_encoding["Prompt encoding<br/>[prompt_encoding.py]"]
end

subgraph group_assets["Models and LoRAs"]
  node_model_downloader["Model downloader"]
  node_model_paths["Model locations<br/>[model_paths.py]"]
  node_lora_manager["LoRA manager"]
  node_lora_cards["LoRA cards<br/>[lora-cards.js]"]
end

subgraph group_results["Images and Tools"]
  node_gallery["Image gallery<br/>[gallery.py]"]
  node_postprocessing["Resample chain<br/>[resample-chain.js]"]
  node_background_removal["Background removal"]
end

subgraph group_assistant["Assistant"]
  node_assistant_page["Assistant page"]
  node_assistant_client["Assistant client"]
  node_assistant_provider["Assistant providers"]
end

node_user(("Local user"))

node_user -->|"uses"| node_app
node_app -.->|"configures"| node_settings
node_app -.->|"configures"| node_image_edit
node_app -.->|"submits generation"| node_inference_server
node_inference_server -.->|"dispatches to"| node_anima
node_inference_server -.->|"dispatches to"| node_flux
node_inference_server -.->|"dispatches to"| node_flux2
node_inference_server -.->|"dispatches to"| node_krea
node_anima -->|"loads weights"| node_quant
node_anima -->|"encodes prompts"| node_prompt_encoding
node_flux -->|"loads weights"| node_quant
node_flux -->|"encodes prompts"| node_prompt_encoding
node_user -->|"manages models"| node_model_downloader
node_model_downloader -.->|"uses locations"| node_model_paths
node_user -->|"manages LoRAs"| node_lora_manager
node_lora_manager -->|"uses cards"| node_lora_cards
node_user -->|"views results"| node_gallery
node_app -.->|"configures"| node_postprocessing
node_user -->|"uses postprocessing"| node_background_removal
node_user -.->|"opens assistant"| node_assistant_page
node_assistant_page -.->|"uses"| node_assistant_client
node_assistant_client -->|"selects provider"| node_assistant_provider

click node_app "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/App.jsx"
click node_settings "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/engine-settings.js"
click node_image_edit "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/image-to-image.js"
click node_inference_server "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/inference_server.py"
click node_anima "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/anima_pipeline.py"
click node_flux "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/flux_pipeline.py"
click node_flux2 "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/flux2_pipeline.py"
click node_krea "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/krea2_pipeline.py"
click node_quant "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/comfy_quant.py"
click node_prompt_encoding "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/prompt_encoding.py"
click node_model_downloader "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/ModelDownloader.jsx"
click node_model_paths "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/model_paths.py"
click node_lora_manager "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/LoraManagerPage.jsx"
click node_lora_cards "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/lora-cards.js"
click node_gallery "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/gallery.py"
click node_postprocessing "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/resample-chain.js"
click node_background_removal "https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/background_removal.py"
click node_assistant_page "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/AiAssistantPage.jsx"
click node_assistant_client "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/assistant-client.js"
click node_assistant_provider "https://github.com/xiaollull/xiria-aicanvas/blob/main/src/ai-assistant-providers.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_app,node_settings,node_image_edit,node_user toneBlue
class node_inference_server,node_anima,node_flux,node_flux2,node_krea,node_quant,node_prompt_encoding toneAmber
class node_model_downloader,node_model_paths,node_lora_manager,node_lora_cards toneMint
class node_gallery,node_postprocessing,node_background_removal toneRose
class node_assistant_page,node_assistant_client,node_assistant_provider toneIndigo
```

## Components

### Generation Workspace

- [Workspace UI](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/App.jsx): `src/App.jsx`
- [Engine settings](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/engine-settings.js): `src/engine-settings.js`
- [Image-to-image](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/image-to-image.js): `src/image-to-image.js`

### Inference Runtime

- [Inference server](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/inference_server.py): `backend/inference_server.py`
- [Anima engine](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/anima_pipeline.py): `backend/anima_pipeline.py`
- [FLUX.1 engine](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/flux_pipeline.py): `backend/flux_pipeline.py`
- [FLUX.2 engine](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/flux2_pipeline.py): `backend/flux2_pipeline.py`
- [Krea 2 engine](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/krea2_pipeline.py): `backend/krea2_pipeline.py`
- [Quantized weights](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/comfy_quant.py): `backend/comfy_quant.py`
- [Prompt encoding](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/prompt_encoding.py): `backend/prompt_encoding.py`

### Models and LoRAs

- [Model downloader](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/ModelDownloader.jsx): `src/ModelDownloader.jsx`
- [Model locations](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/model_paths.py): `backend/model_paths.py`
- [LoRA manager](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/LoraManagerPage.jsx): `src/LoraManagerPage.jsx`
- [LoRA cards](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/lora-cards.js): `src/lora-cards.js`

### Images and Tools

- [Image gallery](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/gallery.py): `backend/gallery.py`
- [Resample chain](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/resample-chain.js): `src/resample-chain.js`
- [Background removal](https://github.com/xiaollull/xiria-aicanvas/blob/main/backend/background_removal.py): `backend/background_removal.py`

### Assistant

- [Assistant page](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/AiAssistantPage.jsx): `src/AiAssistantPage.jsx`
- [Assistant client](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/assistant-client.js): `src/assistant-client.js`
- [Assistant providers](https://github.com/xiaollull/xiria-aicanvas/blob/main/src/ai-assistant-providers.js): `src/ai-assistant-providers.js`

### Other components

- **Local user**

## Connections

- Local user → Workspace UI: uses (evidence: `README.md`)
- Workspace UI → Engine settings: configures
- Workspace UI → Image-to-image: configures (evidence: `src/App.jsx`)
- Workspace UI → Inference server: submits generation
- Inference server → Anima engine: dispatches to
- Inference server → FLUX.1 engine: dispatches to
- Inference server → FLUX.2 engine: dispatches to
- Inference server → Krea 2 engine: dispatches to
- Anima engine → Quantized weights: loads weights (evidence: `backend/anima_pipeline.py`)
- Anima engine → Prompt encoding: encodes prompts (evidence: `backend/anima_pipeline.py`)
- FLUX.1 engine → Quantized weights: loads weights (evidence: `backend/flux_pipeline.py`)
- FLUX.1 engine → Prompt encoding: encodes prompts (evidence: `backend/flux_pipeline.py`)
- Local user → Model downloader: manages models (evidence: `README.md`)
- Model downloader → Model locations: uses locations
- Local user → LoRA manager: manages LoRAs (evidence: `README.md`)
- LoRA manager → LoRA cards: uses cards (evidence: `src/LoraManagerPage.jsx`)
- Local user → Image gallery: views results (evidence: `README.md`)
- Workspace UI → Resample chain: configures (evidence: `src/App.jsx`)
- Local user → Background removal: uses postprocessing (evidence: `README.md`)
- Local user → Assistant page: opens assistant
- Assistant page → Assistant client: uses
- Assistant client → Assistant providers: selects provider (evidence: `src/assistant-client.js`)
