diff --git a/README.md b/README.md index 05ce6a7e..e0acabf5 100644 --- a/README.md +++ b/README.md @@ -133,14 +133,29 @@ This repository provides Colab notebooks that allow you to install and use Comfy * `All`: Show a dialog where the user can select a title for sharing. +## Paths +In `ComfyUI-Manager` V3.0 and later, configuration files and dynamically generated files are located under `/default/ComfyUI-Manager/`. + +* + * If executed without any options, the path defaults to ComfyUI/user. + * It can be set using --user-directory . + +* Basic config files: `/default/ComfyUI-Manager/config.ini` +* Configurable channel lists: `/default/ComfyUI-Manager/channels.ini` +* Configurable pip overrides: `/default/ComfyUI-Manager/pip_overrides.json` +* Saved snapshot files: `/default/ComfyUI-Manager/snapshots` +* Startup script files: `/default/ComfyUI-Manager/startup-scripts` +* Component files: `/default/ComfyUI-Manager/components` + + ## Snapshot-Manager * When you press `Save snapshot` or use `Update All` on `Manager Menu`, the current installation status snapshot is saved. - * Snapshot file dir: `ComfyUI-Manager/snapshots` + * Snapshot file dir: `/default/ComfyUI-Manager/snapshots` * You can rename snapshot file. * Press the "Restore" button to revert to the installation status of the respective snapshot. * However, for custom nodes not managed by Git, snapshot support is incomplete. * When you press `Restore`, it will take effect on the next ComfyUI startup. - * The selected snapshot file is saved in `ComfyUI-Manager/startup-scripts/restore-snapshot.json`, and upon restarting ComfyUI, the snapshot is applied and then deleted. + * The selected snapshot file is saved in `/default/ComfyUI-Manager/startup-scripts/restore-snapshot.json`, and upon restarting ComfyUI, the snapshot is applied and then deleted. ![model-install-dialog](https://raw.githubusercontent.com/ltdrdata/ComfyUI-extension-tutorials/Main/ComfyUI-Manager/images/snapshot.jpg) @@ -188,12 +203,12 @@ This repository provides Colab notebooks that allow you to install and use Comfy } ``` * `` Ensure that the timestamp is always unique. - * "components" should have the same structure as the content of the file stored in ComfyUI-Manager/components. + * "components" should have the same structure as the content of the file stored in `/default/ComfyUI-Manager/components`. * ``: The name should be in the format `::`. * ``: In the nodedata of the group node. * ``: Only two formats are allowed: `major.minor.patch` or `major.minor`. (e.g. `1.0`, `2.2.1`) * ``: Saved time - * ``: If the packname is not empty, the category becomes packname/workflow, and it is saved in the .pack file in ComfyUI-Manager/components. + * ``: If the packname is not empty, the category becomes packname/workflow, and it is saved in the .pack file in `/default/ComfyUI-Manager/components`. * ``: If there is neither a category nor a packname, it is saved in the components category. ``` "version":"1.0", @@ -268,12 +283,8 @@ When you run the `scan.sh` script: ## Troubleshooting -* If your `git.exe` is installed in a specific location other than system git, please install ComfyUI-Manager and run ComfyUI. Then, specify the path including the file name in `git_exe = ` in the ComfyUI-Manager/config.ini file that is generated. +* If your `git.exe` is installed in a specific location other than system git, please install ComfyUI-Manager and run ComfyUI. Then, specify the path including the file name in `git_exe = ` in the `/default/ComfyUI-Manager/config.ini` file that is generated. * If updating ComfyUI-Manager itself fails, please go to the **ComfyUI-Manager** directory and execute the command `git update-ref refs/remotes/origin/main a361cc1 && git fetch --all && git pull`. - * Alternatively, download the update-fix.py script from [update-fix.py](https://github.com/ltdrdata/ComfyUI-Manager/raw/main/scripts/update-fix.py) and place it in the ComfyUI-Manager directory. Then, run it using your Python command. - For the portable version, use `..\..\..\python_embeded\python.exe update-fix.py`. -* For cases where nodes like `PreviewTextNode` from `ComfyUI_Custom_Nodes_AlekPet` are only supported as front-end nodes, we currently do not provide missing nodes for them. -* Currently, `vid2vid` is not being updated, causing compatibility issues. * If you encounter the error message `Overlapped Object has pending operation at deallocation on Comfyui Manager load` under Windows * Edit `config.ini` file: add `windows_selector_event_loop_policy = True` * if `SSL: CERTIFICATE_VERIFY_FAILED` error is occured. diff --git a/glob/manager_core.py b/glob/manager_core.py index 3fc1bca6..05cc7357 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -36,7 +36,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 3, 2] +version_code = [3, 3, 3] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') @@ -150,6 +150,7 @@ manager_channel_list_path = None manager_startup_script_path = None manager_snapshot_path = None manager_pip_overrides_path = None +manager_components_path = None def update_user_directory(user_dir): global manager_files_path @@ -158,6 +159,7 @@ def update_user_directory(user_dir): global manager_startup_script_path global manager_snapshot_path global manager_pip_overrides_path + global manager_components_path manager_files_path = os.path.abspath(os.path.join(user_dir, 'default', 'ComfyUI-Manager')) if not os.path.exists(manager_files_path): @@ -174,6 +176,7 @@ def update_user_directory(user_dir): manager_config_path = os.path.join(manager_files_path, 'config.ini') manager_channel_list_path = os.path.join(manager_files_path, 'channels.list') manager_pip_overrides_path = os.path.join(manager_files_path, "pip_overrides.json") + manager_components_path = os.path.join(manager_files_path, "components") try: import folder_paths diff --git a/glob/manager_server.py b/glob/manager_server.py index f70246b8..c7534884 100644 --- a/glob/manager_server.py +++ b/glob/manager_server.py @@ -135,7 +135,6 @@ local_db_model = os.path.join(manager_util.comfyui_manager_path, "model-list.jso local_db_alter = os.path.join(manager_util.comfyui_manager_path, "alter-list.json") local_db_custom_node_list = os.path.join(manager_util.comfyui_manager_path, "custom-node-list.json") local_db_extension_node_mappings = os.path.join(manager_util.comfyui_manager_path, "extension-node-map.json") -components_path = os.path.join(manager_util.comfyui_manager_path, 'components') def set_preview_method(method): @@ -1314,15 +1313,15 @@ async def save_component(request): name = data['name'] workflow = data['workflow'] - if not os.path.exists(components_path): - os.mkdir(components_path) + if not os.path.exists(core.manager_components_path): + os.mkdir(core.manager_components_path) if 'packname' in workflow and workflow['packname'] != '': sanitized_name = manager_util.sanitize_filename(workflow['packname']) + '.pack' else: sanitized_name = manager_util.sanitize_filename(name) + '.json' - filepath = os.path.join(components_path, sanitized_name) + filepath = os.path.join(core.manager_components_path, sanitized_name) components = {} if os.path.exists(filepath): with open(filepath) as f: @@ -1340,12 +1339,12 @@ async def save_component(request): @routes.post("/manager/component/loads") async def load_components(request): try: - json_files = [f for f in os.listdir(components_path) if f.endswith('.json')] - pack_files = [f for f in os.listdir(components_path) if f.endswith('.pack')] + json_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.json')] + pack_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.pack')] components = {} for json_file in json_files + pack_files: - file_path = os.path.join(components_path, json_file) + file_path = os.path.join(core.manager_components_path, json_file) with open(file_path, 'r') as file: try: # When there is a conflict between the .pack and the .json, the pack takes precedence and overrides. diff --git a/prestartup_script.py b/prestartup_script.py index 576aadcb..81753c3f 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -318,6 +318,7 @@ except Exception as e: try: import git # noqa: F401 + import toml # noqa: F401 except ModuleNotFoundError: my_path = os.path.dirname(__file__) requirements_path = os.path.join(my_path, "requirements.txt") diff --git a/pyproject.toml b/pyproject.toml index a97e9e31..64a37502 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-manager" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." -version = "3.3.2" +version = "3.3.3" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"] diff --git a/scripts/install-manager-for-portable-version.bat b/scripts/install-manager-for-portable-version.bat index 7b067dfd..ad4e97b5 100644 --- a/scripts/install-manager-for-portable-version.bat +++ b/scripts/install-manager-for-portable-version.bat @@ -1,2 +1,2 @@ .\python_embeded\python.exe -s -m pip install gitpython -.\python_embeded\python.exe -c "import git; git.Repo.clone_from('https://github.com/ltdrdata/ComfyUI-Manager', './ComfyUI/custom_nodes/ComfyUI-Manager')" +.\python_embeded\python.exe -c "import git; git.Repo.clone_from('https://github.com/ltdrdata/ComfyUI-Manager', './ComfyUI/custom_nodes/comfyui-manager')" diff --git a/scripts/update-fix.py b/scripts/update-fix.py deleted file mode 100644 index d2ac1007..00000000 --- a/scripts/update-fix.py +++ /dev/null @@ -1,12 +0,0 @@ -import git - -commit_hash = "a361cc1" - -repo = git.Repo('.') - -if repo.is_dirty(): - repo.git.stash() - -repo.git.update_ref("refs/remotes/origin/main", commit_hash) -repo.remotes.origin.fetch() -repo.git.pull("origin", "main")