feat: ImpactFrom_SEG_ELT_bbox, ImpactFrom_SEG_ELT_crop_region

https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/496
This commit is contained in:
Dr.Lt.Data
2024-03-03 00:46:02 +09:00
parent e984384068
commit d0cb63472a
4 changed files with 45 additions and 1 deletions
+2
View File
@@ -108,6 +108,8 @@ This custom node helps to conveniently enhance images through Detector, Detailer
* From SEG_ELT - Extract detailed information from SEG_ELT.
* Edit SEG_ELT - Modify some of the information in SEG_ELT.
* 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
* Mask Manipulation
* Dilate Mask - Dilate Mask.
+4
View File
@@ -229,6 +229,8 @@ NODE_CLASS_MAPPINGS = {
"ImpactDilateMaskInSEGS": DilateMaskInSEGS,
"ImpactGaussianBlurMaskInSEGS": GaussianBlurMaskInSEGS,
"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,
"BboxDetectorCombined_v2": BboxDetectorCombined,
"SegmDetectorCombined_v2": SegmDetectorCombined,
@@ -402,6 +404,8 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"ImpactAssembleSEGS": "Assemble (SEGS)",
"ImpactFrom_SEG_ELT": "From SEG_ELT",
"ImpactEdit_SEG_ELT": "Edit SEG_ELT",
"ImpactFrom_SEG_ELT_bbox": "From SEG_ELT bbox",
"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)",
"ImpactDilateMask": "Dilate Mask",
+1 -1
View File
@@ -2,7 +2,7 @@ import configparser
import os
version_code = [4, 80, 2]
version_code = [4, 81]
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
dependency_version = 20
+38
View File
@@ -755,6 +755,44 @@ class From_SEG_ELT:
return (seg_elt, cropped_image, to_tensor(seg_elt.cropped_mask), seg_elt.crop_region, seg_elt.bbox, seg_elt.control_net_wrapper, seg_elt.confidence, seg_elt.label,)
class From_SEG_ELT_bbox:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"bbox": ("SEG_ELT_bbox", ),
},
}
RETURN_TYPES = ("INT", "INT", "INT", "INT")
RETURN_NAMES = ("left", "top", "right", "bottom")
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
def doit(self, bbox):
return bbox
class From_SEG_ELT_crop_region:
@classmethod
def INPUT_TYPES(s):
return {"required": {
"crop_region": ("SEG_ELT_crop_region", ),
},
}
RETURN_TYPES = ("INT", "INT", "INT", "INT")
RETURN_NAMES = ("left", "top", "right", "bottom")
FUNCTION = "doit"
CATEGORY = "ImpactPack/Util"
def doit(self, crop_region):
return crop_region
class Edit_SEG_ELT:
@classmethod
def INPUT_TYPES(s):