mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
feat(nodes): add Promp (LoraManager) node and autocomplete support
This commit is contained in:
29
web/comfyui/prompt.js
Normal file
29
web/comfyui/prompt.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { chainCallback, setupInputWidgetWithAutocomplete } from "./utils.js";
|
||||
|
||||
app.registerExtension({
|
||||
name: "LoraManager.Prompt",
|
||||
|
||||
async beforeRegisterNodeDef(nodeType) {
|
||||
if (nodeType.comfyClass === "Prompt (LoraManager)") {
|
||||
chainCallback(nodeType.prototype, "onNodeCreated", function () {
|
||||
this.serialize_widgets = true;
|
||||
|
||||
const textWidget = this.widgets?.[0];
|
||||
if (!textWidget) {
|
||||
return;
|
||||
}
|
||||
|
||||
const originalCallback =
|
||||
typeof textWidget.callback === "function" ? textWidget.callback : null;
|
||||
|
||||
textWidget.callback = setupInputWidgetWithAutocomplete(
|
||||
this,
|
||||
textWidget,
|
||||
originalCallback,
|
||||
"embeddings"
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user