Update mode for gallery, ranges for properties

This commit is contained in:
space-nuko
2023-05-06 17:42:12 -05:00
parent 3b170ec19e
commit 1053318fe9
11 changed files with 112 additions and 40 deletions

View File

@@ -163,6 +163,10 @@
}
}
:global(.label-wrap > span:not(.icon)) {
color: var(--block-title-text-color);
}
.handle {
cursor: grab;
z-index: 99999;

View File

@@ -590,7 +590,7 @@ export default class ComfyApp {
for (let i = 0; i < batchCount; i++) {
for (const node of this.lGraph._nodes_in_order) {
if ("beforeQueued" in node) {
(node as ComfyGraphNode).beforeQueued();
(node as ComfyGraphNode).beforeQueued(tag);
}
}
@@ -613,7 +613,7 @@ export default class ComfyApp {
for (const n of p.workflow.nodes) {
const node = this.lGraph.getNodeById(n.id);
if ("afterQueued" in node) {
(node as ComfyGraphNode).afterQueued(p);
(node as ComfyGraphNode).afterQueued(p, tag);
}
}

View File

@@ -3,6 +3,8 @@
import { createEventDispatcher } from "svelte";
export let value: number = 0;
export let min: number = -1024
export let max: number = 1024
export let step: number = 1;
export let name: string = "";
export let disabled: boolean = false;
@@ -27,7 +29,7 @@
<label class="number-wrapper">
<BlockTitle>{name}</BlockTitle>
<div class="number">
<input type="number" bind:value {step} {disabled}>
<input type="number" bind:value {min} {max} {step} {disabled}>
</div>
</label>

View File

@@ -245,13 +245,15 @@
label={spec.name}
/>
{:else if spec.type === "number"}
<ComfyNumberProperty
name={spec.name}
value={getAttribute(target, spec)}
step={1}
disabled={!$uiState.uiUnlocked || !spec.editable}
on:change={(e) => updateAttribute(spec, target, e.detail)}
/>
<ComfyNumberProperty
name={spec.name}
value={getAttribute(target, spec)}
step={spec.step || 1}
min={spec.min || -1024}
max={spec.max || 1024}
disabled={!$uiState.uiUnlocked || !spec.editable}
on:change={(e) => updateAttribute(spec, target, e.detail)}
/>
{:else if spec.type === "enum"}
<ComfyComboProperty
name={spec.name}
@@ -285,7 +287,9 @@
<ComfyNumberProperty
name={spec.name}
value={node.properties[spec.name] || spec.defaultValue}
step={1}
step={spec.step || 1}
min={spec.min || -1024}
max={spec.max || 1024}
disabled={!$uiState.uiUnlocked || !spec.editable}
on:change={(e) => updateProperty(spec, e.detail)}
/>
@@ -321,7 +325,9 @@
<ComfyNumberProperty
name={spec.name}
value={getVar(node, spec)}
step={1}
step={spec.step || 1}
min={spec.min || -1024}
max={spec.max || 1024}
disabled={!$uiState.uiUnlocked || !spec.editable}
on:change={(e) => updateVar(spec, e.detail)}
/>
@@ -358,7 +364,9 @@
<ComfyNumberProperty
name={spec.name}
value={$layoutState.attrs[spec.name] || spec.defaultValue}
step={1}
step={spec.step || 1}
min={spec.min || -1024}
max={spec.max || 1024}
disabled={!$uiState.uiUnlocked || !spec.editable}
on:change={(e) => updateWorkflowAttribute(spec, e.detail)}
/>