new manual error node
This commit is contained in:
+3
-3
@@ -5,9 +5,7 @@ from .adjustment import (
|
||||
SuperLevelsNormalize,
|
||||
SuperWhiteBalanceCAT,
|
||||
)
|
||||
from .debug import (
|
||||
SuperLatentStats,
|
||||
)
|
||||
from .debug import SuperLatentStats, SuperStopExecution
|
||||
from .image import ImageMaskCrop, RestoreMaskCrop
|
||||
from .qol import (
|
||||
FaceBBoxToMask,
|
||||
@@ -40,6 +38,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"GetCommonAspectRatio": GetCommonAspectRatio,
|
||||
"SetReserveVRAM": SetReserveVRAM,
|
||||
"SuperLatentStats": SuperLatentStats,
|
||||
"User Error": SuperStopExecution,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
@@ -63,6 +62,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"GetCommonAspectRatio": "🐧 Get Aspect Ratio",
|
||||
"SetReserveVRAM": "🐧 Set Reserve VRAM",
|
||||
"SuperLatentStats": "🐧 Latent Stats",
|
||||
"User Error": "🐧 Show Error Message",
|
||||
}
|
||||
|
||||
print("\033[34m[SuperNodes]\033[0m Classes initialized.")
|
||||
|
||||
@@ -175,8 +175,39 @@ class SuperLatentStats:
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
FUNCTION = "run"
|
||||
CATEGORY = "SuperNodes/adjustment"
|
||||
CATEGORY = "SuperNodes/debug"
|
||||
|
||||
def run(self, latent, label="latent", top_k=12):
|
||||
x = _get_samples(latent)
|
||||
return (_latent_stats_string(x, name=str(label), top_k=int(top_k)),)
|
||||
|
||||
|
||||
class SuperStopExecution:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {
|
||||
# "multiline": False ensures a single-line text input widget
|
||||
"message": (
|
||||
"STRING",
|
||||
{
|
||||
"multiline": False,
|
||||
"default": "Execution stopped manually.",
|
||||
},
|
||||
),
|
||||
},
|
||||
"optional": {
|
||||
# This wildcard input allows you to connect any node (Image, Latent, etc.)
|
||||
# to this node to force the execution flow to reach here.
|
||||
"trigger": ("*", {}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ()
|
||||
FUNCTION = "halt_execution"
|
||||
OUTPUT_NODE = True
|
||||
CATEGORY = "SuperNodes/debug"
|
||||
|
||||
def halt_execution(self, message, trigger=None):
|
||||
safe_message = str(message)
|
||||
raise Exception(f"⛔ {safe_message}")
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-supernodes"
|
||||
description = "A miscellaneous node pack of custom implementations needed for workflows released by my SuperComfy YouTube channel."
|
||||
version = "0.1.9"
|
||||
version = "0.2.0"
|
||||
license = { file = "LICENSE" }
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user