From fe6411eec25998d53ff21d4c63a389ce338e3e29 Mon Sep 17 00:00:00 2001 From: Adi Eyal Date: Wed, 2 Aug 2023 00:42:54 +0200 Subject: [PATCH] Added install script from ComfyUI-Manager copies dp.js to the extension folder --- README.md | 12 ++++++++++-- __init__.py | 2 +- install.py | 13 +++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 install.py diff --git a/README.md b/README.md index 02e416b..30ac468 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,14 @@ Nodes can be found in the Dynamic Prompts menu: ## Installation +### Using ComfyUI-Manager +1. Install [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager) if it isn't already. +2. Press Install Custom Nodes from the ComfyUI-Manager menu +3. Search for dynamicprompts +4. Click install + +### Manual installation + Follow the steps below to install the ComfyUI-DynamicPrompts Library: 1. Clone the repository: @@ -32,9 +40,9 @@ Follow the steps below to install the ComfyUI-DynamicPrompts Library: ``` python -m pip install -r ComfyUI/custom_nodes/requirements.txt ``` -3. Copy the dp.js file to the ComfyUI web extensions directory: +3. Run install.py: ``` - cp ComfyUI/custom_nodes/comfyui-dynamicprompts/web-extensions/dp.js ComfyUI/web/extensions + python ComfyUI/custom_nodes/comfyui-dynamicprompts/install.py ``` 4. `mkdir ComfyUI/wildcards` 5. (Optional) download a wildcard collection and copy it into this new wildcards folder. diff --git a/__init__.py b/__init__.py index 316b5e8..8b71b93 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,5 @@ from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS -__version__ = "0.1.1" +__version__ = "0.1.2" __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] diff --git a/install.py b/install.py new file mode 100644 index 0000000..50cfa27 --- /dev/null +++ b/install.py @@ -0,0 +1,13 @@ +import shutil +from pathlib import Path + +comfy_path = Path(__file__).parent.parent.parent +extension_path = Path(__file__).parent +js_path = comfy_path / "web" / "extensions" + + +def copy_web_extensions(): + shutil.copy(extension_path / "web-extensions/dp.js", str(js_path)) + + +copy_web_extensions()