diff --git a/README.md b/README.md index 1616c1f..c99325c 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,10 @@ If something isn't working right, right click on the background canvas and `Togg |![off](docs/off.png)|![on](docs/on.png)| If the animation effects are too much for your graphics (esp. when the workflow is running) you can turn them off in the main settings menu. +Connected inputs are also subtly marked as such - here the model, positive, and negative inputs are connected by UI, there is no connection to the latent, and the seed has a traditional connection. You can turn this effect off in the main preferences. + +![con](docs/connection-ui.png) + ## See what is sent The nodes which only have one output can also gain a text box showing exactly what passed through the node. You need to turn this on if you want it - it's in the main settings, 'Anything Everywhere node details'. diff --git a/__init__.py b/__init__.py index cebecc4..e2cc7ed 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,6 @@ from .use_everywhere import SeedEverywhere, AnythingEverywherePrompts -UE_VERSION = "4.3.3" +UE_VERSION = "4.3.4" NODE_CLASS_MAPPINGS = { "Seed Everywhere": SeedEverywhere } diff --git a/docs/connection-ui.png b/docs/connection-ui.png new file mode 100644 index 0000000..7231ef9 Binary files /dev/null and b/docs/connection-ui.png differ diff --git a/js/use_everywhere.js b/js/use_everywhere.js index 4a73080..cb5e852 100644 --- a/js/use_everywhere.js +++ b/js/use_everywhere.js @@ -249,6 +249,12 @@ app.registerExtension({ type: "boolean", defaultValue: true, }); + app.ui.settings.addSetting({ + id: "AE.highlight", + name: "Anything Everywhere highlight connected nodes", + type: "boolean", + defaultValue: true, + }); app.ui.settings.addSetting({ id: "AE.replacesearch", name: "Anything Everywhere replace search", diff --git a/js/use_everywhere_ui.js b/js/use_everywhere_ui.js index a799512..b206fce 100644 --- a/js/use_everywhere_ui.js +++ b/js/use_everywhere_ui.js @@ -123,14 +123,47 @@ class LinkRenderController { app.graph.setDirtyCanvas(true,true); } + highlight_ue_connections(node, ctx) { + this.ue_list.all_connected_inputs(node).forEach((ue_connection) => { + if (!ue_connection.control_node) { // control node deleted... + this.mark_link_list_outdated(); + return; + } + var pos2 = node.getConnectionPos(true, ue_connection.input_index, this.slot_pos1); + pos2[0] -= node.pos[0]; + pos2[1] -= node.pos[1]; + ctx.save(); + ctx.lineWidth = 1; + var radius=6 + ctx.strokeStyle = LGraphCanvas.link_type_colors[ue_connection.type]; + ctx.beginPath(); + //ctx.roundRect(pos2[0]-radius,pos2[1]-radius,2*radius,2*radius,radius); + radius = radius - 1; + ctx.roundRect(pos2[0]-radius,pos2[1]-radius,2*radius,2*radius,radius); + ctx.stroke(); + ctx.beginPath(); + ctx.strokeStyle = "black"; + radius = radius - 1; + ctx.roundRect(pos2[0]-radius,pos2[1]-radius,2*radius,2*radius,radius); + ctx.stroke(); + ctx.restore(); + }); + } + render_ue_links(node, ctx) { - if (!this._ue_links_visible) return; // switched off + const animate = (app.ui.settings.getSettingValue('AE.animate', true)) ? 1 : 0; if (this.ue_list===undefined) { this.request_link_list_update(); // list is out of date - ask for a new one } if (this.ue_list_reloading) return; // if we don't have one, return. This method gets called frequently! + if (app.ui.settings.getSettingValue('AE.highlight', true)) { + this.highlight_ue_connections(node, ctx) + } + + if (!this._ue_links_visible) return; // switched off + this.ue_list.all_connected_inputs(node).forEach((ue_connection) => { if (!ue_connection.control_node) { // control node deleted... this.mark_link_list_outdated();