--- title: Architecture description: Technical overview of how ComfyUI Skills maps agent input into ComfyUI workflow execution through the CLI, schema layer, and multi-server routing. permalink: /architecture/ ---

Architecture

How the repository turns agent input into ComfyUI execution.

The architecture is intentionally simple: expose workflows, map a small parameter surface, queue the job, poll for completion, and download images back to local disk.

System Model

Core components

CLI Commands

What the CLI does

Execution Flow

From natural language to image file

  1. The agent calls comfyui-skill list to discover enabled workflows.
  2. The agent resolves user intent into structured args based on the schema.
  3. The CLI maps those args into ComfyUI node fields using schema.json.
  4. The CLI calls native ComfyUI endpoints: /prompt, /history/{prompt_id}, and /view.
  5. Output images are downloaded to local storage and returned to the caller.

Storage Model

How workflows are organized on disk

data/
  <server_id>/
    <workflow_id>/
      workflow.json   # ComfyUI API-format workflow
      schema.json     # Parameter mapping for agents
      history/        # Execution history records

This structure makes workflows portable and easy to inspect. It also gives the repository a clean namespace for multi-server execution.

Why The Schema Layer Matters

ComfyUI graphs are flexible, but agents need contracts

A graph can contain dozens of nodes and many internal fields that should not be exposed directly. The schema layer narrows that surface into a predictable interface with aliases, descriptions, required flags, and types. That is what makes agent calls more reliable and easier to maintain.

Related Pages

Keep exploring