diff --git a/README.md b/README.md index 3da54e4..206577b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ personalization in your ComfyUI environment. * [Colored Nodes](#colored-nodes) + [Positive/Negative](#positivenegative) + [Dynamic Colors](#dynamic-colors) +- [Main Menu](#main-menu) + * [Unload Models](#unload-models) - [Context Menu](#context-menu) * [Nodes](#nodes) + [Custom Color Option (only available in "default" Color Mode)](#custom-color-option-only-available-in-default-color-mode) @@ -109,7 +111,6 @@ Different customization options available with their default settings and descri | Connections Width | `3` | Sets the width of connector lines | | Font Size | `10` | Sets the font size of textareas | | Colored Nodes | `default` | Applies dynamic coloring to nodes | -| Batch Resize | `false` | Resizes multiple selected nodes to the same size synchronously | ### Colored Nodes @@ -141,6 +142,23 @@ Several dynamic coloring modes are available:

Dynamic Colors Modes: plain, by type, rainbow

+## Main Menu + +### Unload Models + +Free up GPU memory by unloading the models + +
+ Unload Models Button +

A new Button is available

+
+ +
+ GPU freed +

GPU Memory was freed

+
+ + ## Context Menu The context menu offers additional options for nodes, groups, colors, and the canvas: @@ -161,6 +179,7 @@ The context menu offers additional options for nodes, groups, colors, and the ca

Reroute show/hide Title

+ #### Render Reroute as Dot
diff --git a/extensions/unloadModelsButton.js b/extensions/unloadModelsButton.js new file mode 100644 index 0000000..b46ea78 --- /dev/null +++ b/extensions/unloadModelsButton.js @@ -0,0 +1,27 @@ +import { app } from "/scripts/app.js"; +import { $el } from "/scripts/ui.js"; + +const nodeName = "Failfast.unloadModels"; + +const button = $el( + "button", + { + onclick() { + fetch("/free", { + method: "POST", + body: JSON.stringify({ unload_models: true }), + headers: { "Content-Type": "application/json" }, + }).catch((error) => { + console.error(error); + }); + }, + }, + ["Unload Models"] +); + +app.registerExtension({ + name: nodeName, + async init(app) { + app.ui.menuContainer.append(button); + }, +});