# ai-rich/comfyui-workflow architecture

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

- Interactive diagram: https://gitdiagram.com/ai-rich/comfyui-workflow
- Repository: https://github.com/ai-rich/comfyui-workflow

## Overview

1. This repository is a ComfyUI workflow library, not a traditional application codebase. Each `.json` file is a standalone node graph describing an AI generation or editing pipeline.

2. The top-level architecture is a content catalog organized by use case. Folders are grouped by task domain rather than by code layer: interior design, 2D/3D conversion, face swap and portrait, photography and cartoonization, restoration/upscaling, video generation, e-commerce, FLUX, SDXL, and practical tools.

3. The core runtime boundary is ComfyUI itself. These JSON files are intended to be imported into a ComfyUI environment where model nodes, conditioning nodes, samplers, upscalers, and post-processing nodes execute the workflow graph. The repo stores workflow definitions, not the models themselves.

4. Most workflows follow a common data path: user input such as text, a portrait image, a product photo, or a video frame enters the graph; conditioning modules shape the generation; a diffusion model produces or edits the image/video; then restoration or enlargement nodes refine the output. The output is usually a final image, a set of frames, or a video clip.

5. A major subsystem is human-centric transformation. The `AI换脸+人像`, `写真`, `人脸模型合成`, and parts of `漫画、卡通` focus on face replacement, identity transfer, portrait stylization, facial refinement, and avatar generation. These workflows commonly combine InstantID, IPAdapter, PhotoMaker, ReActor, face restoration, and upscale steps.

6. Another major subsystem is image quality enhancement and spatial editing. The `AI画质修复+重绘+扩图`, `Practical tools|实用工具`, and related folders cover upscaling, outpainting, inpainting, denoising, background removal, object removal, and detail reconstruction. These workflows act as post-processing and repair layers for existing images rather than pure generation.

7. Video is handled as its own pipeline class in `AI视频转绘` and `视频`. These workflows convert text-to-video, image-to-video, and video-to-video, often using AnimateDiff, SVD, ControlNet, sparse control, frame interpolation, or motion guidance. The data boundary here is temporal: input frames are transformed into coherent sequences with emphasis on stability and flicker reduction.

8. Product and commercial workflows form a practical application layer. `电商`, `AI室内设计`, and some `AI摄影+转漫画+写真` workflows address product background replacement, virtual try-on, interior rendering, and commercial imagery. These typically combine segmentation or masking with controlled generation so the subject stays consistent while the scene changes.

9. Model families are represented explicitly in the workflow names. The repo spans SD1.5, SDXL, FLUX, SVD, AnimateDiff, CatVTON, BrushNet, SUPIR, ControlNet, IPAdapter, and DeepSeek/Janus-Pro-related examples. This tells you the architecture is multi-model and modular, with workflows acting as orchestrations over different model backends.

10. The `deepseek` folder is a separate capability branch for image-text and text-image workflows using Janus-Pro. It sits alongside, not inside, the diffusion-centric folders, which suggests the repo is broadening beyond image editing into multimodal reasoning and generation.

11. `assets/` is supporting documentation/branding content rather than pipeline logic. The README points to an “AI图工厂” miniapp that can download and run these workflows online, so the repo also serves as a distribution catalog for an external product.

12. There is little shared implementation code in the repository; the main architectural boundary is “one JSON = one workflow.” That means reuse happens by copying or adapting workflow graphs, not by importing common modules. For an architecture diagram, the important layers are: user intent, workflow category, ComfyUI graph execution, model assets, and generated media output.

