# mrzhangjl/6127 architecture

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

- Interactive diagram: https://gitdiagram.com/mrzhangjl/6127
- Repository: https://github.com/mrzhangjl/6127

## Overview

This is a single-file comparative image-generation experiment, rather than a general-purpose application. Its workflow prepares a custom reference set, loads VAR and DiT, generates and evaluates images, then benchmarks and explores model settings to produce tables and figures. The source excerpt is partial and the README is empty, so links are shown only where the excerpt or its explicit comments support them; all repository components use the exact source path shown in the tree.

Main entry points: [`files-2/files-2/var_vs_dit_pipeline.py`](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py) (Classes and config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Experiment setup"]
  node_config["Classes and config"]
  node_reference["Reference preparation"]
  node_reference_images["Custom reference images"]
end

subgraph group_models["Generation models"]
  node_var_load["VAR model loading"]
  node_dit_load["DiT pipeline loading"]
  node_var_sampler["VAR scale sampler"]
  node_dit_sampler["DiT timestep sampler"]
  node_generation["Sample generation"]
end

subgraph group_evaluation["Evaluation"]
  node_benchmark["Timing and VRAM benchmark"]
  node_metrics["Quality metrics"]
  node_ablations["Parameter ablations"]
end

subgraph group_outputs["Results"]
  node_figures["Progression and tradeoff figures"]
  node_results["Tables and image outputs"]
end

node_researcher(("Researcher"))
node_hf["Hugging Face Hub"]

node_researcher -->|"provides images"| node_reference_images
node_researcher -->|"sets experiment"| node_config
node_reference -->|"normalizes images"| node_reference_images
node_config -->|"sets classes"| node_reference
node_var_load -->|"downloads checkpoints"| node_hf
node_config -->|"sets depth"| node_var_load
node_config -->|"sets model"| node_dit_load
node_var_load -->|"provides model"| node_var_sampler
node_dit_load -->|"provides pipeline"| node_dit_sampler
node_config -->|"sets sampling options"| node_generation
node_generation -->|"calls"| node_var_sampler
node_generation -->|"calls"| node_dit_sampler
node_benchmark -->|"times calls"| node_var_sampler
node_benchmark -->|"times calls"| node_dit_sampler
node_generation -->|"saves samples"| node_results
node_metrics -->|"compares against"| node_reference_images
node_metrics -->|"writes metrics"| node_results
node_ablations -->|"varies settings"| node_generation
node_ablations -->|"evaluates samples"| node_metrics
node_benchmark -->|"writes timings"| node_results
node_figures -->|"captures progression"| node_var_sampler
node_figures -->|"captures progression"| node_dit_sampler
node_figures -->|"saves figures"| node_results

click node_config "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_reference "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_var_load "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_dit_load "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_var_sampler "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_dit_sampler "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_generation "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_benchmark "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_metrics "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_ablations "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_figures "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py"
click node_results "https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.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_config,node_reference,node_reference_images toneBlue
class node_var_load,node_dit_load,node_var_sampler,node_dit_sampler,node_generation toneAmber
class node_benchmark,node_metrics,node_ablations toneMint
class node_figures,node_results toneRose
class node_researcher,node_hf toneIndigo
```

## Components

### Experiment setup

- [Classes and config](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [Reference preparation](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- **Custom reference images**

### Generation models

- [VAR model loading](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [DiT pipeline loading](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [VAR scale sampler](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [DiT timestep sampler](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [Sample generation](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`

### Evaluation

- [Timing and VRAM benchmark](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [Quality metrics](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [Parameter ablations](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`

### Results

- [Progression and tradeoff figures](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`
- [Tables and image outputs](https://github.com/mrzhangjl/6127/blob/master/files-2/files-2/var_vs_dit_pipeline.py): `files-2/files-2/var_vs_dit_pipeline.py`

### Other components

- **Researcher**
- **Hugging Face Hub**

## Connections

- Researcher → Custom reference images: provides images
- Researcher → Classes and config: sets experiment
- Reference preparation → Custom reference images: normalizes images
- Classes and config → Reference preparation: sets classes
- VAR model loading → Hugging Face Hub: downloads checkpoints
- Classes and config → VAR model loading: sets depth
- Classes and config → DiT pipeline loading: sets model
- VAR model loading → VAR scale sampler: provides model
- DiT pipeline loading → DiT timestep sampler: provides pipeline
- Classes and config → Sample generation: sets sampling options
- Sample generation → VAR scale sampler: calls
- Sample generation → DiT timestep sampler: calls
- Timing and VRAM benchmark → VAR scale sampler: times calls
- Timing and VRAM benchmark → DiT timestep sampler: times calls
- Sample generation → Tables and image outputs: saves samples
- Quality metrics → Custom reference images: compares against
- Quality metrics → Tables and image outputs: writes metrics
- Parameter ablations → Sample generation: varies settings
- Parameter ablations → Quality metrics: evaluates samples
- Timing and VRAM benchmark → Tables and image outputs: writes timings
- Progression and tradeoff figures → VAR scale sampler: captures progression
- Progression and tradeoff figures → DiT timestep sampler: captures progression
- Progression and tradeoff figures → Tables and image outputs: saves figures
