Skip to content

Commit eff0148

Browse files
authored
Merge pull request #1685 from NeuralFault/docs
Feat: Initial Documentation
2 parents d97f6cc + a4c13f6 commit eff0148

41 files changed

Lines changed: 2041 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/.gitkeep

Whitespace-only changes.

docs/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Stability Matrix Documentation
2+
3+
Stability Matrix is a multi-platform package manager for Stable Diffusion and related AI image/video generation tools. This documentation covers all major features and sections of the application.
4+
5+
This documentation is intended to provide a detailed guide and explanation of the many functions of Stability Matrix, its installation and use for both new and current users, and also more detailed and technical material for advanced users.
6+
While it contains information on a vast majority of application specific functions, it also contains information that applies to AI image, video, and related generation aspects that can be useful both inside and outside of Stability Matrix.
7+
While not all encompassing on every minute detail, it is intended to be updated as new features and changes are released to the project as well as new ecosystem/model/usage information as-needed.
8+
9+
Current Status: In-progress - Structure is in-place and planned docs are currently being progressively created and added.
10+
11+
## Table of Contents
12+
13+
### Getting Started
14+
- [Overview](getting-started/overview.md) — What Stability Matrix is and what it can do and minimal requirements/recommendations on hardware
15+
- [Installation](getting-started/installation.md) — Installing on Windows, macOS, and Linux
16+
- [First Launch](getting-started/first-launch.md) — Walking through the setup wizard
17+
- [Data Directory](getting-started/data-directory.md) — Choosing and managing your data directory
18+
19+
### Package Manager
20+
- [Overview](package-manager/overview.md) — Managing AI packages in Stability Matrix
21+
- [Supported Packages](package-manager/supported-packages.md) — Full list of supported inference and training packages
22+
- [Installing Packages](package-manager/installing-packages.md) — One-click install, hardware selection, GPU backends
23+
- Managing Packages *(planned)* — Launching, monitoring, updating, and deleting installed packages
24+
- Launch Arguments *(planned)* — Configuring launch arguments per package
25+
- Extensions *(planned)* — Browsing and managing package plugins and extensions
26+
27+
### Inference
28+
- [Overview](inference/overview.md) — The Inference UI, panel layout, and project files
29+
- Text to Image *(planned)* — Generating images from text prompts
30+
- Image to Image *(planned)* — Using an image as a generation starting point
31+
- Image Upscale *(planned)* — Upscaling images with AI upscaler models
32+
- Video Generation *(planned)* — Generating video with WAN and SVD models
33+
- Advanced Controls *(planned)* — ControlNet, FaceDetailer, FreeU, LayerDiffuse, and more
34+
35+
### Checkpoint Manager
36+
- Overview *(planned)* — Centralized model storage shared across all packages
37+
- Model Categories *(planned)* — All supported model folder types explained
38+
- Metadata Editing *(planned)* — Importing CivitAI metadata and editing model info
39+
40+
### Model Browser
41+
- Overview *(planned)* — Multi-source model browser and download queue
42+
- CivitAI *(planned)* — Browsing and downloading from CivitAI
43+
- HuggingFace *(planned)* — Browsing and downloading from HuggingFace
44+
- OpenModelDB *(planned)* — Browsing upscaler models from OpenModelDB
45+
46+
### Outputs
47+
- Overview *(planned)* — Image gallery, sorting, filtering, and batch operations
48+
- Image Metadata *(planned)* — Reading embedded generation parameters and ComfyUI node data
49+
50+
### Workflows
51+
- Overview *(planned)* — Browsing and managing ComfyUI workflows
52+
- Community Workflows *(planned)* — Browsing community workflows via OpenArt
53+
54+
### Settings
55+
- Overview *(planned)* — Navigating the settings hub
56+
- General *(planned)* — Theme, language, data directory, and shared folder settings
57+
- Accounts *(planned)* — Lykos account, OAuth login, and API tokens
58+
- Inference Settings *(planned)* — Inference UI behavior and defaults
59+
- Updates *(planned)* — Auto-update channel and frequency settings
60+
61+
### Advanced
62+
- [Overview](advanced/overview.md) — Advanced configuration and technical reference
63+
- Building from Source and Contributing *(planned)* — Local builds, runtime targets, and where to start for code or docs contributions
64+
- Shared Folders *(planned)* — Folder structure, symlinks, and cross-package model sharing
65+
- [Hardware Support](advanced/hardware-support.md) — CUDA, ROCm, DirectML, MPS, ZLUDA, IPEX, and CPU backends
66+
- Python Environment *(planned)* — Virtual environments, uv, pip, and Python version management
67+
- [ComfyUI Integration](advanced/comfyui-integration.md) — ComfyUI node API, WebSocket protocol, and custom nodes
68+
- [Environment Variables](advanced/environment-variables.md) — Per-package environment variable configuration
69+
70+
### Tips and Tricks
71+
- [Overview](tips/overview.md) — Tips and Tricks index
72+
- [Terminology](tips/terminology.md) — Common image generation terms and what they mean
73+
- Inference UI Tips *(planned)* — Effective use of the built-in Inference UI
74+
- Per-Package Tips *(planned)* — Package-specific tips and links to upstream documentation
75+
- AMD GPU Workflow *(planned)* — Getting image and video generation working on AMD hardware
76+
- Model Dependencies *(planned)* — Required secondary files for modern models (text encoders, VAEs, etc.)
77+
- VRAM Optimization *(planned)* — Reducing VRAM usage without sacrificing too much quality or speed
78+
79+
### Troubleshooting
80+
- [Common Issues](troubleshooting/common-issues.md) — Symptom-first fixes for install, launch, GPU, and Inference problems

