# greenzorro/comfyui-workflow-upscaler architecture

> Architecture diagram of the GitHub repository greenzorro/comfyui-workflow-upscaler, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/greenzorro/comfyui-workflow-upscaler
- Repository: https://github.com/greenzorro/comfyui-workflow-upscaler

## Overview

1. **What this repo is**
   - This is not an application codebase; it is a collection of **ComfyUI workflow definitions** for image upscaling.
   - The core deliverables are four JSON workflow graphs plus documentation and example images.

2. **Primary repository boundary**
   - The repo itself holds only the workflow specs and usage guidance.
   - Actual execution happens in an external **ComfyUI runtime** with the required custom nodes and model files installed.

3. **Main workflow artifacts**
   - `upscaler-sharpen.json`: a lightweight, non-diffusion upscaler focused on sharpening/detail recovery.
   - `upscaler-creative.json`: an SDXL-based creative upscaler that can alter or enrich image content.
   - `upscaler-ultra-sharp.json`: a Flux Dev–based workflow optimized for stronger fidelity and resolution enhancement.
   - `upscaler-mad-mode.json`: a chained workflow that combines the Flux-based and SDXL-based approaches.

4. **Functional architecture of the workflows**
   - All workflows start from an **input image** and end with an **upscaled output image**.
   - They differ mainly in how much they preserve the source versus how much they regenerate detail:
     - **Sharpen** = preserve composition, improve crispness.
     - **Creative** = preserve composition with controlled AI reinterpretation.
     - **Ultra sharp** = maximize high-resolution detail using Flux Dev.
     - **Mad mode** = sequential combination for maximum detail and creativity.

5. **Shared processing pattern**
   - The workflows likely follow a common ComfyUI graph shape:
     - load source image
     - resize / upscale or latent preparation
     - apply model-driven enhancement
     - optionally apply ControlNet and/or LoRA conditioning
     - decode and save final image
   - The “creative” variants use **low denoise / conditioning strength** to keep the original composition while allowing detail synthesis.

6. **Model and asset boundaries**
   - The repo does not ship models; it assumes external model placement in standard ComfyUI folders such as:
     - `unet`
     - `checkpoints`
     - `clip`
     - `vae`
     - `controlnet`
     - `upscale_models`
     - `embeddings`
     - `loras`
   - This makes the workflows portable, but dependent on the exact model versions listed in the README.

7. **Custom node dependency layer**
   - Several workflows depend on third-party ComfyUI extensions:
     - **ComfyUI_Essentials**
     - **ComfyUI-Easy-Use**
     - **ComfyUI-Anyline**
     - **ComfyUI_UltimateSDUpscale**
     - **Comfyui_TTP_Toolset**
   - These nodes form the “middle layer” between the graph definitions and the base ComfyUI engine.

8. **Modeling/conditioning strategy**
   - The creative workflows rely on a stack of conditioning components:
     - **SDXL / DreamShaper XL Lightning** for generation
     - **Anyline / MistoLine ControlNet** for structural guidance
     - **LoRA** for detail injection
     - **negative embedding** to steer away from unwanted artifacts
   - This is why the creative workflow can change fine-grained content while still keeping the overall image recognizably aligned.

9. **Execution environments**
   - The repo is designed to run:
     - locally in ComfyUI
     - or in preconfigured cloud notebooks on **Kaggle** and **Colab**
   - That means infrastructure is external to the repo; the workflow JSON is the portable unit, not the compute environment.

10. **Documentation and examples**
    - The `examples/` folder and embedded screenshots demonstrate expected output behavior, especially for the creative workflow.
    - The README functions as the operational guide: it maps each workflow to required models, custom nodes, and expected tradeoffs.

11. **External service dependencies**
    - Model downloads are sourced from **Hugging Face**, **Civitai**, and **Liblib**.
    - Those services are part of the supply chain for the workflows, but not runtime dependencies once models are installed.

12. **How to draw the architecture**
    - Diagram this as a **workflow repository** feeding a **ComfyUI execution environment**.
    - Show the input image flowing into one of four workflow graphs, each graph depending on:
      - ComfyUI core
      - custom nodes
      - externally stored models
    - Then show the final image output, with the “mad mode” graph explicitly represented as a composition of the Flux-based and SDXL-based upscaling stages.

