# vishnux/polaris architecture

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

- Interactive diagram: https://gitdiagram.com/vishnux/polaris
- Repository: https://github.com/vishnux/polaris

## Overview

Polaris is a Gradio app for generating fashion product images from text prompts. Users enter a prompt, optionally adjust negative prompts and generation settings, and receive a generated image. The app loads a pretrained Stable Diffusion pipeline, selects an available device, and saves the result as a PNG. README advertises 4K output, while the sampled code configures 1024×1024 generation; source evidence is limited to the single application file.

Main entry points: [`app.py`](https://github.com/vishnux/polaris/blob/main/app.py) (Gradio interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gradio["Gradio interface<br/>[app.py]"]
  node_inputs["Prompt and settings<br/>[app.py]"]
end

subgraph group_generation["Image generation"]
  node_gpu_queue["GPU queue<br/>[app.py]"]
  node_device["Device selection<br/>[app.py]"]
  node_pipeline["Diffusion pipeline<br/>[app.py]"]
  node_model["Pretrained model"]
end

subgraph group_output["Image output"]
  node_save["PNG image saver<br/>[app.py]"]
  node_filesystem["Local filesystem"]
  node_result["Generated image result<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_gradio
node_gradio -->|"collects"| node_inputs
node_gradio -->|"dispatches"| node_gpu_queue
node_gpu_queue -->|"runs"| node_pipeline
node_device -->|"configures"| node_pipeline
node_pipeline -->|"loads"| node_model
node_pipeline -->|"passes image"| node_save
node_save -->|"writes PNG"| node_filesystem
node_save -->|"returns path"| node_result
node_result -->|"displays"| node_gradio

click node_gradio "https://github.com/vishnux/polaris/blob/main/app.py"
click node_inputs "https://github.com/vishnux/polaris/blob/main/app.py"
click node_gpu_queue "https://github.com/vishnux/polaris/blob/main/app.py"
click node_device "https://github.com/vishnux/polaris/blob/main/app.py"
click node_pipeline "https://github.com/vishnux/polaris/blob/main/app.py"
click node_save "https://github.com/vishnux/polaris/blob/main/app.py"
click node_result "https://github.com/vishnux/polaris/blob/main/app.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_gradio,node_inputs,node_user toneBlue
class node_gpu_queue,node_device,node_pipeline,node_model toneAmber
class node_save,node_filesystem,node_result toneMint
```

## Components

### User interface

- [Gradio interface](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`
- [Prompt and settings](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`

### Image generation

- [GPU queue](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`
- [Device selection](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`
- [Diffusion pipeline](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`
- **Pretrained model**

### Image output

- [PNG image saver](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`
- **Local filesystem**
- [Generated image result](https://github.com/vishnux/polaris/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Gradio interface: uses
- Gradio interface → Prompt and settings: collects
- Gradio interface → GPU queue: dispatches
- GPU queue → Diffusion pipeline: runs
- Device selection → Diffusion pipeline: configures
- Diffusion pipeline → Pretrained model: loads
- Diffusion pipeline → PNG image saver: passes image
- PNG image saver → Local filesystem: writes PNG
- PNG image saver → Generated image result: returns path
- Generated image result → Gradio interface: displays
