feat: ImpactCount_Elts_in_SEGS
improve: ImpactLogger
This commit is contained in:
@@ -119,6 +119,7 @@ This custom node helps to conveniently enhance images through Detector, Detailer
|
||||
* `Dilate SEG_ELT` - Dilate the mask of SEG_ELT.
|
||||
* `From SEG_ELT` bbox - Extract coordinate from bbox in SEG_ELT
|
||||
* `From SEG_ELT` crop_region - Extract coordinate from crop_region in SEG_ELT
|
||||
* `Count Elt in SEGS` - Number of Elts ins SEGS
|
||||
|
||||
### Pipe nodes
|
||||
* `ToDetailerPipe`, `FromDetailerPipe` - These nodes are used to bundle multiple inputs used in the detailer, such as models and vae, ..., into a single DETAILER_PIPE or extract the elements that are bundled in the DETAILER_PIPE.
|
||||
|
||||
@@ -195,6 +195,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"ImpactScaleBy_BBOX_SEG_ELT": SEG_ELT_BBOX_ScaleBy,
|
||||
"ImpactFrom_SEG_ELT_bbox": From_SEG_ELT_bbox,
|
||||
"ImpactFrom_SEG_ELT_crop_region": From_SEG_ELT_crop_region,
|
||||
"ImpactCount_Elts_in_SEGS": Count_Elts_in_SEGS,
|
||||
|
||||
"BboxDetectorCombined_v2": BboxDetectorCombined,
|
||||
"SegmDetectorCombined_v2": SegmDetectorCombined,
|
||||
@@ -380,6 +381,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"ImpactFrom_SEG_ELT_crop_region": "From SEG_ELT crop_region",
|
||||
"ImpactDilate_Mask_SEG_ELT": "Dilate Mask (SEG_ELT)",
|
||||
"ImpactScaleBy_BBOX_SEG_ELT": "ScaleBy BBOX (SEG_ELT)",
|
||||
"ImpactCount_Elts_in_SEGS": "Count Elts in SEGS",
|
||||
"ImpactDilateMask": "Dilate Mask",
|
||||
"ImpactGaussianBlurMask": "Gaussian Blur Mask",
|
||||
"ImpactDilateMaskInSEGS": "Dilate Mask (SEGS)",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import configparser
|
||||
import os
|
||||
|
||||
version_code = [5, 11, 5]
|
||||
version_code = [5, 12]
|
||||
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
dependency_version = 21
|
||||
|
||||
@@ -730,6 +730,23 @@ class SEGSConcat:
|
||||
return ((dim, res), )
|
||||
|
||||
|
||||
class Count_Elts_in_SEGS:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {"required": {
|
||||
"segs": ("SEGS", ),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("INT",)
|
||||
FUNCTION = "doit"
|
||||
|
||||
CATEGORY = "ImpactPack/Util"
|
||||
|
||||
def doit(self, segs):
|
||||
return (len(segs[1]), )
|
||||
|
||||
|
||||
class DecomposeSEGS:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
|
||||
@@ -6,6 +6,7 @@ import comfy
|
||||
import sys
|
||||
import nodes
|
||||
import re
|
||||
from server import PromptServer
|
||||
|
||||
|
||||
class GeneralSwitch:
|
||||
@@ -196,8 +197,9 @@ class ImpactLogger:
|
||||
def INPUT_TYPES(s):
|
||||
return {"required": {
|
||||
"data": (any_typ, ""),
|
||||
"text": ("STRING", {"multiline": True}),
|
||||
},
|
||||
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
|
||||
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO", "unique_id": "UNIQUE_ID"},
|
||||
}
|
||||
|
||||
CATEGORY = "ImpactPack/Debug"
|
||||
@@ -207,7 +209,7 @@ class ImpactLogger:
|
||||
RETURN_TYPES = ()
|
||||
FUNCTION = "doit"
|
||||
|
||||
def doit(self, data, prompt, extra_pnginfo):
|
||||
def doit(self, data, text, prompt, extra_pnginfo, unique_id):
|
||||
shape = ""
|
||||
if hasattr(data, "shape"):
|
||||
shape = f"{data.shape} / "
|
||||
@@ -218,12 +220,13 @@ class ImpactLogger:
|
||||
|
||||
# for x in prompt:
|
||||
# if 'inputs' in x and 'populated_text' in x['inputs']:
|
||||
# print(f"PROMP: {x['10']['inputs']['populated_text']}")
|
||||
# print(f"PROMPT: {x['10']['inputs']['populated_text']}")
|
||||
#
|
||||
# for x in extra_pnginfo['workflow']['nodes']:
|
||||
# if x['type'] == 'ImpactWildcardProcessor':
|
||||
# print(f" WV : {x['widgets_values'][1]}\n")
|
||||
|
||||
PromptServer.instance.send_sync("impact-node-feedback", {"node_id": unique_id, "widget_name": "text", "type": "TEXT", "value": f"{data}"})
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-impact-pack"
|
||||
description = "This extension offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler."
|
||||
version = "5.11.5"
|
||||
version = "5.12"
|
||||
license = "LICENSE"
|
||||
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user