comfyanonymous/ComfyUI
Development workflow
The expected loop for working in this repo: branch off master, edit, run lint and tests locally, push, open a PR, address review, merge.
Branches
master— the development branch. Stable releases are tagged from here (v0.20.1,v0.20.0, …). Commits onmasterbetween tags can break custom nodes.- Per-stable patch releases are backported as needed; from v0.4.0 onward, patch versions are reserved for fixes against the current stable release. See the README's "Release Process" section.
There is no long-lived dev or main distinction — master is where work lands.
Editing
Most contributions touch one of three areas:
| You're adding… | Touch primarily… |
|---|---|
| A new built-in node | comfy_extras/nodes_<feature>.py |
| Support for a new model | comfy/ldm/<model>/, comfy/supported_models.py, comfy/text_encoders/, nodes.py |
| Executor or caching change | execution.py, comfy_execution/*.py |
| Server / API route | server.py, api_server/, app/ managers |
| LoRA / hooks / patches | comfy/lora.py, comfy/hooks.py, comfy/model_patcher.py |
| Memory management | comfy/model_management.py, comfy/ops.py |
For new built-in nodes, prefer the V3 schema (see comfy_extras/nodes_canny.py for a small example). For nodes that wrap a paid external API, follow the templates and shared helpers under comfy_api_nodes/util/ — and run python comfy_api/generate_api_stubs.py if you change the Pydantic schemas.
Local run
python main.pyUseful flags during development:
--quick-test-for-ci— exits immediately after init; fastest way to confirm imports work.--cpu— skips GPU code paths entirely; useful if you don't have a GPU on the dev box.--disable-all-custom-nodes— isolate behavior to core code.--front-end-version Comfy-Org/ComfyUI_frontend@latest— pull the latest daily frontend release.--verbose DEBUG— verbose logging.
Lint
ruff check .The configured rules are in pyproject.toml under [tool.ruff]. Notable selections:
T(noprintcalls — uselogging)S307andS102(noeval/exec)- The full
FPyflakes suite
E501 (line length) is ignored — long lines are common in model code where parameter blocks read better unwrapped.
Test
See Testing. The minimum is pytest tests-unit and a clean --quick-test-for-ci run.
Versioning
The version string in pyproject.toml and comfyui_version.py is bumped by the update-version.yml workflow on tag. Don't bump it by hand in PRs.
Open the PR
Push your branch to your fork and open a PR against comfyanonymous/ComfyUI:master. The PR template lives in .github/PULL_REQUEST_TEMPLATE/.
CI will run automatically. See Tooling for the workflows.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.