Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d6f688c53 | ||
|
|
d47d1a122e | ||
|
|
f27d1f140e | ||
|
|
8eba0f010d | ||
|
|
f161d6e563 | ||
|
|
a9361f60fc | ||
|
|
76e37152ad | ||
|
|
8e6f058da7 | ||
|
|
e636c60b34 |
+2
-1
@@ -1 +1,2 @@
|
||||
.idea
|
||||
.idea
|
||||
__pycache__/*
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
# [](https://github.com/failfa-st/failfast-comfyui-extensions/compare/v1.0.0...v) (2023-08-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow Reroute as dot ([9cf412f](https://github.com/failfa-st/failfast-comfyui-extensions/commit/9cf412f4d7c05eaf4f958b8e0752cb75d764425a))
|
||||
* **reroutes:** allow showing title on reroute ([27e49f8](https://github.com/failfa-st/failfast-comfyui-extensions/commit/27e49f83d5c37a529638862132a40cd837a41127))
|
||||
|
||||
|
||||
|
||||
# [](https://github.com/failfa-st/failfast-comfyui-extensions/compare/v1.0.0...v) (2023-08-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **reroutes:** al;low showing title on reroute ([27e49f8](https://github.com/failfa-st/failfast-comfyui-extensions/commit/27e49f83d5c37a529638862132a40cd837a41127))
|
||||
|
||||
|
||||
|
||||
# (2023-08-01)
|
||||
|
||||
|
||||
|
||||
@@ -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 `path/to/your/ComfyUI/custom_nodes`.
|
||||
4. Restart ComfyUI
|
||||
|
||||
The folder structure should resemble: `your-path/ComfyUI/web/extensions/failfast-comfyui-extensions`.
|
||||
The folder structure should resemble: `path/to/your/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
|
||||
```
|
||||
|
||||
@@ -139,12 +136,29 @@ The context menu offers additional options for nodes, groups, colors, and the ca
|
||||
**Nodes**
|
||||
|
||||
- Custom color option (only available in "default" Color Mode).
|
||||
- Show title on Reroute node
|
||||
- Render Reroute as dot
|
||||
|
||||
 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
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
comfy_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
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")
|
||||
print(js_src_path)
|
||||
print(js_dest_path)
|
||||
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
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
comfy_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
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)
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { $el } from "../scripts/ui.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
import { $el } from "/scripts/ui.js";
|
||||
|
||||
/**
|
||||
* Render Shadow
|
||||
@@ -32,13 +32,13 @@ app.registerExtension({
|
||||
callback: () =>
|
||||
app.graph.arrange(
|
||||
LiteGraph.CANVAS_GRID_SIZE * 4,
|
||||
LiteGraph.VERTICAL_LAYOUT,
|
||||
LiteGraph.VERTICAL_LAYOUT
|
||||
),
|
||||
},
|
||||
{
|
||||
content: "Arrange (horizontal)",
|
||||
callback: () => app.graph.arrange(LiteGraph.CANVAS_GRID_SIZE * 2),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return menuOptions;
|
||||
|
||||
+13
-16
@@ -9,8 +9,8 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { $el } from "../scripts/ui.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
import { $el } from "/scripts/ui.js";
|
||||
|
||||
function getColor(index, lengthOfItems, l = 0.5) {
|
||||
// Normalize the index value to be between 0 and 360 for full spectrum of hue
|
||||
@@ -311,9 +311,9 @@ app.registerExtension({
|
||||
node.setDirtyCanvas(true, true);
|
||||
},
|
||||
}),
|
||||
],
|
||||
]
|
||||
),
|
||||
]),
|
||||
])
|
||||
);
|
||||
if (isGroup) {
|
||||
menuRoot.append(
|
||||
@@ -351,9 +351,9 @@ app.registerExtension({
|
||||
node.setDirtyCanvas(true, true);
|
||||
},
|
||||
}),
|
||||
],
|
||||
]
|
||||
),
|
||||
]),
|
||||
])
|
||||
);
|
||||
}
|
||||
return response;
|
||||
@@ -385,7 +385,7 @@ app.registerExtension({
|
||||
value: index,
|
||||
selected: index === +value,
|
||||
});
|
||||
}),
|
||||
})
|
||||
),
|
||||
$el(
|
||||
"label",
|
||||
@@ -398,22 +398,19 @@ app.registerExtension({
|
||||
type: "checkbox",
|
||||
checked:
|
||||
window.localStorage.getItem(
|
||||
`Comfy.Settings.${colorsName}-posneg`,
|
||||
`Comfy.Settings.${colorsName}-posneg`
|
||||
) === "true",
|
||||
onchange: (event) => {
|
||||
window.localStorage.setItem(
|
||||
`Comfy.Settings.${colorsName}-posneg`,
|
||||
event.target.checked.toString(),
|
||||
event.target.checked.toString()
|
||||
);
|
||||
const value = +(
|
||||
window.localStorage.getItem(
|
||||
`Comfy.Settings.${colorsName}`,
|
||||
) ?? "0"
|
||||
);
|
||||
setColorMode(value, app);
|
||||
if (event.target.checked) {
|
||||
colorPositiveNegative(app);
|
||||
}
|
||||
},
|
||||
}),
|
||||
],
|
||||
]
|
||||
),
|
||||
]),
|
||||
]);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Connections Width
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Render all nodes as box
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Always snap to grid
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Render Shadow
|
||||
@@ -52,7 +52,7 @@ app.registerExtension({
|
||||
node.flags.pinned = true;
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return menuOptions;
|
||||
@@ -92,7 +92,7 @@ app.registerExtension({
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return menuOptions;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
|
||||
import { app } from "../scripts/app.js";
|
||||
import { $el } from "../scripts/ui.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
import { $el } from "/scripts/ui.js";
|
||||
|
||||
/**
|
||||
* Toggle links render mode
|
||||
@@ -50,7 +50,7 @@ app.registerExtension({
|
||||
value: index,
|
||||
selected: index === +value,
|
||||
});
|
||||
}),
|
||||
})
|
||||
),
|
||||
]),
|
||||
]);
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Nodes
|
||||
@@ -35,7 +35,7 @@ app.registerExtension({
|
||||
async setup(app) {
|
||||
app.graph._nodes.forEach(function (node) {
|
||||
let active = JSON.parse(
|
||||
window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false",
|
||||
window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false"
|
||||
);
|
||||
const onResize = node.onResize;
|
||||
node.onResize = function (size) {
|
||||
@@ -63,7 +63,7 @@ app.registerExtension({
|
||||
const onMouseDown = node.onMouseDown;
|
||||
node.onMouseDown = function () {
|
||||
active = JSON.parse(
|
||||
window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false",
|
||||
window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false"
|
||||
);
|
||||
return onMouseDown?.apply(this, arguments);
|
||||
};
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { $el } from "../scripts/ui.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Pin/Unpin all nodes on canvas
|
||||
@@ -41,7 +40,7 @@ app.registerExtension({
|
||||
node.flags.pinned = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return menuOptions;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
/**
|
||||
* Render Shadow
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Coded with love by Failfa.st
|
||||
* LICENSE: AGPL 3.0
|
||||
* https://github.com/failfa-st/failfast-comfyui-extensions/blob/main/LICENSE
|
||||
*
|
||||
* Visit https://github.com/failfa-st/failfast-comfyui-extensions for more info
|
||||
*
|
||||
* Homepage: https://failfa.st
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "/scripts/app.js";
|
||||
|
||||
const reroutesName = "Failfast.reroutes";
|
||||
const mini =[34,26]
|
||||
function miniReroute(node) {
|
||||
if (node.type !== "Reroute") {
|
||||
return;
|
||||
}
|
||||
node._size = node.size;
|
||||
node._title = node.title;
|
||||
Object.defineProperty(node, "title", {
|
||||
get() {
|
||||
return this._title;
|
||||
},
|
||||
set(value) {
|
||||
this._title = value;
|
||||
if (node.properties.showTitle) {
|
||||
node.outputs[0].label = value;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
if (node.properties.dot) {
|
||||
Object.defineProperty(node, "size", {
|
||||
get() {
|
||||
return this._size;
|
||||
},
|
||||
set() {
|
||||
console.log("prevented");
|
||||
},
|
||||
});
|
||||
node._size[0] = mini[0];
|
||||
node._size[1] = mini[1];
|
||||
}
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: reroutesName,
|
||||
async setup(app) {
|
||||
const onNodeAdded = app.graph.onNodeAdded;
|
||||
app.graph.onNodeAdded = function (node) {
|
||||
if (node.type !== "Reroute") {
|
||||
return onNodeAdded?.apply(this, arguments);
|
||||
}
|
||||
|
||||
miniReroute(node);
|
||||
return onNodeAdded?.apply(this, arguments);
|
||||
};
|
||||
app.graph._nodes.forEach((node) => {
|
||||
if (node.type === "Reroute") {
|
||||
miniReroute(node);
|
||||
}
|
||||
});
|
||||
const getNodeMenuOptions = LGraphCanvas.prototype.getNodeMenuOptions;
|
||||
LGraphCanvas.prototype.getNodeMenuOptions = function (node) {
|
||||
const options = getNodeMenuOptions.apply(this, arguments);
|
||||
if (node.type !== "Reroute") {
|
||||
return options;
|
||||
}
|
||||
|
||||
options.unshift({
|
||||
content: node.properties.showTitle ? "Hide Title" : "Show Title",
|
||||
callback() {
|
||||
node.outputs[0].label = node.properties.showTitle
|
||||
? undefined
|
||||
: node.title;
|
||||
node.properties.showTitle = !node.properties.showTitle;
|
||||
},
|
||||
});
|
||||
|
||||
options.push({
|
||||
content: "Render as dot",
|
||||
callback() {
|
||||
console.log(node);
|
||||
if (node.properties.dot) {
|
||||
Object.defineProperty(node, "size", {
|
||||
get() {
|
||||
return this._size;
|
||||
},
|
||||
set(value) {
|
||||
this._size = value;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
Object.defineProperty(node, "size", {
|
||||
get() {
|
||||
return this._size;
|
||||
},
|
||||
set() {
|
||||
console.log("prevented");
|
||||
},
|
||||
});
|
||||
}
|
||||
node._size[0] = node.properties.dot ? 75 : mini[0];
|
||||
node._size[1] = node.properties.dot ? 26 : mini[1];
|
||||
node.properties.dot = !node.properties.dot;
|
||||
node.setDirtyCanvas(true, true);
|
||||
},
|
||||
});
|
||||
return options;
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -9,8 +9,8 @@
|
||||
* GitHub: https://github.com/failfa-st
|
||||
* Discord: https://discord.com/invite/m3TBB9XEkb
|
||||
*/
|
||||
import { app } from "../scripts/app.js";
|
||||
import { $el } from "../scripts/ui.js";
|
||||
import { app } from "/scripts/app.js";
|
||||
import { $el } from "/scripts/ui.js";
|
||||
|
||||
/**
|
||||
* Font size of prompt fields
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
comfy_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user