Compare commits

..
8 Commits
Author SHA1 Message Date
Alexander Piskun 1f7e3104be added fields for prompt translations feature
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-09-27 22:37:01 +03:00
Alexander Piskun 895c4de920 disabled rounding for VixUiRangeFloat and VixUiRangeScaleFloat (3)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-26 16:28:31 +03:00
Alexander Piskun 0186662ea3 disabled rounding for VixUiRangeFloat and VixUiRangeScaleFloat (2)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-26 14:42:24 +03:00
Alexander Piskun 9dc9633474 disabled rounding for VixUiRangeFloat and VixUiRangeScaleFloat
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-26 14:33:41 +03:00
Alexander Piskun 3648146f35 added lazy_loading to Logic nodes
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-24 12:17:42 +03:00
Alexander Piskun 5ad9313ba4 added optional field hidden(mean the parameter should be set only from API)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-13 16:45:54 +03:00
Alexander Piskun e6477ffc51 added is_seed_supported and is_count_supported flags to VixUiWorkflowMetadata
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-08-10 11:31:39 +03:00
Alexander Piskun 0ba0dc83f5 added VixUiRangeInt UI node
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-07-28 14:12:06 +03:00
2 changed files with 93 additions and 16 deletions
+1
View File
@@ -11,6 +11,7 @@ Current `Visionatrix/UI` nodes list:
- **VixUI-Checkbox** - simple checkbox boolean input field;
- **VixUi-RangeFloat** - range float number input, e.g. for prompt strength selection;
- **VixUi-RangeScaleFloat** - special range float number input, to define the scale factor of the input image (e.g. for upscale)
- **VixUi-RangeInt** - range int number input, e.g. for number of steps selection;
- **VixUi-List** - define list of options to be displayed in Visionatrix UI;
- **VixUI-Prompt** - to define a textarea input in Visionatrix UI and pass it to your CLIPTextEncode node with prompt;
- **VixUi-CheckboxLogic** - to define the boolean logical switch (checkbox), e.g. two modes and paths of workflow execution;
+92 -16
View File
@@ -21,6 +21,9 @@ class VixUiCheckbox:
"order": ("INT", {"default": 99}),
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"hidden": ("BOOLEAN", {"default": False}),
},
}
RETURN_TYPES = ("BOOLEAN", "INT")
@@ -38,16 +41,19 @@ class VixUiRangeFloat:
def INPUT_TYPES(cls):
return {
"required": {
"value": ("FLOAT", {"default": 4.0}),
"value": ("FLOAT", {"default": 4.0, "step": 0.01, "round": False}),
"display_name": ("STRING", {"default": "Display Range"}),
"optional": ("BOOLEAN", {"default": True}),
"advanced": ("BOOLEAN", {"default": True}),
"min": ("FLOAT", {"default": 1.0}),
"max": ("FLOAT", {"default": 9.0}),
"step": ("FLOAT", {"default": 0.1}),
"min": ("FLOAT", {"default": 1.0, "step": 0.01, "round": False}),
"max": ("FLOAT", {"default": 9.0, "step": 0.01, "round": False}),
"step": ("FLOAT", {"default": 0.1, "step": 0.01, "round": False}),
"order": ("INT", {"default": 99}),
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"hidden": ("BOOLEAN", {"default": False}),
},
}
FUNCTION = "do_it"
@@ -64,17 +70,20 @@ class VixUiRangeScaleFloat:
def INPUT_TYPES(cls):
return {
"required": {
"value": ("FLOAT", {"default": 4.0}),
"value": ("FLOAT", {"default": 4.0, "step": 0.01, "round": False}),
"display_name": ("STRING", {"default": "Image Size Factor"}),
"optional": ("BOOLEAN", {"default": True}),
"advanced": ("BOOLEAN", {"default": True}),
"source_input_name": ("STRING", {"default": ""}),
"min": ("FLOAT", {"default": 1.0}),
"max": ("FLOAT", {"default": 9.0}),
"step": ("FLOAT", {"default": 0.1}),
"min": ("FLOAT", {"default": 1.0, "step": 0.01, "round": False}),
"max": ("FLOAT", {"default": 9.0, "step": 0.01, "round": False}),
"step": ("FLOAT", {"default": 0.1, "step": 0.01, "round": False}),
"order": ("INT", {"default": 99}),
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"hidden": ("BOOLEAN", {"default": False}),
},
}
FUNCTION = "do_it"
@@ -86,6 +95,35 @@ class VixUiRangeScaleFloat:
return (value,)
class VixUiRangeInt:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"value": ("INT", {"default": 10}),
"display_name": ("STRING", {"default": "Display Range"}),
"optional": ("BOOLEAN", {"default": True}),
"advanced": ("BOOLEAN", {"default": True}),
"min": ("INT", {"default": 1}),
"max": ("INT", {"default": 20}),
"step": ("INT", {"default": 1}),
"order": ("INT", {"default": 99}),
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"hidden": ("BOOLEAN", {"default": False}),
},
}
FUNCTION = "do_it"
CATEGORY = "Visionatrix/UI"
RETURN_TYPES = ("INT",)
@classmethod
def do_it(cls, value, **kwargs) -> tuple:
return (value,)
class VixUiList:
@classmethod
def INPUT_TYPES(cls):
@@ -99,6 +137,9 @@ class VixUiList:
"order": ("INT", {"default": 99}),
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"hidden": ("BOOLEAN", {"default": False}),
},
}
RETURN_TYPES = (any_typ,)
FUNCTION = "do_it"
@@ -124,6 +165,10 @@ class VixUiPrompt:
"order": ("INT", {"default": 10}),
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"hidden": ("BOOLEAN", {"default": False}),
"translatable": ("BOOLEAN", {"default": False}),
},
}
RETURN_TYPES = ("STRING",)
FUNCTION = "do_it"
@@ -147,8 +192,9 @@ class VixUiCheckboxLogic:
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"input_off_state": (any_typ,),
"input_on_state": (any_typ,),
"input_off_state": (any_typ, {"lazy": True}),
"input_on_state": (any_typ, {"lazy": True}),
"hidden": ("BOOLEAN", {"default": False}),
},
}
@@ -163,6 +209,12 @@ class VixUiCheckboxLogic:
return (kwargs.get("input_off_state", None),)
return (kwargs.get("input_on_state", None),)
@staticmethod
def check_lazy_status(state, **kwargs):
if state is False:
return ["input_off_state"]
return ["input_on_state"]
class VixUiListLogic:
@classmethod
@@ -178,12 +230,13 @@ class VixUiListLogic:
"custom_id": ("STRING", {"default": ""}),
},
"optional": {
"input_first": (any_typ,),
"input_second": (any_typ,),
"input_third": (any_typ,),
"input_fourth": (any_typ,),
"input_fifth": (any_typ,),
"input_sixth": (any_typ,),
"input_first": (any_typ, {"lazy": True}),
"input_second": (any_typ, {"lazy": True}),
"input_third": (any_typ, {"lazy": True}),
"input_fourth": (any_typ, {"lazy": True}),
"input_fifth": (any_typ, {"lazy": True}),
"input_sixth": (any_typ, {"lazy": True}),
"hidden": ("BOOLEAN", {"default": False}),
},
}
@@ -210,6 +263,24 @@ class VixUiListLogic:
return (kwargs["input_sixth"],)
raise RuntimeError("Workflow logic error")
@staticmethod
def check_lazy_status(default_value, **kwargs):
list_with_values: list = json.loads(kwargs["possible_values"])
index_to_return = list_with_values.index(default_value)
if index_to_return == 0:
return ["input_first"]
if index_to_return == 1:
return ["input_second"]
if index_to_return == 2:
return ["input_third"]
if index_to_return == 3:
return ["input_fourth"]
if index_to_return == 4:
return ["input_fifth"]
if index_to_return == 5:
return ["input_sixth"]
raise RuntimeError("Workflow logic error")
class VixUiWorkflowMetadata:
@classmethod
@@ -228,6 +299,9 @@ class VixUiWorkflowMetadata:
},
"optional": {
"requires": ("STRING", {"default": "[]", "multiline": True}),
"is_seed_supported": ("BOOLEAN", {"default": True}),
"is_count_supported": ("BOOLEAN", {"default": True}),
"is_translations_supported": ("BOOLEAN", {"default": False}),
}
}
RETURN_TYPES = ("STRING",)
@@ -243,6 +317,7 @@ NODE_CLASS_MAPPINGS = {
"VixUiCheckbox": VixUiCheckbox,
"VixUiRangeFloat": VixUiRangeFloat,
"VixUiRangeScaleFloat": VixUiRangeScaleFloat,
"VixUiRangeInt": VixUiRangeInt,
"VixUiList": VixUiList,
"VixUiPrompt": VixUiPrompt,
"VixUiCheckboxLogic": VixUiCheckboxLogic,
@@ -254,6 +329,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"VixUiCheckbox": "VixUI-Checkbox",
"VixUiRangeFloat": "VixUI-RangeFloat",
"VixUiRangeScaleFloat": "VixUI-RangeScaleFloat",
"VixUiRangeInt": "VixUI-RangeInt",
"VixUiList": "VixUI-List",
"VixUiPrompt": "VixUI-Prompt",
"VixUiCheckboxLogic": "VixUI-CheckboxLogic",