Adds custom body text option for system notification.

This commit is contained in:
Royce Schultz
2024-05-16 14:50:32 -06:00
parent 8699721a66
commit 5f01d9bdac
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -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, )}
+2 -1
View File
@@ -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;