Skip to content

Commit 5ae64f4

Browse files
authored
6.1
6.1
2 parents 5e7a8cd + ca99caa commit 5ae64f4

File tree

9 files changed

+160
-183
lines changed

9 files changed

+160
-183
lines changed

README.md

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -75,57 +75,13 @@ UE nodes mostly work with group nodes. But there are a couple of important thing
7575

7676
## Latest updates
7777

78+
6.1 (May 2025)
79+
- Mostly some bug-fixes (#216, #217, #300)
80+
- New option to show UE links differently without animation for better performance
81+
7882
6.0 (April 2025)
7983
- Very major rebuild to deal with latest version of Comfy
8084

81-
5.0 (6th August 2024)
82-
- Significant change to core logic. Should greatly reduce incompatibility issues, but may have unexpoected consequences!
83-
- Added to right-click menu on nodes the option to make a node reject all UE connections.
84-
85-
4.9 (2nd May 2024)
86-
- Fix incompatibility with Efficiency Nodes (#182)
87-
88-
4.8 (18th March 2024)
89-
- Group and color sending have a `send to unmatched` mode
90-
- UE link animations can be the classic dots, or a pulsing glow (or both, or neither)
91-
- Show UE links can now be on, off, mouseover, selected nodes, or mouseover and selected nodes
92-
93-
4.7 (1st March 2024)
94-
- UE now works in group nodes
95-
- Autocomplete on `Anything Everywhere?` nodes
96-
97-
4.6
98-
- add Group Regex to `Anything Everywhere?` node
99-
- if you have workflow json files saved that now don't work, try 'workflow_fixer.py'
100-
101-
4.5
102-
- add support for Comfy UI Group Nodes (UE nodes can be used to connect to group node inputs and outputs, but not within a group node)
103-
- add `convert to real links`
104-
105-
4.4
106-
- add (limited) support for converting regex in the `Anything Everywhere?` node with inputs (only works if the link is from a node that is a simple string source)
107-
108-
4.3
109-
- added support for targetting [Highway nodes](https://github.com/chrisgoringe/cg-use-everywhere#highway-nodes)
110-
111-
4.2
112-
- improved performance of loop detection, especially with [highway nodes](https://github.com/Trung0246/ComfyUI-0246)
113-
- updated docs to not use other custom nodes in examples
114-
115-
4.1.2
116-
- tweaks to improve handling of bypass
117-
- fixed connecting to Seed Everywhere
118-
119-
4.1.1
120-
- added option to turn animation off
121-
122-
4.1
123-
124-
- added [loop detection](https://github.com/chrisgoringe/cg-use-everywhere#loop-checking)
125-
- added [group restriction](https://github.com/chrisgoringe/cg-use-everywhere#group-restriction).
126-
127-
The v1 nodes have been fully removed. If you were using one, you can just replace it with an `Anything Everywhere` node.
128-
12985
## Installing
13086

13187
Use Comfy Manager. If you really want to do it manually, just clone this repository in your custom_nodes directory.

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .use_everywhere import SeedEverywhere, AnythingEverywherePrompts
22

3-
UE_VERSION = "6.0.4"
3+
UE_VERSION = "6.1"
44

55
NODE_CLASS_MAPPINGS = { "Seed Everywhere": SeedEverywhere }
66

js/use_everywhere.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { app } from "../../scripts/app.js";
22
import { api } from "../../scripts/api.js";
33

44
import { is_UEnode, is_helper, inject, Logger, get_real_node, defineProperty, graphConverter } from "./use_everywhere_utilities.js";
5-
import { displayMessage, update_input_label, indicate_restriction } from "./use_everywhere_ui.js";
5+
import { update_input_label, indicate_restriction } from "./use_everywhere_ui.js";
66
import { LinkRenderController } from "./use_everywhere_ui.js";
77
import { GraphAnalyser } from "./use_everywhere_graph_analysis.js";
88
import { node_menu_settings, canvas_menu_settings, non_ue_menu_settings, SETTINGS } from "./use_everywhere_settings.js";
@@ -127,8 +127,7 @@ app.registerExtension({
127127

128128
node.IS_UE = is_UEnode(node);
129129
if (node.IS_UE) {
130-
node.input_type = [undefined, undefined, undefined]; // for dynamic input types
131-
node.displayMessage = displayMessage; // receive messages from the python code
130+
node.input_type = [undefined, undefined, undefined]; // for dynamic input types
132131

133132
// If a widget on a UE node is edited, link list is dirty
134133
inject_outdating_into_objects(node.widgets,'callback',`widget callback on ${node.id}`);
@@ -161,17 +160,6 @@ app.registerExtension({
161160
},
162161

163162
async setup() {
164-
/*
165-
Listen for message-handler event from python code
166-
*/
167-
function messageHandler(event) {
168-
const id = event.detail.id;
169-
const message = event.detail.message;
170-
const node = get_real_node(id);
171-
if (node && node.displayMessage) node.displayMessage(id, message);
172-
else (console.log(`node ${id} couldn't handle a message`));
173-
}
174-
api.addEventListener("ue-message-handler", messageHandler);
175163

176164
api.addEventListener("status", ({detail}) => {
177165
if (linkRenderController) linkRenderController.note_queue_size(detail ? detail.exec_info.queue_remaining : 0)
@@ -185,7 +173,7 @@ app.registerExtension({
185173
graphConverter.store_node_input_map(data);
186174
} catch (e) { Logger.log_error(Logger.ERROR, `in loadGraphData ${e}`); }
187175
const cvw_was = settingsCache.getSettingValue("Comfy.Validation.Workflows")
188-
if (settingsCache.getSettingValue("AE.block_graph_validation")) {
176+
if (settingsCache.getSettingValue("Use Everywhere.Options.block_graph_validation")) {
189177
app.ui.settings.setSettingValue("Comfy.Validation.Workflows", false);
190178
}
191179
original_loadGraphData.apply(this, arguments);
@@ -241,12 +229,6 @@ app.registerExtension({
241229
Logger.log_error(Logger.ERROR, e)
242230
}
243231
}
244-
245-
/*
246-
Add to the main settings
247-
now specified as a parameter of register
248-
*/
249-
//main_menu_settings();
250232

251233
/*
252234
Canvas menu is the right click on backdrop.
@@ -271,10 +253,13 @@ app.registerExtension({
271253
TODO: Ought to delete this._widgetNameMap when widgets are added or removed.
272254
*/
273255
LGraphNode.prototype._getWidgetByName = function(nm) {
274-
if (this._widgetNameMap === undefined) {
256+
if (this._widgetNameMap === undefined || !this._widgetNameMap[nm]) {
275257
this._widgetNameMap = {}
276258
this.widgets?.forEach((w)=>{this._widgetNameMap[w.name] = w})
277259
}
260+
if (!this._widgetNameMap[nm]) {
261+
let breakpoint_be_here; // someone is asking for a widget that doesn't exist
262+
}
278263
return this._widgetNameMap[nm]
279264
}
280265

@@ -314,6 +299,23 @@ app.registerExtension({
314299

315300
if (false) add_debug();
316301

302+
const export_api_label = Array.from(document.getElementsByClassName('p-menubar-item-label')).find((e)=>e.innerText=='Export (API)')
303+
if (export_api_label) {
304+
export_api_label.addEventListener('click', (e)=>{
305+
//const ues = GraphAnalyser.instance().analyse_graph(true);
306+
const ue_links = app.graph.extra['ue_links'];
307+
if (ue_links.length>0) {
308+
if (!confirm("This model contains links added by Use Everywhere which won't work with the API. " +
309+
"You probably want to use 'Convert all UEs to real links' on the canvas right click menu before saving.\n\n" +
310+
"Save anyway?"))
311+
{
312+
e.stopImmediatePropagation()
313+
e.stopPropagation()
314+
e.preventDefault()
315+
}
316+
}
317+
})
318+
}
317319
},
318320

319321
beforeConfigureGraph() {

js/use_everywhere_graph_analysis.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class GraphAnalyser extends Pausable {
4949
}
5050
this.ambiguity_messages = [];
5151
var p = { workflow:app.graph.serialize() };
52-
const live_nodes = p.workflow.nodes.filter((node) => node_is_live(node))
52+
const treat_bypassed_as_live = settingsCache.getSettingValue("Use Everywhere.Options.connect_to_bypassed")
53+
const live_nodes = p.workflow.nodes.filter((node) => node_is_live(node, treat_bypassed_as_live))
5354

5455
// Create a UseEverywhereList and populate it from all live (not bypassed) UE nodes
5556
const ues = new UseEverywhereList();
@@ -74,7 +75,7 @@ class GraphAnalyser extends Pausable {
7475
const o2n = isGrp ? Object.entries(gpData.oldToNewInputMap) : null;
7576
//if (!real_node._widget_name_map) real_node._widget_name_map = real_node.widgets?.map(w => w.name) || [];
7677
real_node.inputs?.forEach((input,index) => {
77-
if (is_connected(input)) return;
78+
if (is_connected(input, treat_bypassed_as_live)) return;
7879
if (real_node.reject_ue_connection && real_node.reject_ue_connection(input)) return;
7980
if (real_node._getWidgetByName(input.name) && !(real_node.properties['widget_ue_connectable'] && real_node.properties['widget_ue_connectable'][input.name])) return;
8081
connectable.push({node, input, index, isGrp, real_node, o2n});
@@ -124,7 +125,7 @@ class GraphAnalyser extends Pausable {
124125
if (this.ambiguity_messages.length) Logger.log(Logger.PROBLEM, "Ambiguous connections", this.ambiguity_messages, Logger.CAT_AMBIGUITY);
125126

126127
// if there are loops report them and raise an exception
127-
if (about_to_submit && settingsCache.getSettingValue('AE.checkloops')) {
128+
if (about_to_submit && settingsCache.getSettingValue('Use Everywhere.Options.checkloops')) {
128129
try {
129130
node_in_loop(live_nodes, links_added);
130131
} catch (e) {

js/use_everywhere_settings.js

Lines changed: 57 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,75 @@ import { settingsCache } from "./use_everywhere_cache.js";
77

88
export const SETTINGS = [
99
{
10-
id: "AE.details",
11-
name: "Anything Everywhere show node details",
12-
type: "boolean",
13-
defaultValue: false,
14-
onChange: settingsCache.onSettingChange,
15-
},
16-
{
17-
id: "AE.checkloops",
18-
name: "Anything Everywhere check loops",
19-
type: "boolean",
20-
defaultValue: true,
21-
onChange: settingsCache.onSettingChange,
22-
},
10+
id: "Use Everywhere.About",
11+
name: "Version 6.1",
12+
type: () => {return document.createElement('span')},
13+
},
2314
{
24-
id: "AE.showlinks",
25-
name: "Anything Everywhere show links",
15+
id: "Use Everywhere.Graphics.showlinks",
16+
name: "Show links",
2617
type: "combo",
2718
options: [ {value:0, text:"All off"}, {value:1, text:"Selected nodes"}, {value:2, text:"Mouseover node"}, {value:3, text:"Selected and mouseover nodes"}, {value:4, text:"All on"}],
28-
defaultValue: 0,
19+
defaultValue: 3,
2920
onChange: settingsCache.onSettingChangeChange,
3021
},
3122
{
32-
id: "AE.animate",
33-
name: "Anything Everywhere animate UE links",
23+
id: "Use Everywhere.Graphics.fuzzlinks",
24+
name: "Statically distinguish UE links",
25+
type: "boolean",
26+
tooltip: "Render UE links, when shown, differently from normal links. Much lower performance cost than animation.",
27+
defaultValue: true,
28+
onChange: settingsCache.onSettingChangeChange,
29+
},
30+
{
31+
id: "Use Everywhere.Graphics.animate",
32+
name: "Animate UE links",
3433
type: "combo",
3534
options: [ {value:0, text:"Off"}, {value:1, text:"Dots"}, {value:2, text:"Pulse"}, {value:3, text:"Both"}, ],
36-
defaultValue: 3,
35+
defaultValue: 0,
3736
onChange: settingsCache.onSettingChangeChange,
37+
tooltip: "Animating links may have a negative impact on UI performance. Consider using Statically distinguish UE links instead."
3838
},
3939
{
40-
id: "AE.stop_animation_when_running",
41-
name: "Anything Everywhere turn animation off when running",
40+
id: "Use Everywhere.Graphics.stop_animation_when_running",
41+
name: "Turn animation off when workflow is running",
4242
type: "boolean",
4343
defaultValue: true,
4444
onChange: settingsCache.onSettingChangeChange,
4545
},
4646
{
47-
id: "AE.highlight",
48-
name: "Anything Everywhere highlight connected nodes",
47+
id: "Use Everywhere.Graphics.highlight",
48+
name: "Highlight connected and connectable inputs",
4949
type: "boolean",
5050
defaultValue: true,
5151
onChange: settingsCache.onSettingChangeChange,
5252
},
5353
{
54-
id: "AE.logging",
55-
name: "Anything Everywhere logging",
54+
id: "Use Everywhere.Options.connect_to_bypassed",
55+
name: "Connect to bypassed nodes",
56+
type: "boolean",
57+
defaultValue: false,
58+
onChange: settingsCache.onSettingChange,
59+
tooltip: "By default UE links are made to the node downstream of bypassed nodes."
60+
},
61+
{
62+
id: "Use Everywhere.Options.checkloops",
63+
name: "Check for loops before submitting",
64+
type: "boolean",
65+
defaultValue: true,
66+
onChange: settingsCache.onSettingChange,
67+
tooltip: "Check to see if UE links have created a loop that wasn't there before"
68+
},
69+
{
70+
id: "Use Everywhere.Options.logging",
71+
name: "Logging",
5672
type: "combo",
5773
options: [ {value:0, text:"Errors Only"}, {value:1, text:"Problems"}, {value:2, text:"Information"}, {value:3, text:"Detail"}, ],
5874
defaultValue: 1,
5975
onChange: settingsCache.onSettingChange,
6076
},
6177
{
62-
id: "AE.block_graph_validation",
78+
id: "Use Everywhere.Options.block_graph_validation",
6379
name: "Block workflow validation",
6480
type: "boolean",
6581
defaultValue: true,
@@ -128,10 +144,19 @@ function highlight_selected(submenu_root, node, names) {
128144

129145
function widget_ue_submenu(value, options, e, menu, node) {
130146
if (!(node.properties['widget_ue_connectable'])) node.properties['widget_ue_connectable'] = {};
131-
const names = []
147+
132148
const linkedWidgets = new Set()
133-
node.widgets.forEach((widget) => { widget.linkedWidgets?.forEach((lw)=>{linkedWidgets.add(lw)}) });
134-
node.widgets.filter(w => !linkedWidgets.has(w)).filter(w => !w.hidden).forEach((widget) => { names.push(widget.name) });
149+
node.widgets
150+
.filter(w => w.linkedWidgets)
151+
.forEach((widget) => { widget.linkedWidgets.forEach((lw)=>{linkedWidgets.add(lw)}) });
152+
153+
const names = []
154+
node.widgets
155+
.filter(w => !linkedWidgets.has(w))
156+
.filter(w => !w.hidden)
157+
.filter(w => !w.name?.includes('$$'))
158+
.forEach((widget) => { names.push(widget.name) });
159+
135160
const submenu = new LiteGraph.ContextMenu(
136161
names,
137162
{ event: e, callback: function (v) {
@@ -201,10 +226,10 @@ export function node_menu_settings(options, node) {
201226
export function canvas_menu_settings(options) {
202227
options.push(null); // divider
203228
options.push({
204-
content: (app.ui.settings.getSettingValue('AE.showlinks')>0) ? "Hide UE links" : "Show UE links",
229+
content: (app.ui.settings.getSettingValue('Use Everywhere.Graphics.showlinks')>0) ? "Hide UE links" : "Show UE links",
205230
callback: () => {
206-
const setTo = (app.ui.settings.getSettingValue('AE.showlinks')>0) ? 0 : 4;
207-
app.ui.settings.setSettingValue('AE.showlinks', setTo);
231+
const setTo = (app.ui.settings.getSettingValue('Use Everywhere.Graphics.showlinks')>0) ? 0 : 4;
232+
app.ui.settings.setSettingValue('Use Everywhere.Graphics.showlinks', setTo);
208233
app.graph.change();
209234
}
210235
},

0 commit comments

Comments
 (0)