6.6 KiB
Architecture Analyzer
ComfyFlow Insight
Technical Documentation
Overview
The Architecture Analyzer is one of the core engines inside ComfyFlow Insight.
Its responsibility is to inspect workflow structure and generate architectural insights that help users understand how a workflow is organized.
Unlike workflow execution analysis, Architecture Analysis focuses on structural design.
It answers questions such as:
- How large is the workflow?
- How deep is the execution chain?
- Where does execution begin?
- Where does execution end?
- How many branches exist?
- How complex is the workflow architecture?
Why Architecture Analysis Matters
As workflows grow larger, understanding the overall structure becomes increasingly difficult.
A workflow containing:
150 Nodes
220 Links
8 Branches
cannot be understood by visually inspecting the canvas alone.
Architecture Analysis provides an engineering-level view of workflow design.
Objectives
The Architecture Analyzer performs the following tasks:
- Detect Entry Nodes
- Detect Exit Nodes
- Calculate Workflow Depth
- Calculate Longest Path
- Detect Branching Structure
- Estimate Architecture Complexity
- Generate Architecture Summary
Workflow Architecture Model
The analyzer treats a workflow as a directed graph.
Example:
LoadImage
↓
ImageScale
↓
KSampler
↓
SaveImage
Graph Representation:
Node A → Node B → Node C → Node D
Each node becomes a graph vertex.
Each link becomes a graph edge.
Entry Nodes
Definition
Entry Nodes are nodes that do not depend on any other nodes.
These nodes represent workflow starting points.
Example
LoadImage
CheckpointLoader
TextPrompt
These nodes receive no workflow input.
Why Entry Nodes Matter
Entry Nodes reveal:
- Workflow starting locations
- Independent execution paths
- Data sources
Large numbers of Entry Nodes may indicate:
- Multiple workflow sections
- Parallel processing pipelines
- Workflow fragmentation
Exit Nodes
Definition
Exit Nodes are nodes that do not feed into any other node.
These nodes represent workflow endpoints.
Example
SaveImage
VideoCombine
OutputNode
Why Exit Nodes Matter
Exit Nodes identify:
- Workflow outputs
- Final processing stages
- Delivery points
Unexpected Exit Nodes often indicate:
- Incomplete workflows
- Missing connections
- Broken output chains
Workflow Depth
Definition
Workflow Depth measures the maximum execution distance from an Entry Node to an Exit Node.
Example
LoadImage
↓
ImageScale
↓
KSampler
↓
SaveImage
Depth:
4
Interpretation
1 – 10 Simple
11 – 25 Medium
26 – 50 Advanced
50+ Enterprise Scale
Why Depth Matters
Deeper workflows:
- Require more maintenance
- Increase debugging difficulty
- Create hidden dependencies
- Increase execution complexity
Longest Path
Definition
Longest Path measures the largest execution chain within the workflow.
Example
LoadImage
↓
Resize
↓
ControlNet
↓
KSampler
↓
Upscaler
↓
SaveImage
Longest Path:
6 Nodes
Benefits
Longest Path identifies:
- Critical execution routes
- Workflow bottlenecks
- Processing complexity
Branch Detection
Definition
A branch occurs when one node feeds multiple downstream nodes.
Example
ImageScale
├── SaveImage
├── PreviewImage
└── VideoCombine
Branch Count:
3
Branch Importance
Branches increase:
- Execution complexity
- Workflow size
- Maintenance effort
Branches also improve:
- Flexibility
- Reusability
- Multi-output workflows
Architecture Complexity
Architecture Complexity is derived from:
Node Count
Link Count
Workflow Depth
Longest Path
Branch Count
Example
Workflow:
Nodes = 120
Links = 180
Depth = 28
Branches = 7
Result:
Architecture Complexity = High
Architecture Categories
Simple
Characteristics:
Few Nodes
Few Connections
Minimal Branching
Typical Size:
1 – 25 Nodes
Medium
Characteristics:
Multiple Processing Stages
Moderate Branching
Manageable Dependencies
Typical Size:
25 – 75 Nodes
Advanced
Characteristics:
Complex Processing
Multiple Branches
Large Dependency Chains
Typical Size:
75 – 200 Nodes
Enterprise
Characteristics:
Large Pipelines
Extensive Branching
High Dependency Density
Team Collaboration
Typical Size:
200+ Nodes
Architecture Summary
The Architecture Analyzer generates a high-level architectural summary.
Example:
Workflow Type:
Advanced
Entry Nodes:
3
Exit Nodes:
2
Workflow Depth:
28
Longest Path:
31
Branch Count:
7
Architecture Complexity:
High
Common Findings
Too Many Entry Nodes
Possible Causes:
- Workflow fragmentation
- Multiple independent systems
Recommended Action:
- Review workflow organization
Too Many Exit Nodes
Possible Causes:
- Multiple outputs
- Incomplete workflow design
Recommended Action:
- Verify intended outputs
Excessive Depth
Possible Causes:
- Overengineering
- Unnecessary processing stages
Recommended Action:
- Simplify workflow where possible
Excessive Branching
Possible Causes:
- Workflow duplication
- Parallel processing
Recommended Action:
- Review branch necessity
Best Practices
Healthy Architecture
Characteristics:
Clear Entry Nodes
Clear Exit Nodes
Controlled Branching
Reasonable Depth
Organized Dependencies
Relationship With Other Engines
Architecture Analyzer works closely with:
Workflow Statistics
Branch Analyzer
Dependency Graph
Workflow Advisor
Together they provide a complete engineering view of workflow design.
Summary
The Architecture Analyzer is responsible for understanding workflow structure.
It converts raw workflow graphs into meaningful architectural insights by identifying:
- Entry Nodes
- Exit Nodes
- Workflow Depth
- Longest Path
- Branching Structure
- Architecture Complexity
These metrics form the foundation for all higher-level analysis performed by ComfyFlow Insight.
Next Document
Continue with:
docs/workflow-statistics.md
This document explains workflow metrics, scoring systems, density calculations, complexity measurements, and workflow scale classification.