Automatically organizes ComfyUI workflows with a compact group-aware layout. Created with comfyui-custom-node-template.
- Open ComfyUI
- Go to Manager > Custom Node Manager
- Search for
Node Organizer - Click Install
Use any of these entry points:
- Right-click the canvas and choose Organize Workflow
- Select groups and choose Organize Group
- Click the Organize action-bar button
- Use
Extensions > Node Organizer - Press
Shift+O
Add tokens to group titles to control how nodes are arranged:
| Token | Effect |
|---|---|
[HORIZONTAL] |
Single horizontal row |
[VERTICAL] |
Single vertical column |
[2ROW]...[9ROW] |
Distribute into N rows |
[2COL]...[9COL] |
Distribute into N columns |
Examples:
-
"My Loaders [HORIZONTAL]"- arranges all nodes in a single row -
"Processing [3COL]"- distributes nodes into 3 columns -
Tokens are case-insensitive (
[horizontal]works) -
[1ROW]=[HORIZONTAL],[1COL]=[VERTICAL] -
Nested groups each respect their own tokens
-
Groups without tokens use default DAG-based layout
pnpm typecheckpnpm testpnpm buildpnpm build:libemits the pure library entrypoint tolib/pnpm test:libsmoke-tests the builtcomfyui-node-organizernpm exportpnpm setup:e2eprovisions a dedicated ComfyUI instance for browser tests and installs the exact workflow-template package required by the pinned ComfyUI checkoutpnpm test:e2eruns the full Playwright suite against that instance- Broad installed-template coverage is discovered live at E2E runtime from the pinned test ComfyUI environment, with one correctness-invariant test per installed workflow template
Checked-in repo fixtures live in tests/fixtures/. Visual regression is graph-canvas scoped and runs as part of the normal E2E suite.
Visual regression baselines are platform-specific: committed snapshots use -win32 and -linux suffixes.
Most users can ignore this section. The extension works entirely inside ComfyUI.
The package is published to npm as comfyui-node-organizer for developers who want to reuse the layout engine outside ComfyUI, for example in a script, service, test harness, or workflow conversion tool.
npm install comfyui-node-organizerimport { normalizeWorkflowGeometry, inferGroupMembership } from "comfyui-node-organizer";It exposes a small pure API:
normalizeWorkflowGeometry(...)lays out plain workflow data and returns absolute node and group rectanglesinferGroupMembership(...)infers direct group membership from node and group rectangles
In practice: if you want "organize this workflow JSON the same way the extension would" without loading ComfyUI, this is the entrypoint.
Build it locally with pnpm build:lib. pnpm test:lib verifies that the built package can be imported by Node.
Install act and Docker, then run:
pnpm ci:localruns the full local CI workflow withact
Maintainer flow:
- Merge the release branch into
main - Trigger
.github/workflows/publish_action.yamlmanually frommain
That workflow runs the full test suite, bumps versioned files with uv run bump-my-version, creates the tag and GitHub release, then publishes the custom node from the bumped tag ref.
Build the extension first so ComfyUI loads the current dist/ output:
pnpm build
Launch the test ComfyUI instance on a free port:
.test-comfy/venv/Scripts/comfy.exe --skip-prompt --workspace .test-comfy/comfyui/ launch -- --cpu --port 65192
If the port is already taken, either choose a different port or stop leftover test-instance processes first:
Get-Process | Where-Object { $_.Path -like '*comfy-node-organizer\\.test-comfy*' } | Stop-Process -Force
Very large or unusual workflows may still expose edge cases. If you hit one, please open a GitHub issue with a minimal reproducible workflow attached.

