Download ComfyLiterals/startup_utils.py from MarkLilly/mis-custom-nodes: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/MarkLilly/mis-custom-nodes/resolve/main/ComfyLiterals/startup_utils.py
- Command line
-
hf download hf://MarkLilly/mis-custom-nodes/ComfyLiterals/startup_utils.py
-
curl -L -o startup_utils.py https://huggingface.co/MarkLilly/mis-custom-nodes/resolve/main/ComfyLiterals/startup_utils.py
1.16 kB
| import os | |
| from pathlib import Path | |
| import folder_paths | |
| def symlink_web_dir(local_path, extension_name): | |
| comfy_web_ext_root = Path(os.path.join(folder_paths.base_path, "web", "extensions")) | |
| target_dir = Path(os.path.join(comfy_web_ext_root, extension_name)) | |
| extension_path = Path(__file__).parent.resolve() | |
| if target_dir.exists(): | |
| print(f"Web extensions folder found at {target_dir}") | |
| elif comfy_web_ext_root.exists(): | |
| try: | |
| os.symlink((os.path.join(extension_path, local_path)), target_dir) | |
| except OSError as e: # OSError | |
| print( | |
| f"Error:\n{e}\n" | |
| f"Failed to create symlink to {target_dir}. Please copy the folder manually.\n" | |
| f"Source: {os.path.join(extension_path, local_path)}\n" | |
| f"Target: {target_dir}" | |
| ) | |
| except Exception as e: | |
| print(f"Unexpected error:\n{e}") | |
| else: | |
| print( | |
| f"Failed to find comfy root automatically, please copy the folder {os.path.join(extension_path, 'web')} manually in the web/extensions folder of ComfyUI" | |
| ) | |