This guide provides an overview of how to develop in this repository.
-
Clone the repo, create and activate a conda env. Minimum Python version is 3.9.
-
Install the package to local
pip install -e .
- Set ENVIRONMENT variable to DEV.
export ENVIRONMENT=dev
- Test script running
comfy --help
- Use pre commit hook
pre-commit install
There is a potential need for you to reinstall the package. You can do this by
either run pip install -e .
again (which will reinstall), or manually
uninstall pip uninstall comfy-cli
and reinstall, or even cleaning your conda
env and reinstalling the package (pip install -e .
)
- Register it under
comfy_cli/cmdline.py
If it's contains subcommand, create folder under comfy_cli/command/[new_command] and add the following boilerplate
comfy_cli/command/[new_command]/__init__.py
from .command import app
comfy_cli/command/[new_command]command.py
import typer
app = typer.Typer()
@app.command()
def option_a(name: str):
"""Add a new custom node"""
print(f"Adding a new custom node: {name}")
@app.command()
def remove(name: str):
"""Remove a custom node"""
print(f"Removing a custom node: {name}")
- Use
typer
for all command args management - Use
rich
for all console output- For progress reporting, use either
rich.progress
- For progress reporting, use either
If you have any questions or need further assistance, please contact the project maintainer at ???.
Happy coding!