docs/advanced/.gitkeep

Whitespace-only changes.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# ComfyUI Integration
2+
3+
The Stability Matrix Inference UI is built on top of ComfyUI's API and WebSocket protocol. Understanding this integration is useful if you want to use ComfyUI's own web interface, use the API directly, or troubleshoot connection issues.
4+
5+
[`Section Overview`](overview.md) | [`Home`](../README.md)
6+
7+
## Table of Contents
8+
9+
- [How Stability Matrix Uses ComfyUI](#how-stability-matrix-uses-comfyui)
10+
- [ComfyUI as a Standalone Package](#comfyui-as-a-standalone-package)
11+
- [The ComfyUI Web Interface](#the-comfyui-web-interface)
12+
- [Custom Nodes](#custom-nodes)
13+
- [The ComfyUI API and WebSocket](#the-comfyui-api-and-websocket)
14+
15+
---
16+
17+
## How Stability Matrix Uses ComfyUI
18+
19+
The Inference UI does not replace ComfyUI. It uses ComfyUI as its execution backend.
20+
21+
When you configure a generation tab in Stability Matrix, the app builds a real ComfyUI prompt graph behind the scenes. The inference view models and modules assemble that graph with a node builder, adding the same kinds of nodes you would use manually in ComfyUI: model loaders, text encoders, samplers, VAE encode/decode steps, ControlNet preprocessors, image loaders, tiled VAE nodes, video nodes, and output preview nodes.
22+
23+
In practical terms, that means:
24+
25+
- every generation from the Inference UI is sent to ComfyUI as workflow-style node JSON
26+
- local input images are uploaded into ComfyUI's input area before execution when needed
27+
- some auxiliary files are copied into the local ComfyUI package directory when the workflow requires them
28+
- progress, active-node changes, and preview images are streamed back while the workflow is running
29+
- final outputs are fetched from ComfyUI after execution finishes, then saved by Stability Matrix with its own project and parameter metadata layered on top
30+
31+
So the relationship is best understood as: Stability Matrix provides a curated native UI, while ComfyUI is the engine actually running the graph.
32+
33+
The reverse is not fully symmetrical. Everything the Inference UI does is representable as a ComfyUI workflow, but not every arbitrary ComfyUI workflow is exposed through the Inference UI's built-in cards and panels.
34+
35+
## ComfyUI as a Standalone Package
36+
37+
ComfyUI is available as an installable package in Stability Matrix's Package Manager. When you launch that package through Stability Matrix, the Inference UI connects to it as its local backend.
38+
39+
By default, the ComfyUI package uses host `127.0.0.1` and port `8188`, and the Inference client connects to `http://127.0.0.1:8188`. If you change the ComfyUI launch arguments inside Stability Matrix, the Inference UI reads those host and port values and connects to the configured address instead.
40+
41+
This matters because the Inference UI is not tied to a hardcoded browser tab or embedded widget. It is a client talking to a running ComfyUI server. If the package is stopped, the Inference UI loses its backend. If the package is restarted, the Inference UI reconnects to that backend.
42+
43+
Stability Matrix also knows when it is talking to a locally managed ComfyUI install. In that case it can:
44+
45+
- upload inputs directly to the local package's `input` folder when needed
46+
- read outputs from the local `output` directory
47+
- manage custom-node installs through the package extension system
48+
- restart the package after extension changes when necessary
49+
50+
## The ComfyUI Web Interface
51+
52+
The Inference UI and the ComfyUI web interface are meant to coexist.
53+
54+
Once the ComfyUI package is running, you can open ComfyUI's own browser-based node graph from the Launch page. That graph editor gives you direct access to the raw workflow layer, which is useful when you want to:
55+
56+
- inspect or modify workflows beyond what the Inference UI currently exposes
57+
- use custom nodes or advanced graph structures that do not have native Inference UI cards
58+
- import or build community workflows directly in ComfyUI
59+
- debug a workflow at the node level
60+
61+
This is one of the main strengths of the integration: you can start with Stability Matrix's simpler native controls, then move into ComfyUI's graph editor when you need lower-level control.
62+
63+
Community and exported ComfyUI workflows are also commonly shared as JSON files. Those can be opened in ComfyUI directly, and they are often the easiest way to exchange complex graphs with other users.
64+
65+
## Custom Nodes
66+
67+
ComfyUI's functionality can be extended with custom nodes, and Stability Matrix is aware of that extension model.
68+
69+
For ComfyUI packages installed through Stability Matrix, custom nodes live in the `custom_nodes` directory. You can install them in two common ways:
70+
71+
- use the Extensions browser in Stability Matrix for the ComfyUI package
72+
- manually clone a node repository into `custom_nodes`
73+
74+
Stability Matrix's ComfyUI package uses extension manifests for custom-node discovery. On new ComfyUI installs, ComfyUI Manager is also installed automatically through the package setup process, and the accompanying `--enable-manager` launch argument is enabled by default. That gives the ComfyUI side an in-browser extension manager out of the box.
75+
76+
There is also a deeper integration point in the Inference UI itself: when a built workflow declares required Comfy extensions, Stability Matrix checks whether those extensions are already installed before the first batch runs. If required extensions are missing or version-constrained extensions are out of date, Stability Matrix can prompt you to install or update them and then restart the ComfyUI package so the changes take effect.
77+
78+
This does not eliminate the need to understand custom nodes, but it does reduce some of the manual work when a workflow depends on specific ComfyUI extensions.
79+
80+
## The ComfyUI API and WebSocket
81+
82+
For advanced users, the integration is straightforward: Stability Matrix talks to ComfyUI over its normal local API and websocket endpoints.
83+
84+
The main pieces used by Stability Matrix are:
85+
86+
- REST base address: `http://127.0.0.1:8188/` by default
87+
- `POST /prompt` to submit the generated node graph for execution
88+
- `POST /interrupt` to cancel a running generation
89+
- `POST /upload/image` to send input images into ComfyUI
90+
- `GET /history/{promptId}` to retrieve executed outputs after the prompt finishes
91+
- `GET /view` to download output images returned by ComfyUI history
92+
- WebSocket at `ws://127.0.0.1:8188/ws?clientId=...` for live status, running-node changes, progress data, execution errors, and preview-image bytes
93+
94+
In practice, the websocket is what makes the Inference UI feel live. It is how Stability Matrix receives step progress, node execution state, and preview frames while ComfyUI is still working.
95+
96+
The REST side is used for the request-response parts of the workflow:
97+
98+
- upload inputs
99+
- queue the prompt
100+
- interrupt if cancelled
101+
- fetch history and outputs when execution completes
102+
103+
If you are troubleshooting connection issues, those are the paths to keep in mind. If you are building your own automation around a local ComfyUI instance, Stability Matrix is effectively using the same public backend surface that advanced users can script against themselves.

0 commit comments

Comments
 (0)