Files
ComfyUI-Lora-Manager/web/comfyui/prompt.js
Will Miao 194f2f702c refactor: replace comfy built-in text widget with custome autocomplete text widget for better event handler binding
- Change `STRING` input type to `AUTOCOMPLETE_TEXT_LORAS` in LoraManagerLoader, LoraStacker, and WanVideoLoraSelectLM nodes for LoRA syntax input
- Change `STRING` input type to `AUTOCOMPLETE_TEXT_EMBEDDINGS` in PromptLoraManager node for prompt input
- Remove manual multiline, autocomplete, and dynamicPrompts configurations in favor of built-in autocomplete types
- Update placeholder text for consistency across nodes
- Remove unused `setupInputWidgetWithAutocomplete` mock from frontend tests
- Add Vue app cleanup logic to prevent memory leaks in widget management
2026-01-25 08:30:06 +08:00

21 lines
603 B
JavaScript

import { app } from "../../scripts/app.js";
import { chainCallback } 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;
// Get the text input widget (AUTOCOMPLETE_TEXT_EMBEDDINGS type, created by Vue widgets)
const inputWidget = this.widgets?.[0];
if (inputWidget) {
this.inputWidget = inputWidget;
}
});
}
},
});