Randomize seed in a hackish way

This commit is contained in:
space-nuko
2023-04-25 06:26:40 -07:00
parent 76a22c47f6
commit cd0fde0f55
8 changed files with 66 additions and 10 deletions

View File

@@ -26,7 +26,7 @@ export default abstract class ComfyWidget<T = any, V = any> implements IWidget<T
setValue(value: V) {
this.value = value;
widgetState.widgetStateChanged(this);
widgetState.widgetStateChanged(this.node.id, this);
}
draw?(ctx: CanvasRenderingContext2D, node: LGraphNode, width: number, posY: number, height: number): void;

View File

@@ -6,10 +6,13 @@
let itemValue: WidgetUIStateStore | null = null;
let option: number | null = null;
$: if (item && !option) {
if (!itemValue)
itemValue = item.value;
option = get(item.value)
$: if (item) {
itemValue = item.value;
updateOption(); // don't react on option
}
function updateOption() {
option = get(itemValue);
}
function onRelease(e: Event) {