A python library to set comfyui custom nodes action easily for developers in development
Project description
yors_pano_action_handle
🤖 A python library to set comfyui custom nodes action easily for developers in development.
to set comfyui custom nodes action for developers in development:
- set action for some filed in node input easily
- detect if node is enbale easily
Why
- set your comfyui nodes action easily.
- share commom code in each node.
1 - install python package
pip install yors_pano_action_handle
2 - use it in your python code
-
in some comfyui custom nodes project or module
-
code in your
node_xx.py
from yors_pano_action_handle import node_action_values,action_is_enable,any_type
CURRENT_CATEGORY="ymc/link"
CURRENT_FUNCTION="exec"
# feat(core): node to set it as any type
class NodeSetItAsAny:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
},
"optional":{
"a": (any_type)
},
# "hidden": {
# "unique_id": "UNIQUE_ID",
# "extra_pnginfo": "EXTRA_PNGINFO",
# },
}
# INPUT_IS_LIST = True
RETURN_TYPES = (any_type,)
RETURN_NAMES = ("a")
FUNCTION = CURRENT_FUNCTION
CATEGORY = CURRENT_CATEGORY
NODE_NAME = "as any"
NODE_DESC = "set it as any type"
# OUTPUT_NODE = True
# OUTPUT_IS_LIST = (True,)
def exec(s, **kwargs):
# load config from dict with name cnf
a = kwargs.get("a")
return (a,)
class NodeTextUpper:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
},
"optional":{
"text": ("STRING", {"default": ""}),
"cmd_action": node_action_values,
},
# "hidden": {
# "unique_id": "UNIQUE_ID",
# "extra_pnginfo": "EXTRA_PNGINFO",
# },
}
# INPUT_IS_LIST = True
RETURN_TYPES = ("STRING","BOOL")
RETURN_NAMES = ("text","status")
FUNCTION = CURRENT_FUNCTION
CATEGORY = CURRENT_CATEGORY
NODE_NAME = "upper case"
NODE_DESC = "transform text to upper case"
# OUTPUT_NODE = True
# OUTPUT_IS_LIST = (True,)
def exec(s, **kwargs):
# load config from dict with name cnf
text = kwargs.get("text")
cmd_action = kwargs.get("cmd_action")
if action_is_enable(cmd_action) == False or cmd in ["",None]:
return (text.upper(), False)
return (text,True)
the dirs of your comfyui nodes repo
.
│ .gitignore
│ LICENSE
│ nodes.py
│ requirements.txt
│ __init__.py
└─link # some nodes to link nodes
__init__.py
xx.py
...
└─utils # some nodes for util process
__init__.py
xx.py
...
└─image # some nodes for image process
__init__.py
xx.py
...
Author
ymc-github ymc.github@gmail.com
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yors_pano_action_handle-0.1.0.tar.gz.
File metadata
- Download URL: yors_pano_action_handle-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.6 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3388f0e255aecd2c9df2412918e06de9dc4092b25358f93b165943a0e1a12dc6
|
|
| MD5 |
ed36f75916f79c0db6cb0524dce39d9c
|
|
| BLAKE2b-256 |
371286462ac33359904322fcb55463c02e7c316341c95c5d450a2b9e8b870f9c
|
File details
Details for the file yors_pano_action_handle-0.1.0-py3-none-any.whl.
File metadata
- Download URL: yors_pano_action_handle-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.6 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eea9aee2099d7e7b0bdef87ecdc90bee4b82a90ffcd6e2ed2344595124dcefc
|
|
| MD5 |
0cb0f51108459d14bc0ae6e736f94bfb
|
|
| BLAKE2b-256 |
aa280357110b4845e8bfc50f5d4bcc86f68ef42031dfaf42cef10e3f8111ac59
|