easy way to exclude json from dynamic prompt manipulation

This commit is contained in:
Tasha Upchurch 2023-06-25 19:30:15 -04:00 committed by GitHub
parent 4eab00e14b
commit 922540947c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ app.registerExtension({
// Locate dynamic prompt text widgets
// Include any widgets with dynamicPrompts set to true, and customtext
const widgets = node.widgets.filter(
(n) => (n.type === "customtext" && n.dynamicPrompts !== false) || n.dynamicPrompts
widget => widget.dynamicPrompts || (widget.customtext && !widget.widgets.some(subWidget => subWidget.name.toLowerCase().includes("json")))
);
for (const widget of widgets) {
// Override the serialization of the value to resolve dynamic prompts for all widgets supporting it in this node