Adds custom body text option for system notification.
This commit is contained in:
@@ -7,6 +7,7 @@ class SystemNotification:
|
||||
"required": {
|
||||
"any": (ComfyAnyType("*"), {}),
|
||||
"mode": (["always", "on empty queue"], {}),
|
||||
"notification_text": ('STRING', {'default': 'Your notification has triggered.'}),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -15,5 +16,5 @@ class SystemNotification:
|
||||
RETURN_TYPES = tuple()
|
||||
CATEGORY = "notifications"
|
||||
|
||||
def nop(self, any, mode):
|
||||
return {"ui": {"a": []}, "result": (0, )}
|
||||
def nop(self, any, mode, notification_text):
|
||||
return {"ui": {"notification_text": [notification_text]}, "result": (0, )}
|
||||
|
||||
@@ -33,7 +33,8 @@ app.registerExtension({
|
||||
}
|
||||
}
|
||||
if (!notificationSetup()) return;
|
||||
const notification = new Notification("ComfyUI", { body: "Your notification has triggered." })
|
||||
const notification_text = arguments[0]?.notification_text[0] ?? "Your notification has triggered."
|
||||
const notification = new Notification("ComfyUI", { body: notification_text })
|
||||
};
|
||||
|
||||
const onNodeCreated = nodeType.prototype.onNodeCreated;
|
||||
|
||||
Reference in New Issue
Block a user