1 Commits
Author SHA1 Message Date
pixelass e636c60b34 chore: make installable 2023-08-01 05:19:40 +02:00
5 changed files with 108 additions and 16 deletions
+7 -10
View File
@@ -38,7 +38,7 @@ Two methods are available for installation:
### Clone Repository
```shell
cd your-path/ComfyUI/web/extensions
cd path/to/your/ComfyUI/custom_nodes
git clone git@github.com:failfa-st/failfast-comfyui-extensions.git
```
@@ -46,21 +46,18 @@ git clone git@github.com:failfa-st/failfast-comfyui-extensions.git
1. Download the project archive from [here](https://github.com/failfa-st/failfast-comfyui-extensions/archive/refs/heads/main.zip).
2. Extract the downloaded zip file.
3. Move the extracted files to `your-path/ComfyUI/web/extensions`.
3. Move the extracted files to `your-path/ComfyUI/custom_nodes`.
4. Restart ComfyUI
The folder structure should resemble: `your-path/ComfyUI/web/extensions/failfast-comfyui-extensions`.
The folder structure should resemble: `your-path/ComfyUI/custom_nodes/failfast-comfyui-extensions`.
<div align="center">
<img src="https://github.com/failfa-st/failfast-comfyui-extensions/assets/1148334/6d08fd63-5309-44f8-934a-e120a48c0798" alt="Folder structure example">
<p>Example of Correct Folder Structure</p>
</div>
## Update
To update the extensions, pull the latest changes from the repository:
```shell
cd your-path/ComfyUI/web/extensions/failfast-comfyui-extensions
cd path/to/your/ComfyUI/custom_nodes/failfast-comfyui-extensions
git pull
```
@@ -190,8 +187,8 @@ Each extension is fully capable of functioning individually. This allows you to
Simply download the desired file from the [`extensions`](extensions) directory and place it in the extensions folder of ComfyUI.
1. Download the required file for example, [linksRenderMode](extensions/linksRenderMode.js).
2. Transfer the file to `path/to/ComfyUI/web/extensions`.
3. The folder structure should appear as: `path/to/ComfyUI/web/extensions/linksRenderMode.js`.
2. Transfer the file to `path/to/your/ComfyUI/web/extensions`.
3. The folder structure should appear as: `path/to/your/ComfyUI/web/extensions/linksRenderMode.js`.
## Contribution
+22
View File
@@ -0,0 +1,22 @@
import os
import shutil
comfy_path = '../..'
failfast_path = os.path.abspath(os.path.dirname(__file__))
def setup_js():
try:
js_dest_path = os.path.join(comfy_path, "web", "extensions", "failfast-comfyui-extensions")
js_src_path = os.path.join(failfast_path, "extensions")
if os.path.exists(js_dest_path):
shutil.rmtree(js_dest_path)
shutil.copytree(js_src_path, js_dest_path)
except Exception as e:
print(f"An error occurred: {e}")
setup_js()
NODE_CLASS_MAPPINGS = {}
+38
View File
@@ -0,0 +1,38 @@
import os
import sys
import time
import platform
import shutil
import subprocess
comfy_path = '../..'
def rmtree(path):
retry_count = 3
while True:
try:
retry_count -= 1
if platform.system() == "Windows":
subprocess.check_call(['attrib', '-R', path + '\\*', '/S'])
shutil.rmtree(path)
return True
except Exception as ex:
print(f"ex: {ex}")
time.sleep(3)
if retry_count < 0:
raise ex
print(f"Uninstall retry({retry_count})")
js_dest_path = os.path.join(comfy_path, "web", "extensions", "failfast-comfyui-extensions")
if os.path.exists(js_dest_path):
rmtree(js_dest_path)
+3 -6
View File
@@ -405,12 +405,9 @@ app.registerExtension({
`Comfy.Settings.${colorsName}-posneg`,
event.target.checked.toString(),
);
const value = +(
window.localStorage.getItem(
`Comfy.Settings.${colorsName}`,
) ?? "0"
);
setColorMode(value, app);
if (event.target.checked) {
colorPositiveNegative(app);
}
},
}),
],
+38
View File
@@ -0,0 +1,38 @@
import os
import sys
import time
import platform
import shutil
import subprocess
comfy_path = '../..'
def rmtree(path):
retry_count = 3
while True:
try:
retry_count -= 1
if platform.system() == "Windows":
subprocess.check_call(['attrib', '-R', path + '\\*', '/S'])
shutil.rmtree(path)
return True
except Exception as ex:
print(f"ex: {ex}")
time.sleep(3)
if retry_count < 0:
raise ex
print(f"Uninstall retry({retry_count})")
js_dest_path = os.path.join(comfy_path, "web", "extensions", "failfast-comfyui-extensions")
if os.path.exists(js_dest_path):
rmtree(js_dest_path)