feat: make fully standalone — remove local LoRA Manager dependency
Proxy JS widget files from the remote instance via /extensions/ComfyUI-Lora-Manager/ prefix, and handle send_sync routes locally instead of falling through to the original package. This eliminates the requirement to install ComfyUI-Lora-Manager alongside. - Add /extensions/ComfyUI-Lora-Manager/ to proxy prefixes - Replace _SEND_SYNC_SKIP_ROUTES with local handler functions that fetch data from remote and broadcast events via PromptServer.send_sync() - Add lm_remote_bootstrap.js to load Vue widget bundle from remote - Update docstrings and README to reflect standalone operation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
web/comfyui/lm_remote_bootstrap.js
Normal file
25
web/comfyui/lm_remote_bootstrap.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Bootstrap loader for LoRA Manager Vue widget bundle.
|
||||
*
|
||||
* When the original ComfyUI-Lora-Manager package is NOT installed locally,
|
||||
* the Vue widget types (AUTOCOMPLETE_TEXT_LORAS, LORAS, LORA_POOL_CONFIG,
|
||||
* RANDOMIZER_CONFIG, CYCLER_CONFIG) would never be registered and nodes
|
||||
* wouldn't render.
|
||||
*
|
||||
* This script loads the Vue widget bundle from the remote instance via the
|
||||
* proxy at /extensions/ComfyUI-Lora-Manager/vue-widgets/. If the original
|
||||
* package IS installed, the bundle is already loaded and we skip the import.
|
||||
*/
|
||||
import { app } from "../../scripts/app.js";
|
||||
|
||||
const alreadyLoaded = app.extensions?.some(
|
||||
ext => ext.name === "LoraManager.VueWidgets"
|
||||
);
|
||||
|
||||
if (!alreadyLoaded) {
|
||||
try {
|
||||
await import("/extensions/ComfyUI-Lora-Manager/vue-widgets/lora-manager-widgets.js");
|
||||
} catch (err) {
|
||||
console.warn("[LM-Remote] Failed to load Vue widget bundle:", err);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user