Merge branch 'master' of https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet into new_init_config_disabled

This commit is contained in:
AlekPet
2025-08-28 22:17:47 +03:00
4 changed files with 28 additions and 22 deletions
+7 -7
View File
@@ -113,13 +113,13 @@ result = runCode()"""
outputs = {}
for node in extra_pnginfo['workflow']['nodes']:
if node['id'] == int(unique_id):
outputs_valid = [ouput for ouput in node.get('outputs', []) if ouput.get('name','') != '' and ouput.get('type','') != '']
outputs = {ouput['name']: None for ouput in outputs_valid}
self.RETURN_TYPES = ByPassTypeTuple(out["type"] for out in outputs_valid)
self.RETURN_NAMES = tuple(name for name in outputs.keys())
if extra_pnginfo and 'workflow' in extra_pnginfo and extra_pnginfo['workflow']:
for node in extra_pnginfo['workflow']['nodes']:
if node['id'] == int(unique_id):
outputs_valid = [ouput for ouput in node.get('outputs', []) if ouput.get('name','') != '' and ouput.get('type','') != '']
outputs = {ouput['name']: None for ouput in outputs_valid}
self.RETURN_TYPES = ByPassTypeTuple(out["type"] for out in outputs_valid)
self.RETURN_NAMES = tuple(name for name in outputs.keys())
my_namespace = types.SimpleNamespace()
my_namespace.__dict__.update(outputs)
+11 -8
View File
@@ -435,15 +435,18 @@ class OpenPose {
if (await comfyuiDesktopConfirm("Reset canvas size?")) {
this.setCanvasSize(512, 512);
const backgroundImg = this.canvas.backgroundImage;
this.canvas.clear();
this.canvas.backgroundColor = "#000000";
this.addPose();
this.setBackground(backgroundImg);
this.uploadPoseFile(this.node.name);
}
const backgroundImg = this.canvas.backgroundImage;
this.canvas.clear();
this.canvas.backgroundColor = "#000000";
if (await comfyuiDesktopConfirm("Add default pose?")) {
this.addPose();
}
this.setBackground(backgroundImg);
this.uploadPoseFile(this.node.name);
}
}
+9 -6
View File
@@ -34,15 +34,18 @@ class PoseNode(object):
i = Image.open(image_path)
i = ImageOps.exif_transpose(i)
image = i.convert("RGBA")
if i.mode == 'RGBA':
mask = np.array(i.getchannel("A")).astype(np.float32) / 255.0
mask = 1.0 - torch.from_numpy(mask)
image = i.convert("RGB")
else:
mask = torch.zeros((i.height, i.width), dtype=torch.float32, device="cpu")
image = i.convert("RGB")
image = np.array(image).astype(np.float32) / 255.0
image = torch.from_numpy(image)[None,]
if "A" in i.getbands():
mask = np.array(i.getchannel("A")).astype(np.float32) / 255.0
mask = 1.0 - torch.from_numpy(mask)
else:
mask = torch.zeros((64, 64), dtype=torch.float32, device="cpu")
return (image, mask.unsqueeze(0))
@classmethod
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui_custom_nodes_alekpet"
description = "Nodes: PoseNode, PainterNode, TranslateTextNode, TranslateCLIPTextEncodeNode, DeepTranslatorTextNode, DeepTranslatorCLIPTextEncodeNode, ArgosTranslateTextNode, ArgosTranslateCLIPTextEncodeNode, ChatGLM4TranslateCLIPTextEncodeNode, ChatGLM4TranslateTextNode, ChatGLM4InstructNode, ChatGLM4InstructMediaNode, PreviewTextNode, HexToHueNode, ColorsCorrectNode, IDENode."
version = "1.0.81"
version = "1.0.82"
license = { file = "LICENSE" }
[project.urls]