mirror of
https://github.com/jags111/efficiency-nodes-comfyui.git
synced 2026-05-07 09:06:44 -03:00
Compare commits
2 Commits
copilot/fi
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff375071c0 | ||
|
|
6e8cb9be98 |
@@ -117,7 +117,10 @@ class SeedControl {
|
|||||||
this.updateButtonLabel();
|
this.updateButtonLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't update the widget value to maintain -1 in the UI when seed was special
|
||||||
|
if (!this.serializedCtx.wasSpecial) {
|
||||||
this.seedWidget.value = this.serializedCtx.seedUsed;
|
this.seedWidget.value = this.serializedCtx.seedUsed;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.serializedCtx.wasSpecial) {
|
if (this.serializedCtx.wasSpecial) {
|
||||||
this.lastSeed = this.serializedCtx.seedUsed;
|
this.lastSeed = this.serializedCtx.seedUsed;
|
||||||
@@ -133,12 +136,8 @@ class SeedControl {
|
|||||||
return; // Exit the function immediately
|
return; // Exit the function immediately
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.serializedCtx.wasSpecial) {
|
// Update lastSeed if user manually changed the seed to a specific value
|
||||||
this.seedWidget.value = -1;
|
if (!this.serializedCtx.wasSpecial && this.seedWidget.value !== -1) {
|
||||||
}
|
|
||||||
|
|
||||||
// Check if seed has changed to a non -1 value, and if so, update lastSeed
|
|
||||||
if (this.seedWidget.value !== -1) {
|
|
||||||
this.lastSeed = this.seedWidget.value;
|
this.lastSeed = this.seedWidget.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ function toggleWidget(node, widget, show = false, suffix = "") {
|
|||||||
node.setSize([node.size[0], newHeight]);
|
node.setSize([node.size[0], newHeight]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WIDGET_HEIGHT = 24;
|
||||||
// Use for Multiline Widget Nodes (aka Efficient Loaders)
|
// Use for Multiline Widget Nodes (aka Efficient Loaders)
|
||||||
function toggleWidget_2(node, widget, show = false, suffix = "") {
|
function toggleWidget_2(node, widget, show = false, suffix = "") {
|
||||||
if (!widget || doesInputWithNameExist(node, widget.name)) return;
|
if (!widget || doesInputWithNameExist(node, widget.name)) return;
|
||||||
@@ -51,10 +52,8 @@ function toggleWidget_2(node, widget, show = false, suffix = "") {
|
|||||||
widget.computeSize = show ? origProps[widget.name].origComputeSize : () => [0, -4];
|
widget.computeSize = show ? origProps[widget.name].origComputeSize : () => [0, -4];
|
||||||
|
|
||||||
if (initialized){
|
if (initialized){
|
||||||
// Calculate the new height for the node based on its computeSize method
|
const adjustment = show ? WIDGET_HEIGHT : -WIDGET_HEIGHT;
|
||||||
// This properly accounts for font size changes and ensures widgets don't overlap
|
node.setSize([node.size[0], node.size[1] + adjustment]);
|
||||||
const newHeight = node.computeSize()[1];
|
|
||||||
node.setSize([node.size[0], newHeight]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user