A local-first gallery and workflow runner for ComfyUI outputs.
- Browse, rate, tag, favorite, hide, and bulk-manage large image libraries.
- Import ComfyUI API JSON workflows and run them from the browser.
- Track jobs with live status/progress and attach outputs back into the gallery.
- Expose workflows through HTTP trigger and MCP tools for AI agents.
output.1.mp4
- Highlights
- Architecture
- Install
- Quick Start
- Configuration
- API Reference
- Development
- Testing
- Release Workflow
- Troubleshooting
- License
- Sync from a read-only ComfyUI output source into an independent managed data directory.
- Tag system with drawer navigation, single-select drawer behavior, and multi-tag filter tools.
- Favorites, hidden state, ratings (0-5), and bulk actions.
- Bulk auto-tag from prompt metadata with review-and-edit modal before apply.
- Fast thumbnail browsing with detail modal zoom/pan and mobile-friendly navigation.
- Slideshow mode based on current filters/sort.
- Import API-format ComfyUI workflow JSON and select editable inputs.
- Run workflows with text/number/seed/image inputs.
- Job history with queued/running/completed/error/cancelled states.
- Output previews linked to synced gallery images.
- Workflow organization with folders and reorder controls.
- External workflow trigger API (
/api/workflows/:id/trigger) with trigger schema endpoint. - MCP server support at
/mcp(Streamable HTTP) plus legacy SSE endpoints. - MCP tools:
list_workflows,run_workflow,get_job_status.
- Frontend: React 18 + TypeScript + Vite (
src/client) - Backend: Express + ws (
src/server) - Metadata: SQLite via Node built-in
node:sqlite - Image pipeline: sync/mirror, thumbnails (
sharpwhen available), and blacklist-aware delete
Key files:
src/server/index.js: app bootstrap + route wiringsrc/server/routes/*: API route modulessrc/server/services/*: image/comfy runtime/queue/workflow execution servicessrc/server/db/*: schema + metadata repositorysrc/client/pages/GalleryPage.tsxsrc/client/pages/WorkflowsPage.tsx
Detailed platform docs: docs/INSTALL.md
nix run .#Or build binary:
nix build .#
./result/bin/comfy-output-viewerNixOS module usage:
{
nixpkgs.overlays = [ inputs.comfy-output-viewer.overlays.default ];
imports = [ inputs.comfy-output-viewer.nixosModules.default ];
services.comfy-output-viewer = {
enable = true;
openFirewall = true;
outputDir = "/var/lib/comfyui/output";
dataDir = "/var/lib/comfy-output-viewer";
port = 8008;
};
}Linux:
./scripts/install-linux.shmacOS:
./scripts/install-macos.shShared Unix installer (both):
./scripts/install-unix.shPowerShell:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\install-windows.ps1Or cmd wrapper:
scripts\install-windows.cmdnpm install
npm run build
npm run start- Create
.env(optional):
cp .env.example .env- Set at least:
COMFY_OUTPUT_DIRto your ComfyUI output folder.DATA_DIRto a writable folder for mirrored data and SQLite.
- Start server/UI:
npm run start- Open
http://localhost:8008and click Sync.
For deterministic demos/screenshots with seeded image/workflow/job states:
npm run dev:mockThis seeds .mock-dev/source + .mock-dev/data and runs with MOCK_DEV_MODE=1.
Configure via environment variables or .env:
| Variable | Default | Description |
|---|---|---|
COMFY_OUTPUT_DIR |
/var/lib/comfyui/output |
Source directory to scan (read-only by app design). |
OUTPUT_DIR |
n/a | Legacy alias for COMFY_OUTPUT_DIR. |
DATA_DIR |
~/comfy_viewer/data |
App-managed mirror, thumbnails, sqlite db, and workflow files. |
COMFY_API_URL |
http://127.0.0.1:8188 |
ComfyUI API base URL. |
COMFY_CLIENT_ID |
auto-generated | Optional ComfyUI websocket client id override. |
SERVER_PORT |
8008 in prod / 8009 in dev |
Preferred server port variable. |
PORT |
fallback | Legacy port fallback. |
SYNC_INTERVAL_MS |
0 |
Auto-sync interval in ms (0 disables). |
THUMB_MAX |
512 |
Max thumbnail dimension. |
THUMB_QUALITY |
72 |
JPEG thumbnail quality (0-100). |
MAX_INPUT_UPLOAD_BYTES |
52428800 |
Max workflow image upload payload size. |
QUEUE_REMAINING_OVERRIDE_TTL_MS |
10000 |
Queue override cache TTL. |
MOCK_DEV_ROOT |
.mock-dev |
Seed root used by npm run mock:seed. |
MOCK_DEV_MODE |
0 |
Enables stable mock job payload behavior for demos. |
GET /api/imagesPOST /api/favoritePOST /api/hiddenPOST /api/tagsPOST /api/deletePOST /api/delete/bulkPOST /api/prompts/bulkPOST /api/syncGET /api/images/:path/prompt
GET /api/workflowsPOST /api/workflowsGET /api/workflows/:idPUT /api/workflows/:idDELETE /api/workflows/:idPOST /api/workflows/:id/runGET /api/workflows/:id/trigger-schemaPOST /api/workflows/:id/triggerGET /api/jobs/:idPOST /api/jobs/:id/cancel
POST /mcpGET /mcpDELETE /mcpGET /mcp/sse(legacy)POST /mcp/messages(legacy)
npm run devUseful scripts:
npm run mock:seed
npm run dev:mock
npm run build
npm run preview
npm run startInstall helper scripts:
npm run install:unix
npm run install:linux
npm run install:macos
npm run install:windowsnpm run test
npm run test:all
npm run test:server
npm run test:client
npm run test:coverageWatch mode:
npm run test:server:watch
npm run test:client:watch- Update
package.jsonversion (semver). - Update
CHANGELOG.mdentry for the same version. - If
package-lock.jsonchanged, refresh Nix npm hash:
./scripts/update-npm-deps-hash.sh- Verify:
npm run build
npm run test
nix build .#comfy-output-viewer --no-link- If startup fails with missing source dir, verify
COMFY_OUTPUT_DIRexists and permissions allow read access. - If thumbnails are slow, ensure
sharpcan load native deps (notablylibvipson Linux). - If Comfy job updates stall, verify
COMFY_API_URLand websocket accessibility. - If deleted images reappear, verify deletion used app APIs so hashes enter blacklist metadata.
MIT


