comfyanonymous/ComfyUI
How to contribute
ComfyUI is an open-source GPL-3.0 project. Contributions go through GitHub pull requests against master. This section covers the practical mechanics of working in this codebase.
Where to start
- For bugs and feature requests: open an issue.
- For questions: prefer the Discord or Matrix space — see CONTRIBUTING.md.
- For frontend bugs: file in
Comfy-Org/ComfyUI_frontend, not here.
Pull requests
CONTRIBUTING.md points at the wiki page "How to Contribute Code" for the canonical PR walkthrough. Beyond what's there, this codebase has a few specific habits to keep in mind:
- Keep changes additive when possible. The codebase has heavy custom-node use; subtle changes to executor behavior, model-management heuristics, or
comfy_api/types ripple outward. - Don't reorder imports in
comfy/sd.py,nodes.py, ormain.pycasually. These files have load-order constraints (e.g., torch must not be imported beforemain.pyconfigures device env vars). - Mirror existing patterns. New model architectures follow the template of the most recent additions: a folder under
comfy/ldm/<model>/, an entry incomfy/supported_models.py, encoder code undercomfy/text_encoders/, and nodes incomfy_extras/nodes_<model>.py.
Code review expectations
CI runs ruff check, the unit test suite, an execution test, a quick launch smoke test, and a build test on every PR. See Tooling. All four must pass before merge.
The repository has a CI hook that flags AI-co-authored commits (.github/workflows/check-ai-co-authors.yml) and a line-endings check.
Definition of done
Before opening a PR:
ruff check .passes.pytest tests-unitpasses.- Manual smoke:
python main.py --quick-test-for-ciexits cleanly. - If you touched a model: run a relevant workflow and confirm output sanity.
- If you touched the executor or caching: run
pytest tests/execution(this hits a running server).
What's in this section
- Development workflow — branch, code, test, PR
- Testing — unit and integration tests
- Debugging — logs, common errors
- Patterns and conventions — how the team writes code in this repo
- Tooling — lint, CI, build, release
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.