mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-21 08:06:47 +00:00
remove old comfyUI
This commit is contained in:
-26
@@ -1,26 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
__Please attach a workflow file to make it easier for others to reproduce the error!__
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Version:**
|
||||
- ComfyUI Version
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
Vendored
-20
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -1,6 +0,0 @@
|
||||
__pycache__/
|
||||
.pytest_cache/
|
||||
.tox/
|
||||
.venv/
|
||||
.vscode/
|
||||
.vscode-test/
|
||||
@@ -1,63 +0,0 @@
|
||||
# ComfyUI Logic Nodes Extension
|
||||
|
||||
This repository contains an extension to [ComfyUI](https://github.com/comfyanonymous/ComfyUI) that introduces logic nodes and conditional rendering capabilities:
|
||||
- If
|
||||
- Compare
|
||||
- Int, String, Float, Bool
|
||||
|
||||

|
||||
> **_NOTE:_** This extension is still in development and may contain bugs. Please report any issues you encounter. New features are in development!
|
||||
|
||||
|
||||
## Installation
|
||||
- Clone this repository into the `custom_nodes` folder of ComfyUI. Restart ComfyUI and the extension should be loaded.
|
||||
|
||||
## Features
|
||||
|
||||
- **Comparison Nodes**: Compare two values using various comparison operators.
|
||||
- **Data Type Nodes**: Convert and handle `Int`, `String`, `Float` and `Bool` data types.
|
||||
- **Conditional Execution**: Execute different nodes based on a boolean condition.
|
||||
- **Debugging**: Print any input to the console for debugging purposes.
|
||||
|
||||
## Nodes
|
||||
|
||||
### Compare
|
||||
|
||||
Compares two inputs (`a` and `b`) based on the provided comparison operator. Supported operators include:
|
||||
|
||||
- `a == b`
|
||||
- `a != b`
|
||||
- `a < b`
|
||||
- `a > b`
|
||||
- `a <= b`
|
||||
- `a >= b`
|
||||
|
||||
### Int
|
||||
|
||||
Accepts an integer value and returns it.
|
||||
|
||||
### String
|
||||
|
||||
Accepts a string value and returns it.
|
||||
|
||||
### Float
|
||||
|
||||
Accepts a float value and returns it.
|
||||
|
||||
### Bool
|
||||
|
||||
Accepts a boolean value and returns it.
|
||||
|
||||
### If
|
||||
|
||||
Executes the `IF_TRUE` node if the `ANY` input is `True`, otherwise it executes the `IF_FALSE` node.
|
||||
|
||||
### DebugPrint
|
||||
|
||||
Prints the provided input to the console. Useful for debugging.
|
||||
|
||||
|
||||
## Author
|
||||
- David Fischer
|
||||
- GitHub: [theUpsider](https://github.com/theUpsider)
|
||||
- Support me on [BuyMeACoffee](https://www.buymeacoffee.com/theupsider)
|
||||
@@ -1 +0,0 @@
|
||||
from .nodes import *
|
||||
BIN
Binary file not shown.
Binary file not shown.
@@ -1,213 +0,0 @@
|
||||
COMPARE_FUNCTIONS = {
|
||||
"a == b": lambda a, b: a == b,
|
||||
"a != b": lambda a, b: a != b,
|
||||
"a < b": lambda a, b: a < b,
|
||||
"a > b": lambda a, b: a > b,
|
||||
"a <= b": lambda a, b: a <= b,
|
||||
"a >= b": lambda a, b: a >= b,
|
||||
}
|
||||
|
||||
|
||||
class AlwaysEqualProxy(str):
|
||||
def __eq__(self, _):
|
||||
return True
|
||||
|
||||
def __ne__(self, _):
|
||||
return False
|
||||
|
||||
|
||||
class String:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {"value": ("STRING", {"default": ""})},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
|
||||
RETURN_NAMES = ("STRING",)
|
||||
|
||||
FUNCTION = "execute"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def execute(self, value):
|
||||
return (value,)
|
||||
|
||||
|
||||
class Int:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {"value": ("INT", {"default": 0})},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("INT",)
|
||||
|
||||
RETURN_NAMES = ("INT",)
|
||||
|
||||
FUNCTION = "execute"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def execute(self, value):
|
||||
return (value,)
|
||||
|
||||
|
||||
class Float:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {"value": ("FLOAT", {"default": 0, "step": 0.01})},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("FLOAT",)
|
||||
|
||||
RETURN_NAMES = ("FLOAT",)
|
||||
|
||||
FUNCTION = "execute"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def execute(self, value):
|
||||
return (value,)
|
||||
|
||||
|
||||
class Bool:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {"value": ("BOOLEAN", {"default": False})},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("BOOLEAN",)
|
||||
|
||||
RETURN_NAMES = ("BOOLEAN",)
|
||||
|
||||
FUNCTION = "execute"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def execute(self, value):
|
||||
return (value,)
|
||||
|
||||
|
||||
class Compare:
|
||||
"""
|
||||
This nodes compares the two inputs and outputs the result of the comparison.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
"""
|
||||
Comparison node takes two inputs, a and b, and compares them.
|
||||
"""
|
||||
s.compare_functions = list(COMPARE_FUNCTIONS.keys())
|
||||
return {
|
||||
"required": {
|
||||
"a": (AlwaysEqualProxy("*"), {"default": 0}),
|
||||
"b": (AlwaysEqualProxy("*"), {"default": 0}),
|
||||
"comparison": (s.compare_functions, {"default": "a == b"}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("BOOLEAN",)
|
||||
|
||||
RETURN_NAMES = "BOOLEAN"
|
||||
|
||||
FUNCTION = "compare"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def compare(self, a, b, comparison):
|
||||
"""
|
||||
Compare two inputs and return the result of the comparison.
|
||||
|
||||
Args:
|
||||
a (UNKNOWN): The first input.
|
||||
b (UNKNOWN): The second input.
|
||||
comparison (STRING): The comparison to perform. Can be one of "==", "!=", "<", ">", "<=", ">=".
|
||||
|
||||
Returns:
|
||||
: The result of the comparison.
|
||||
"""
|
||||
return (COMPARE_FUNCTIONS[comparison](a, b),)
|
||||
|
||||
|
||||
class IfExecute:
|
||||
"""
|
||||
This node executes IF_TRUE if ANY is True, otherwise it executes IF_FALSE.
|
||||
|
||||
ANY can be any input, IF_TRUE and IF_FALSE can be any output.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {
|
||||
"ANY": (AlwaysEqualProxy("*"),),
|
||||
"IF_TRUE": (AlwaysEqualProxy("*"),),
|
||||
"IF_FALSE": (AlwaysEqualProxy("*"),),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = (AlwaysEqualProxy("*"),)
|
||||
|
||||
RETURN_NAMES = "?"
|
||||
|
||||
FUNCTION = "return_based_on_bool"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def return_based_on_bool(self, ANY, IF_TRUE, IF_FALSE):
|
||||
return (IF_TRUE if ANY else IF_FALSE,)
|
||||
|
||||
|
||||
class DebugPrint:
|
||||
"""
|
||||
This node prints the input to the console.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
"""
|
||||
Takes in any input.
|
||||
|
||||
"""
|
||||
return {"required": {"ANY": (AlwaysEqualProxy({}),)}}
|
||||
|
||||
RETURN_TYPES = ()
|
||||
|
||||
OUTPUT_NODE = True
|
||||
|
||||
FUNCTION = "log_input"
|
||||
|
||||
CATEGORY = "Logic"
|
||||
|
||||
def log_input(self, ANY):
|
||||
print(ANY)
|
||||
return {}
|
||||
|
||||
|
||||
# A dictionary that contains all nodes you want to export with their names
|
||||
# NOTE: names should be globally unique
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"Compare": Compare,
|
||||
"Int": Int,
|
||||
"Float": Float,
|
||||
"Bool": Bool,
|
||||
"String": String,
|
||||
"If ANY execute A else B": IfExecute,
|
||||
"DebugPrint": DebugPrint,
|
||||
}
|
||||
|
||||
# A dictionary that contains the friendly/humanly readable titles for the nodes
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"Compare": "Compare",
|
||||
"Int": "Int",
|
||||
"Float": "Float",
|
||||
"Bool": "Bool",
|
||||
"String": "String",
|
||||
"If ANY execute A else B": "If",
|
||||
"DebugPrint": "DebugPrint",
|
||||
}
|
||||
Reference in New Issue
Block a user