Skip to content

Commit

Permalink
double click feature is fixed
Browse files Browse the repository at this point in the history
MODIFIED: separate into copy-full and copy-all
FIXED: improper size copying

#1118
  • Loading branch information
ltdrdata committed Oct 7, 2024
1 parent 0469cad commit e9eaff7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion glob/manager_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import cm_global
from manager_util import *

version = [2, 51, 4]
version = [2, 51, 5]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')


Expand Down
1 change: 1 addition & 0 deletions js/comfyui-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ class ManagerMenuDialog extends ComfyDialog {
dbl_click_policy_combo.className = "cm-menu-combo";
dbl_click_policy_combo.appendChild($el('option', { value: 'none', text: 'Double-Click: None' }, []));
dbl_click_policy_combo.appendChild($el('option', { value: 'copy-all', text: 'Double-Click: Copy All Connections' }, []));
dbl_click_policy_combo.appendChild($el('option', { value: 'copy-full', text: 'Double-Click: Copy All Connections and shapes' }, []));
dbl_click_policy_combo.appendChild($el('option', { value: 'copy-input', text: 'Double-Click: Copy Input Connections' }, []));
dbl_click_policy_combo.appendChild($el('option', { value: 'possible-input', text: 'Double-Click: Possible Input Connections' }, []));
dbl_click_policy_combo.appendChild($el('option', { value: 'dual', text: 'Double-Click: Possible(left) + Copy(right)' }, []));
Expand Down
17 changes: 12 additions & 5 deletions js/node_fixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function connect_inputs(nearest_inputs, node) {
}
}

function node_info_copy(src, dest, connect_both) {
function node_info_copy(src, dest, connect_both, copy_shape) {
// copy input connections
for(let i in src.inputs) {
let input = src.inputs[i];
Expand Down Expand Up @@ -142,9 +142,11 @@ function node_info_copy(src, dest, connect_both) {
}
}

dest.color = src.color;
dest.bgcolor = src.bgcolor;
dest.size = src.size;
if(copy_shape) {
dest.color = src.color;
dest.bgcolor = src.bgcolor;
dest.size = max(src.size, dest.size);
}

app.graph.afterChange();
}
Expand All @@ -162,14 +164,19 @@ app.registerExtension({

switch(double_click_policy) {
case "copy-all":
case "copy-full":
case "copy-input":
{
if(node.inputs?.some(x => x.link != null) || node.outputs?.some(x => x.links != null && x.links.length > 0) )
return;

let src_node = lookup_nearest_nodes(node);
if(src_node)
node_info_copy(src_node, node, double_click_policy == "copy-all");
{
let both_connection = double_click_policy != "copy-input";
let copy_shape = double_click_policy == "copy-full";
node_info_copy(src_node, node, both_connection, copy_shape);
}
}
break;
case "possible-input":
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-manager"
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
version = "2.51.4"
version = "2.51.5"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]

Expand Down

0 comments on commit e9eaff7

Please sign in to comment.