mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-08-04 07:52:46 +08:00
Adding built in extensions + example
This commit is contained in:
@@ -27,7 +27,7 @@ function seedWidget(node, inputName, inputData) {
|
||||
return { widget: seed, randomize };
|
||||
}
|
||||
|
||||
function addMultilineWidget(node, name, defaultVal, dynamicPrompt, app) {
|
||||
function addMultilineWidget(node, name, defaultVal, app) {
|
||||
const widget = {
|
||||
type: "customtext",
|
||||
name,
|
||||
@@ -37,9 +37,6 @@ function addMultilineWidget(node, name, defaultVal, dynamicPrompt, app) {
|
||||
set value(x) {
|
||||
this.inputEl.value = x;
|
||||
},
|
||||
options: {
|
||||
dynamicPrompt,
|
||||
},
|
||||
draw: function (ctx, _, widgetWidth, y, widgetHeight) {
|
||||
const visible = app.canvas.ds.scale > 0.5;
|
||||
const t = ctx.getTransform();
|
||||
@@ -106,12 +103,11 @@ export const ComfyWidgets = {
|
||||
STRING(node, inputName, inputData, app) {
|
||||
const defaultVal = inputData[1].default || "";
|
||||
const multiline = !!inputData[1].multiline;
|
||||
const dynamicPrompt = !!inputData[1].dynamic_prompt;
|
||||
|
||||
if (multiline) {
|
||||
return addMultilineWidget(node, inputName, defaultVal, dynamicPrompt, app);
|
||||
return addMultilineWidget(node, inputName, defaultVal, app);
|
||||
} else {
|
||||
return { widget: node.addWidget("text", inputName, defaultVal, () => {}, { dynamicPrompt }) };
|
||||
return { widget: node.addWidget("text", inputName, defaultVal, () => {}, {}) };
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user