TODO: description
- Fully Integrated: All utilities are built directly into ComfyUI. No extra tabs.
- Internationalization Framework: Built-in i18n support with English and Chinese examples
The easiest way to install this extension is through the ComfyUI Manager:
- Open ComfyUI and go to the Manager
- Search for "Prompt Legos"
- Click Install
If you want to install directly from GitHub for development purposes:
# Go to your ComfyUI custom_nodes directory
cd ComfyUI/custom_nodes
# Clone the repository
git clone https://github.com/mcmerdith/prompt-legos
# Build the React application
cd prompt-legos/ui
npm install
npm run build
# Restart ComfyUInpm run build in the ui/ directory before the extension will work. The extension requires the compiled React code in the dist/ folder to function properly in ComfyUI.
- Install ComfyUI.
- Install ComfyUI-Manager
- Look up this extension in ComfyUI-Manager. If you are installing manually, clone this repository under
ComfyUI/custom_nodes. - Restart ComfyUI.
To install the dev dependencies and pre-commit (will run the ruff hook), do:
cd my_custom_nodepack
pip install -e .[dev]
pre-commit installThe -e flag above will result in a "live" install, in the sense that any changes you make to your node extension will automatically be picked up the next time you run ComfyUI.
# Go to the UI directory
cd ui
# Install dependencies
npm install
# Start development mode (watches for changes)
npm run watchThis extension uses the official @comfyorg/comfyui-frontend-types package for type-safe interaction with ComfyUI APIs. To install it:
cd ui
npm install -D @comfyorg/comfyui-frontend-types- Set up a Registry account
- Create an API key at https://registry.comfy.org/nodes
-
Install the comfy-cli tool:
pip install comfy-cli
-
Verify your pyproject.toml has the correct metadata:
[project] name = "your_extension_name" # Use a unique name for your extension description = "Your extension description here." version = "0.1.0" # Increment this with each update [tool.comfy] PublisherId = "your_publisher_id" # Your Registry publisher ID DisplayName = "Your Extension Display Name" includes = ["dist/"] # Include built React code (normally ignored by .gitignore)
-
Publish your extension:
comfy-cli publish
-
When prompted, enter your API key
This template includes a GitHub Actions workflow that automatically publishes to the ComfyUI Registry whenever you update the version in pyproject.toml:
- Go to your repository's Settings > Secrets and variables > Actions
- Create a new repository secret called
REGISTRY_ACCESS_TOKENwith your API key - Commit and push an update to pyproject.toml (e.g., increment the version number)
- The GitHub Action will automatically run and publish your extension
The workflow configuration is set up in .github/workflows/react-build.yml and will trigger when:
- The
pyproject.tomlfile is modified and pushed to themainbranch
The workflow automatically:
- Sets up Node.js environment
- Installs dependencies (
npm install) - Builds the React extension (
npm run build) - Publishes the extension to the ComfyUI Registry
This template includes a basic setup for unit testing with Jest and React Testing Library:
# Run tests
npm test
# Run tests in watch mode during development
npm run test:watchExample tests can be found in the src/__tests__ directory. The setup includes:
- Jest for running tests
- React Testing Library for testing components
- Mock implementation of the ComfyUI window.app object
MIT