mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 10:25:16 +00:00
Merge branch 'add-defaultInput' of https://github.com/chrisgoringe/ComfyUI
This commit is contained in:
commit
122fd5d37f
@ -142,7 +142,7 @@ app.registerExtension({
|
|||||||
const r = origOnNodeCreated ? origOnNodeCreated.apply(this) : undefined;
|
const r = origOnNodeCreated ? origOnNodeCreated.apply(this) : undefined;
|
||||||
if (this.widgets) {
|
if (this.widgets) {
|
||||||
for (const w of this.widgets) {
|
for (const w of this.widgets) {
|
||||||
if (w?.options?.forceInput) {
|
if (w?.options?.forceInput || w?.options?.defaultInput) {
|
||||||
const config = nodeData?.input?.required[w.name] || nodeData?.input?.optional?.[w.name] || [w.type, w.options || {}];
|
const config = nodeData?.input?.required[w.name] || nodeData?.input?.optional?.[w.name] || [w.type, w.options || {}];
|
||||||
convertToInput(this, w, config);
|
convertToInput(this, w, config);
|
||||||
}
|
}
|
||||||
|
@ -1248,6 +1248,10 @@ export class ComfyApp {
|
|||||||
if (!config.widget.options) config.widget.options = {};
|
if (!config.widget.options) config.widget.options = {};
|
||||||
config.widget.options.forceInput = inputData[1].forceInput;
|
config.widget.options.forceInput = inputData[1].forceInput;
|
||||||
}
|
}
|
||||||
|
if(widgetCreated && inputData[1]?.defaultInput && config?.widget) {
|
||||||
|
if (!config.widget.options) config.widget.options = {};
|
||||||
|
config.widget.options.defaultInput = inputData[1].defaultInput;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const o in nodeData["output"]) {
|
for (const o in nodeData["output"]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user