mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-20 21:37:00 +08:00
Populate audio widget when load history
This commit is contained in:
parent
e2b7182648
commit
c87e69a27a
@ -111,7 +111,18 @@ app.registerExtension({
|
|||||||
return { widget: audioUIWidget }
|
return { widget: audioUIWidget }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
onNodeOutputsUpdated(nodeOutputs) {
|
||||||
|
for (const [nodeId, output] of Object.entries(nodeOutputs)) {
|
||||||
|
const node = app.graph.getNodeById(Number.parseInt(nodeId));
|
||||||
|
if ("audio" in output) {
|
||||||
|
const audioUIWidget = node.widgets.find((w) => w.name === "audioUI");
|
||||||
|
const audio = output.audio[0];
|
||||||
|
audioUIWidget.element.src = api.apiURL(getResourceURL(audio.subfolder, audio.filename, "output"));
|
||||||
|
audioUIWidget.element.classList.remove("empty-audio-widget");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
app.registerExtension({
|
app.registerExtension({
|
||||||
|
|||||||
@ -71,7 +71,7 @@ export class ComfyApp {
|
|||||||
* Stores the execution output data for each node
|
* Stores the execution output data for each node
|
||||||
* @type {Record<string, any>}
|
* @type {Record<string, any>}
|
||||||
*/
|
*/
|
||||||
this.nodeOutputs = {};
|
this._nodeOutputs = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the preview image data for each node
|
* Stores the preview image data for each node
|
||||||
@ -86,6 +86,15 @@ export class ComfyApp {
|
|||||||
this.shiftDown = false;
|
this.shiftDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get nodeOutputs() {
|
||||||
|
return this._nodeOutputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
set nodeOutputs(value) {
|
||||||
|
this._nodeOutputs = value;
|
||||||
|
this.#invokeExtensions("onNodeOutputsUpdated", value);
|
||||||
|
}
|
||||||
|
|
||||||
getPreviewFormatParam() {
|
getPreviewFormatParam() {
|
||||||
let preview_format = this.ui.settings.getSettingValue("Comfy.PreviewFormat");
|
let preview_format = this.ui.settings.getSettingValue("Comfy.PreviewFormat");
|
||||||
if(preview_format)
|
if(preview_format)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user