# fallenshock/flowedit architecture

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

- Interactive diagram: https://gitdiagram.com/fallenshock/flowedit
- Repository: https://github.com/fallenshock/flowedit

## Overview

##### Main Components Identification

a) Input Processing Layer
- Image input handling
- Text prompt processing
- Configuration management (YAML files)

b) Core Processing Layer
- Flow Model Integration
- Text-to-Image Pipeline
- Editing Pipeline

c) Output Generation Layer
- Image Generation/Modification
- Result Storage

**[Input Layer]**

- Image Input (example_images/)
- Source Prompt (edits.yaml)
- Target Prompt (edits.yaml)
- Configuration (SD3_exp.yaml/FLUX_exp.yaml)

**[Processing Layer]**

- Flow Model Controller
- FLUX Implementation
- Stable Diffusion 3 Implementation

- Text Processing Pipeline
- Source Prompt Encoding
- Target Prompt Encoding

- Image Processing Pipeline
- Inversion-Free Processing
- Flow Model Transformation

**[Output Layer]**

- Modified Image Output

##### Important Details

- Model Integration Points:
- Connections to external models (FLUX, SD3)
- Where configuration parameters (n_max, n_min) are applied

- Data Flow Indicators:
- Image path flow
- Prompt processing flow
- Model processing flow

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef input fill:#e1f5fe,stroke:#01579b
    classDef processing fill:#e8f5e9,stroke:#1b5e20
    classDef output fill:#fff3e0,stroke:#e65100
    classDef storage fill:#f3e5f5,stroke:#4a148c
    classDef config fill:#fce4ec,stroke:#880e4f

    %% Input Layer
    subgraph InputLayer["Input Processing Layer"]
        ImageInput["Image Input"]
        SourcePrompt["Source Prompt"]
        TargetPrompt["Target Prompt"]
        Config["Configuration Files"]
    end

    %% Processing Layer
    subgraph ProcessingLayer["Core Processing Layer"]
        FlowController["Flow Model Controller"]
        
        subgraph ModelImpl["Model Implementations"]
            FLUX["FLUX Model"]
            SD3["Stable Diffusion 3"]
        end
        
        subgraph Pipeline["Processing Pipeline"]
            TextProc["Text Processing"]
            ImageProc["Image Processing"]
            FlowTransform["Flow Transformation"]
        end
    end

    %% Output Layer
    subgraph OutputLayer["Output Generation Layer"]
        OutputGen["Image Generation"]
        ResultStore["Result Storage"]
    end

    %% Connections
    ImageInput --> TextProc
    SourcePrompt --> TextProc
    TargetPrompt --> TextProc
    Config --> FlowController
    
    TextProc --> FlowController
    ImageProc --> FlowTransform
    FlowController --> ModelImpl
    ModelImpl --> FlowTransform
    FlowTransform --> OutputGen
    OutputGen --> ResultStore

    %% Click events
    click ImageInput "https://github.com/fallenshock/FlowEdit/tree/main/example_images/"
    click Config "https://github.com/fallenshock/FlowEdit/blob/main/FLUX_exp.yaml"
    click Config "https://github.com/fallenshock/FlowEdit/blob/main/SD3_exp.yaml"
    click SourcePrompt "https://github.com/fallenshock/FlowEdit/blob/main/edits.yaml"
    click TargetPrompt "https://github.com/fallenshock/FlowEdit/blob/main/edits.yaml"
    click FlowController "https://github.com/fallenshock/FlowEdit/blob/main/FlowEdit_utils.py"
    click OutputGen "https://github.com/fallenshock/FlowEdit/blob/main/run_script.py"
    click ResultStore "https://github.com/fallenshock/FlowEdit/tree/main/imgs/"

    %% Styling
    class ImageInput,SourcePrompt,TargetPrompt,Config input
    class FlowController,TextProc,ImageProc,FlowTransform,FLUX,SD3 processing
    class OutputGen,ResultStore output

    %% Legend
    subgraph Legend["Legend"]
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Output Components"]:::output
    end
```
