update name

This commit is contained in:
phamhungd
2026-02-03 13:37:37 +07:00
parent 3b69ab7a9b
commit 2e99c8acf1
4 changed files with 12 additions and 8 deletions
+6 -6
View File
@@ -2,12 +2,12 @@ from .node import *
from .install import *
NODE_CLASS_MAPPINGS = {
'🧩 SAMModelLoader': SAMModelLoader,
'🧩 DinoModelLoader': GroundingDinoModelLoader,
'🧩 DinoSAMSegment': GroundingDinoSAMSegment,
'🧩 InvertMask': InvertMask,
"🧩 IsMaskEmpty": IsMaskEmptyNode,
"🧩 SegmentAnything": SegmentAnything,
'🧩 SAMModel Loader': SAMModelLoader,
'🧩 DinoModel Loader': GroundingDinoModelLoader,
'🧩 Dino SAMSegment': GroundingDinoSAMSegment,
'🧩 Invert Mask': InvertMask,
"🧩 Is Mask Empty": IsMaskEmptyNode,
"🧩 Segment Anything": SegmentAnything,
}
__all__ = ['NODE_CLASS_MAPPINGS']
Binary file not shown.
Binary file not shown.
+6 -2
View File
@@ -3,7 +3,7 @@ import sys
sys.path.append(
os.path.dirname(os.path.abspath(__file__))
)
from nodes import NODE_CLASS_MAPPINGS as ALL_NODE
import copy
import torch
import numpy as np
@@ -383,7 +383,11 @@ class SegmentAnything:
sam_load_model = SAMModelLoader().main(sam_model)[0]
dino_load_model = GroundingDinoModelLoader().main(dino_model)[0]
output = GroundingDinoSAMSegment().main(dino_load_model, sam_load_model, image, prompt, threshold, threshold)
return (output)
mask = output[1]
invert_mask = (1.0 - mask).to(image.device)
alpha_image = ALL_NODE["JoinImageWithAlpha"]().execute(image, invert_mask)[0]
ui = ALL_NODE["PreviewImage"]().save_images(alpha_image)["ui"]
return {"ui":ui, "result": output}
class InvertMask:
@classmethod