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

@@ -106,11 +106,6 @@ export type Attributes = {
*/
title: string,
/*
* If false, hide the title.
*/
showTitle: boolean,
/*
* List of classes to apply to the component.
*/
@@ -203,6 +198,21 @@ export type AttributesSpec = {
*/
values?: string[],
/*
* If `type` is "number", step for the slider
*/
step?: number,
/*
* If `type` is "number", min for the slider
*/
min?: number,
/*
* If `type` is "number", max for the slider
*/
max?: number,
/*
* Valid `LGraphNode.type`s this property applies to if it's located in a node.
* These are like "ui/button", "ui/slider".
@@ -379,6 +389,8 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
location: "nodeProps",
editable: true,
defaultValue: 0,
min: -2 ^ 16,
max: 2 ^ 16,
validNodeTypes: ["ui/slider"],
},
{
@@ -387,6 +399,8 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
location: "nodeProps",
editable: true,
defaultValue: 10,
min: -2 ^ 16,
max: 2 ^ 16,
validNodeTypes: ["ui/slider"],
},
{
@@ -395,6 +409,8 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
location: "nodeProps",
editable: true,
defaultValue: 1,
min: -2 ^ 16,
max: 2 ^ 16,
validNodeTypes: ["ui/slider"],
},
@@ -408,6 +424,17 @@ const ALL_ATTRIBUTES: AttributesSpecList = [
defaultValue: "bang"
},
// gallery
{
name: "updateMode",
type: "enum",
location: "nodeProps",
editable: true,
validNodeTypes: ["ui/gallery"],
values: ["replace", "append"],
defaultValue: "replace"
},
// Workflow
{
name: "defaultSubgraph",
@@ -544,7 +571,6 @@ function addContainer(parent: ContainerLayout | null, attrs: Partial<Attributes>
attrsChanged: writable(false),
attrs: {
title: "Container",
showTitle: true,
direction: "vertical",
classes: "",
containerVariant: "block",
@@ -572,7 +598,6 @@ function addWidget(parent: ContainerLayout, node: ComfyWidgetNode, attrs: Partia
attrsChanged: writable(false),
attrs: {
title: widgetName,
showTitle: true,
direction: "horizontal",
classes: "",
flexGrow: 100,