27 lines
798 B
JavaScript
27 lines
798 B
JavaScript
import { app } from "/scripts/app.js";
|
|
|
|
app.registerExtension({
|
|
name: "CustomUtils.ReloadUIButton",
|
|
|
|
// 1. Define the actual browser execution task
|
|
commands: [
|
|
{
|
|
id: "reloadComfyUICommand",
|
|
label: "🔄 Reload ComfyUI",
|
|
function: () => {
|
|
// Instantly soft-reboots the user interface without losing local storage cache
|
|
window.location.reload();
|
|
}
|
|
}
|
|
],
|
|
|
|
// 2. Inject the command into ComfyUI's main top utility bar menu layout
|
|
menuCommands: [
|
|
{
|
|
// Places it under 'Menu -> Extensions -> Reload UI' or inside the Topbar depending on your active UI version
|
|
path: ["Extensions"],
|
|
commands: ["reloadComfyUICommand"]
|
|
}
|
|
]
|
|
});
|