Main entry points: [`upscaler-creative.json`](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-creative.json) (Creative), [`upscaler-ultra-sharp.json`](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-ultra-sharp.json) (Ultra sharp), [`upscaler-mad-mode.json`](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-mad-mode.json) (Mad mode), [`upscaler-sharpen.json`](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-sharpen.json) (Sharpen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo["Repository"]
  node_repo_root["Workflow repo<br/>workflow collection"]
end

subgraph group_workflows["Workflows"]
  node_sharpen["Sharpen<br/>workflow json"]
  node_creative["Creative<br/>workflow json"]
  node_ultra_sharp["Ultra sharp<br/>workflow json"]
  node_mad_mode["Mad mode<br/>workflow json"]
  node_flux_stage["Flux stage<br/>flux upscaler"]
  node_sdxl_stage["SDXL stage<br/>sdxl upscaler"]
end

subgraph group_runtime["ComfyUI Runtime"]
  node_input_image["Input image<br/>source image"]
  node_output_image["Output image<br/>upscaled result"]
  node_comfy_core["ComfyUI core<br/>execution engine"]
  node_custom_nodes{{"Custom nodes<br/>extension layer"}}
  node_controlnet{{"ControlNet<br/>conditioning"}}
  node_lora{{"LoRA<br/>conditioning"}}
  node_negative_emb{{"Negative emb<br/>conditioning"}}
  node_notebooks(("Kaggle/Colab<br/>execution environment"))
end

subgraph group_assets["External Assets"]
  node_model_store[("Model store<br/>external models")]
  node_model_sources(("Model sources<br/>download providers"))
end

subgraph group_docs["Docs & Examples"]
  node_readme["README<br/>guide<br/>[README.md]"]
  node_readme_zh["中文 README<br/>guide<br/>[README_ZH_CN.md]"]
  node_examples(("Examples<br/>sample outputs"))
end

node_repo_root -->|"documented by"| node_readme
node_repo_root -->|"localized by"| node_readme_zh
node_repo_root -->|"demonstrated by"| node_examples
node_repo_root -->|"contains"| node_sharpen
node_repo_root -->|"contains"| node_creative
node_repo_root -->|"contains"| node_ultra_sharp
node_repo_root -->|"contains"| node_mad_mode
node_input_image -->|"feeds"| node_sharpen
node_input_image -->|"feeds"| node_creative
node_input_image -->|"feeds"| node_ultra_sharp
node_input_image -->|"feeds"| node_mad_mode
node_sharpen -->|"produces"| node_output_image
node_creative -->|"produces"| node_output_image
node_ultra_sharp -->|"produces"| node_output_image
node_mad_mode -->|"produces"| node_output_image
node_creative -->|"uses"| node_sdxl_stage
node_ultra_sharp -->|"uses"| node_flux_stage
node_mad_mode -->|"starts with"| node_flux_stage
node_flux_stage -->|"hands off to"| node_sdxl_stage
node_sdxl_stage -->|"finishes as"| node_output_image
node_creative -->|"conditions on"| node_controlnet
node_creative -->|"adapts with"| node_lora
node_creative -->|"steered by"| node_negative_emb
node_sharpen -->|"depends on"| node_custom_nodes
node_creative -->|"depends on"| node_custom_nodes
node_ultra_sharp -->|"depends on"| node_custom_nodes
node_mad_mode -->|"depends on"| node_custom_nodes
node_custom_nodes -->|"extends"| node_comfy_core
node_comfy_core -->|"loads"| node_model_store
node_model_store -.->|"sourced from"| node_model_sources
node_notebooks -->|"hosts"| node_comfy_core
node_readme -->|"specifies"| node_model_store
node_readme -->|"specifies"| node_custom_nodes
node_examples -->|"illustrates"| node_creative

click node_readme "https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/README.md"
click node_readme_zh "https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/README_ZH_CN.md"
click node_examples "https://github.com/greenzorro/comfyui-workflow-upscaler/tree/main/examples"
click node_sharpen "https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-sharpen.json"
click node_creative "https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-creative.json"
click node_ultra_sharp "https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-ultra-sharp.json"
click node_mad_mode "https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-mad-mode.json"

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_repo_root toneBlue
class node_sharpen,node_creative,node_ultra_sharp,node_mad_mode,node_flux_stage,node_sdxl_stage toneAmber
class node_input_image,node_output_image,node_comfy_core,node_custom_nodes,node_controlnet,node_lora,node_negative_emb,node_notebooks toneMint
class node_model_store,node_model_sources toneRose
class node_readme,node_readme_zh,node_examples toneIndigo
```

## Components

### Repository

Portable workflow specs, docs, and examples.

- **Workflow repo**: workflow collection · Repository boundary containing ComfyUI workflow definitions rather than application code.

### Workflows

Four ComfyUI upscaling graphs with different fidelity and creativity tradeoffs.

- [Sharpen](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-sharpen.json): workflow json · Lightweight upscaler focused on crispness and detail recovery with minimal regeneration. · `upscaler-sharpen.json`
- [Creative](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-creative.json): workflow json · SDXL-based upscaler that preserves composition while allowing controlled reinterpretation. · `upscaler-creative.json`
- [Ultra sharp](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-ultra-sharp.json): workflow json · Flux Dev-based upscaler tuned for higher fidelity and strong resolution enhancement. · `upscaler-ultra-sharp.json`
- [Mad mode](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/upscaler-mad-mode.json): workflow json · Chained workflow combining Flux-based and SDXL-based upscaling stages. · `upscaler-mad-mode.json`
- **Flux stage**: flux upscaler · Flux Dev-based enhancement stage used by the ultra-sharp and mad-mode workflows.
- **SDXL stage**: sdxl upscaler · SDXL-based generation and refinement stage used by the creative and mad-mode workflows.

### ComfyUI Runtime

External execution environment plus custom nodes and model assets.

- **Input image**: source image · Starting image fed into each workflow graph.
- **Output image**: upscaled result · Final saved image produced by the workflows.
- **ComfyUI core**: execution engine · External runtime that executes the workflow graphs.
- **Custom nodes**: extension layer · Third-party ComfyUI extensions used as graph building blocks and operators.
- **ControlNet**: conditioning · Structural guidance used by creative workflows to preserve image alignment.
- **LoRA**: conditioning · Detail-injection adapters used to enrich output texture and style.
- **Negative emb**: conditioning · Embedding used to suppress unwanted artifacts during creative generation.
- **Kaggle/Colab**: execution environment · Optional preconfigured notebook environments for running the workflows outside local ComfyUI.

### External Assets

Models, LoRAs, embeddings, and source image supply chain.

- **Model store**: external models · Externally installed checkpoints, UNet, VAE, ControlNet, LoRA, embeddings, and upscale models.
- **Model sources**: download providers · Hugging Face, Civitai, and Liblib as the supply chain for required model files.

### Docs & Examples

Usage guidance and sample outputs.

- [README](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/README.md): guide · Primary usage guide and dependency map for the workflows. · `README.md`
- [中文 README](https://github.com/greenzorro/comfyui-workflow-upscaler/blob/main/README_ZH_CN.md): guide · Chinese documentation variant. · `README_ZH_CN.md`
- [Examples](https://github.com/greenzorro/comfyui-workflow-upscaler/tree/main/examples): sample outputs · Example images showing expected results, especially for creative upscaling. · `examples`

## Connections

- Workflow repo → README: documented by · Repository usage and dependency guidance.
- Workflow repo → 中文 README: localized by · Chinese documentation companion.
- Workflow repo → Examples: demonstrated by · Sample outputs illustrate workflow behavior.
- Workflow repo → Sharpen: contains · Non-diffusion sharpening workflow.
- Workflow repo → Creative: contains · SDXL creative upscaling workflow.
- Workflow repo → Ultra sharp: contains · Flux Dev-based high-fidelity upscaling workflow.
- Workflow repo → Mad mode: contains · Chained combined workflow.
- Input image → Sharpen: feeds · Source image enters the workflow.
- Input image → Creative: feeds · Source image enters the workflow.
- Input image → Ultra sharp: feeds · Source image enters the workflow.
- Input image → Mad mode: feeds · Source image enters the chained workflow.
- Sharpen → Output image: produces · Sharpened upscale result.
- Creative → Output image: produces · Creatively enhanced upscale result.
- Ultra sharp → Output image: produces · High-fidelity upscale result.
- Mad mode → Output image: produces · Final chained upscale result.
- Creative → SDXL stage: uses · SDXL-based enhancement path.
- Ultra sharp → Flux stage: uses · Flux Dev-based enhancement path.
- Mad mode → Flux stage: starts with · First stage in the chained workflow.
- Flux stage → SDXL stage: hands off to · Mad mode composes Flux then SDXL.
- SDXL stage → Output image: finishes as · Final pass in the chained workflow.
- Creative → ControlNet: conditions on · Structural guidance for composition preservation.
- Creative → LoRA: adapts with · Detail/style injection during creative upscaling.
- Creative → Negative emb: steered by · Artifact suppression and output cleanup.
- Sharpen → Custom nodes: depends on · Uses ComfyUI extensions for specialized upscaling operations.
- Creative → Custom nodes: depends on · Uses extension nodes for conditioning and enhancement.
- Ultra sharp → Custom nodes: depends on · Uses extension nodes for Flux-based processing.
- Mad mode → Custom nodes: depends on · Uses both workflow stages and extension nodes.
- Custom nodes → ComfyUI core: extends · Bridges workflow JSON into the ComfyUI engine.
- ComfyUI core → Model store: loads · Runtime reads checkpoints, VAE, ControlNet, LoRA, embeddings, and upscale models.
- Model store → Model sources: sourced from · External model supply chain.
- Kaggle/Colab → ComfyUI core: hosts · Optional execution environments for running ComfyUI.
- README → Model store: specifies · Documents required model placement and versions.
- README → Custom nodes: specifies · Documents required custom node extensions.
- Examples → Creative: illustrates · Example outputs are especially relevant to creative mode.