Main entry points: [`AI2D、3D`](https://github.com/ai-rich/comfyui-workflow/tree/master/AI2D、3D) (2D/3D conversion), [`FLUX`](https://github.com/ai-rich/comfyui-workflow/tree/master/FLUX) (FLUX), [`SDXL`](https://github.com/ai-rich/comfyui-workflow/tree/master/SDXL) (SDXL), [`assets`](https://github.com/ai-rich/comfyui-workflow/tree/master/assets) (Assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Workflow catalog"]
  node_repo["Workflow repo<br/>catalog"]
  node_usecases["Task folders<br/>organized catalog"]
  node_interact["2D/3D conversion<br/>spatial conversion"]
  node_flux["FLUX<br/>model family"]
  node_sdxl["SDXL<br/>model family"]
  node_assets["Assets<br/>support files"]
end

subgraph group_human["Human-centric"]
  node_faceswap["Face swap<br/>portrait transformation"]
  node_avatar["Avatar craft<br/>portrait generation"]
  node_comic["Comic styles<br/>stylization"]
end

subgraph group_enhance["Repair & edit"]
  node_restore["Image repair<br/>enhancement"]
  node_tools["Practical tools<br/>utility workflows"]
end

subgraph group_video["Video pipelines"]
  node_video2["Video转绘<br/>temporal generation"]
  node_video3["Video"]
end

subgraph group_commercial["Commercial use"]
  node_interior["Interior design<br/>scene generation"]
  node_ecommerce["E-commerce<br/>product workflows"]
  node_photo["Photography<br/>portrait/commercial"]
end

subgraph group_multimodal["Multimodal"]
  node_deepseek["Janus-Pro<br/>multimodal"]
end

subgraph group_runtime["Runtime"]
  node_comfyui["ComfyUI<br/>graph runtime"]
  node_models["Model backends<br/>diffusion models"]
  node_output["Generated media<br/>image/video outputs"]
end

node_repo -->|"organized by"| node_usecases
node_usecases -->|"imported into"| node_comfyui
node_comfyui -->|"executes with"| node_models
node_models -->|"produce"| node_output
node_interior -->|"runs in"| node_comfyui
node_ecommerce -->|"runs in"| node_comfyui
node_photo -->|"runs in"| node_comfyui
node_faceswap -->|"runs in"| node_comfyui
node_avatar -->|"runs in"| node_comfyui
node_comic -->|"runs in"| node_comfyui
node_restore -->|"runs in"| node_comfyui
node_tools -->|"runs in"| node_comfyui
node_video2 -->|"runs in"| node_comfyui
node_video3 -->|"runs in"| node_comfyui
node_interact -->|"runs in"| node_comfyui
node_flux -->|"runs in"| node_comfyui
node_sdxl -->|"runs in"| node_comfyui
node_deepseek -->|"runs in"| node_comfyui
node_assets -->|"supports"| node_repo

click node_interior "https://github.com/ai-rich/comfyui-workflow/tree/master/AI Interior Design|AI室内设计"
click node_ecommerce "https://github.com/ai-rich/comfyui-workflow/tree/master/电商"
click node_photo "https://github.com/ai-rich/comfyui-workflow/tree/master/AI摄影+转漫画+写真"
click node_faceswap "https://github.com/ai-rich/comfyui-workflow/tree/master/AI换脸+人像"
click node_avatar "https://github.com/ai-rich/comfyui-workflow/tree/master/人脸模型合成"
click node_comic "https://github.com/ai-rich/comfyui-workflow/tree/master/漫画、卡通"
click node_restore "https://github.com/ai-rich/comfyui-workflow/tree/master/AI画质修复+重绘+扩图"
click node_tools "https://github.com/ai-rich/comfyui-workflow/tree/master/Practical tools|实用工具"
click node_video2 "https://github.com/ai-rich/comfyui-workflow/tree/master/AI视频转绘"
click node_video3 "https://github.com/ai-rich/comfyui-workflow/tree/master/视频"
click node_interact "https://github.com/ai-rich/comfyui-workflow/tree/master/AI2D、3D"
click node_flux "https://github.com/ai-rich/comfyui-workflow/tree/master/FLUX"
click node_sdxl "https://github.com/ai-rich/comfyui-workflow/tree/master/SDXL"
click node_deepseek "https://github.com/ai-rich/comfyui-workflow/tree/master/deepseek"
click node_assets "https://github.com/ai-rich/comfyui-workflow/tree/master/assets"

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,node_usecases,node_interact,node_flux,node_sdxl,node_assets,node_comfyui,node_models,node_output toneBlue
class node_faceswap,node_avatar,node_comic toneAmber
class node_restore,node_tools toneMint
class node_video2,node_video3 toneRose
class node_interior,node_ecommerce,node_photo toneIndigo
class node_deepseek toneTeal
```

## Components

### Workflow catalog

Top-level repository organization by use case and model family.

- **Workflow repo**: catalog · Repository as a library of standalone ComfyUI workflow JSON graphs.
- **Task folders**: organized catalog · Use-case-oriented folders that group workflows by application domain rather than code layers.
- [2D/3D conversion](https://github.com/ai-rich/comfyui-workflow/tree/master/AI2D、3D): spatial conversion · 2D-to-3D, multi-view, and 3D rendering workflows. · `AI2D、3D`
- [FLUX](https://github.com/ai-rich/comfyui-workflow/tree/master/FLUX): model family · FLUX-based text-to-image workflows. · `FLUX`
- [SDXL](https://github.com/ai-rich/comfyui-workflow/tree/master/SDXL): model family · SDXL text-to-image and refiner workflows. · `SDXL`
- [Assets](https://github.com/ai-rich/comfyui-workflow/tree/master/assets): support files · Branding and documentation assets supporting the workflow catalog, not pipeline logic. · `assets`

### Human-centric

Portraits, face swap, avatar, cartoon, and face-model workflows.

- [Face swap](https://github.com/ai-rich/comfyui-workflow/tree/master/AI换脸+人像): portrait transformation · 换脸, portrait transfer, face restoration, and identity-preserving stylization workflows. · `AI换脸+人像`
- [Avatar craft](https://github.com/ai-rich/comfyui-workflow/tree/master/人脸模型合成): portrait generation · Face-model synthesis, custom avatars, and cartoon/profile-image workflows. · `人脸模型合成`
- [Comic styles](https://github.com/ai-rich/comfyui-workflow/tree/master/漫画、卡通): stylization · Cartoonization, illustration conversion, and comic-character workflows. · `漫画、卡通`

### Repair & edit

Upscaling, restoration, outpainting, inpainting, and image refinement.

- [Image repair](https://github.com/ai-rich/comfyui-workflow/tree/master/AI画质修复+重绘+扩图): enhancement · Upscaling, denoising, outpainting, inpainting, and detail reconstruction workflows. · `AI画质修复+重绘+扩图`
- [Practical tools](https://github.com/ai-rich/comfyui-workflow/tree/HEAD/Practical%20tools%7C%E5%AE%9E%E7%94%A8%E5%B7%A5%E5%85%B7): utility workflows · General-purpose repair and transformation utilities used as support workflows. · `Practical tools|实用工具`

### Video pipelines

Temporal workflows for animation, image-to-video, and video-to-video.

- [Video转绘](https://github.com/ai-rich/comfyui-workflow/tree/master/AI视频转绘): temporal generation · Dedicated video generation and video-to-video transformation workflows. · `AI视频转绘`
- [Video](https://github.com/ai-rich/comfyui-workflow/tree/master/视频): simple video · Smaller video-focused workflows such as SVD-based generation and basic text-to-video. · `视频`

### Commercial use

Interior, e-commerce, product, and photography workflows.

- [Interior design](https://github.com/ai-rich/comfyui-workflow/tree/HEAD/AI%20Interior%20Design%7CAI%E5%AE%A4%E5%86%85%E8%AE%BE%E8%AE%A1): scene generation · 室内设计 workflows for room rendering, product background replacement, and architectural visualization. · `AI Interior Design|AI室内设计`
- [E-commerce](https://github.com/ai-rich/comfyui-workflow/tree/master/电商): product workflows · Product background replacement, clothing swap, and commercial composition workflows. · `电商`
- [Photography](https://github.com/ai-rich/comfyui-workflow/tree/master/AI摄影+转漫画+写真): portrait/commercial · Photography, photo styling, and product-shoot workflows. · `AI摄影+转漫画+写真`

### Multimodal

Non-diffusion text/image reasoning and generation examples.

- [Janus-Pro](https://github.com/ai-rich/comfyui-workflow/tree/master/deepseek): multimodal · DeepSeek Janus-Pro image-to-text and text-to-image examples. · `deepseek`

### Runtime

Execution environment and model backends used by the workflow JSON graphs.

- **ComfyUI**: graph runtime · Execution boundary where imported workflow graphs run node-by-node.
- **Model backends**: diffusion models · Workflow-selected model families and plugins such as SD1.5, SDXL, FLUX, SVD, AnimateDiff, ControlNet, IPAdapter, InstantID, PhotoMaker, ReActor, BrushNet, SUPIR, CatVTON.
- **Generated media**: image/video outputs · Final images, edited portraits, frame sequences, GIFs, and video clips produced by workflows.

## Connections

- Workflow repo → Task folders: organized by · Repository contents are structured as use-case folders of standalone workflow JSONs.
- Task folders → ComfyUI: imported into · Each workflow is meant to run inside ComfyUI.
- ComfyUI → Model backends: executes with · ComfyUI nodes coordinate model loading, conditioning, sampling, and post-processing.
- Model backends → Generated media: produce · Model-backed graphs generate or edit media outputs.
- Interior design → ComfyUI: runs in · Interior design workflows are ComfyUI graphs.
- E-commerce → ComfyUI: runs in · Commercial product workflows execute in ComfyUI.
- Photography → ComfyUI: runs in · Photography and stylization workflows execute in ComfyUI.
- Face swap → ComfyUI: runs in · Face-centric workflows are ComfyUI graphs.
- Avatar craft → ComfyUI: runs in · Avatar synthesis workflows execute in ComfyUI.
- Comic styles → ComfyUI: runs in · Cartoon and illustration workflows execute in ComfyUI.
- Image repair → ComfyUI: runs in · Repair and refinement workflows execute in ComfyUI.
- Practical tools → ComfyUI: runs in · Utility workflows execute in ComfyUI.
- Video转绘 → ComfyUI: runs in · Advanced animation and video transformation workflows execute in ComfyUI.
- Video → ComfyUI: runs in · Basic video workflows execute in ComfyUI.
- 2D/3D conversion → ComfyUI: runs in · 2D/3D conversion workflows execute in ComfyUI.
- FLUX → ComfyUI: runs in · FLUX workflows are imported into ComfyUI.
- SDXL → ComfyUI: runs in · SDXL workflows are imported into ComfyUI.
- Janus-Pro → ComfyUI: runs in · Janus-Pro workflows are represented as ComfyUI-style examples in the catalog.
- Assets → Workflow repo: supports · Assets provide documentation and branding around the workflow catalog.
