How ai-rich/comfyui-workflow works
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 2D/3D conversion · FLUX FLUX · SDXL SDXL · assets Assets
Components 20
Workflow catalog
Top-level repository organization by use case and model family.
- Workflow repo · Repository as a library of standalone ComfyUI workflow JSON graphs.
- Task folders · Use-case-oriented folders that group workflows by application domain rather than code layers.
- 2D/3D conversion · 2D-to-3D, multi-view, and 3D rendering workflows.
AI2D、3D - FLUX · FLUX-based text-to-image workflows.
FLUX - SDXL · SDXL text-to-image and refiner workflows.
SDXL - Assets · 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 · 换脸, portrait transfer, face restoration, and identity-preserving stylization workflows.
AI换脸+人像 - Avatar craft · Face-model synthesis, custom avatars, and cartoon/profile-image workflows.
人脸模型合成 - Comic styles · Cartoonization, illustration conversion, and comic-character workflows.
漫画、卡通
Repair & edit
Upscaling, restoration, outpainting, inpainting, and image refinement.
- Image repair · Upscaling, denoising, outpainting, inpainting, and detail reconstruction workflows.
AI画质修复+重绘+扩图 - Practical tools · 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.
Commercial use
Interior, e-commerce, product, and photography workflows.
- Interior design · 室内设计 workflows for room rendering, product background replacement, and architectural visualization.
AI Interior Design|AI室内设计 - E-commerce · Product background replacement, clothing swap, and commercial composition workflows.
电商 - Photography · Photography, photo styling, and product-shoot workflows.
AI摄影+转漫画+写真
Multimodal
Non-diffusion text/image reasoning and generation examples.
- Janus-Pro · 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 · Execution boundary where imported workflow graphs run node-by-node.
- Model backends · Workflow-selected model families and plugins such as SD1.5, SDXL, FLUX, SVD, AnimateDiff, ControlNet, IPAdapter, InstantID, PhotoMaker, ReActor, BrushNet, SUPIR, CatVTON.
- Generated media · Final images, edited portraits, frame sequences, GIFs, and video clips produced by workflows.
Connections 19
- 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.