# marhensa/sdxl-recommended-res-calc architecture

> Architecture diagram of the GitHub repository marhensa/sdxl-recommended-res-calc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marhensa/sdxl-recommended-res-calc
- Repository: https://github.com/marhensa/sdxl-recommended-res-calc

## Overview

##### Core Components
- Resolution Calculator Engine (Main Logic)
- ComfyUI Node Interface
- Standalone Script Interface

##### Integration Points
- ComfyUI Manager Integration
- Manual Installation Path
- Standalone Execution Path

##### Component Relationships

a. ComfyUI Integration Path:
- ComfyUI Manager → Custom Node Installation → ComfyUI Node Interface → Core Calculator → SDXL Output

b. Standalone Path:
- Batch/Shell Scripts → Standalone Interface → Core Calculator → Console Output

##### Data Flow Indicators
- Input Flow: Show user inputs (desired X/Y resolution)
- Output Flow: Show calculated values (recommended resolution, upscale factors)

##### Technical Details
- Input Parameters:
- DesiredXSIZE
- DesiredYSIZE
- Output Parameters:
- Recommended Initial Resolution
- Upscale Factor
- Reverse Upscale Factor

##### Implementation Notes
- Core calculator as the central component
- Two main usage modes (ComfyUI node vs. Standalone)
- Reference to SDXL paper specifications

##### The clear input/output flow

Keep the abstraction level focused on the architectural components while maintaining enough detail to show how the calculator integrates with both ComfyUI and standalone usage scenarios. This will help developers understand both the internal structure and the external interfaces of the system.

Remember to include version compatibility information and any relevant dependencies, particularly the relationship with ComfyUI and its manager system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Installation
        CM[ComfyUI Manager]
        MI[Manual Installation]
        CM --> CN
        MI --> CN
    end

    subgraph Core
        CN["ComfyUI Node Interface"]:::node
        SA["Standalone Interface"]:::standalone
        RC["Resolution Calculator Engine"]:::core
        click CN "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/customnode_sdxl_recommended_res_calc.py"
        click RC "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/sdxl-recommended-res-calc.py"
    end

    subgraph Interfaces
        WS["Windows Script"]:::script
        LS["Linux Script"]:::script
        AU["Alternative UI"]:::ui
        click WS "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/sdxl-recommended-res-calc_windows.bat"
        click LS "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/sdxl-recommended-res-calc_linux.sh"
        click AU "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/scripts/a1111_sdxl_recommended_res_calc.py"
    end

    subgraph Configuration
        PC["Package Config"]:::config
        MI["Module Init"]:::config
        click PC "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/pyproject.toml"
        click MI "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/__init__.py"
    end

    subgraph Examples
        UE["Usage Examples"]:::example
        click UE "https://github.com/marhensa/sdxl-recommended-res-calc/blob/main/_use-case-sdxl-example-comfyui-nodes/sdxl-recommended-res-calc_upscale-case.json"
    end

    CN --> RC
    SA --> RC
    WS --> SA
    LS --> SA
    AU --> RC
    RC --> Output

    Configuration --> Core
    UE -.-> CN

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef node fill:#2ecc71,stroke:#27ae60,color:white
    classDef standalone fill:#e74c3c,stroke:#c0392b,color:white
    classDef script fill:#f1c40f,stroke:#f39c12,color:black
    classDef ui fill:#9b59b6,stroke:#8e44ad,color:white
    classDef config fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef example fill:#1abc9c,stroke:#16a085,color:white

    subgraph Legend
        L1[Core Components]:::core
        L2[Node Interface]:::node
        L3[Standalone Interface]:::standalone
        L4[Scripts]:::script
        L5[UI Components]:::ui
        L6[Configuration]:::config
        L7[Examples]:::example
    end
```
