A python library for setup comfyui custom nodes for developers in development
Project description
yors_comfyui_node_setup
🤖 A python library for setup comfyui custom nodes for developers in development.
to setup comfyui custom nodes for developers in development:
- install requriements automatically for nodes
- entry - export comfyui node vars automatically
1 - install python package
pip install yors_comfyui_node_setup
# yors_comfyui_node_util
2 - use it in your python code
-
in some comfyui custom nodes project or module
-
code in
__init__.py
#
# from ...utils import entry,node_install_requirements # local
from yors_comfyui_node_setup import entry,node_install_requirements # global
# install requirements
node_install_requirements(__file__)
# export comfyui node vars
__all__,NODE_CLASS_MAPPINGS,NODE_DISPLAY_NAME_MAPPINGS,NODE_MENU_NAMES = entry(__name__,__file__)
#
3 - code yours nodes
- dirs map of your node may be:
.
└─__init__.py
└─nodes.py
- in any py file (no test in
__init__.py
) - code nodes.py
class AnyType(str):
"""A special class that is always equal in not equal comparisons. Credit to pythongosssss"""
def __ne__(self, __value: object) -> bool:
return False
any_type = AnyType("*")
CURRENT_CATEGORY="YMC/LINK" # set the right mouse button menu (custom for your comfyui nodes)
CURRENT_FUNCTION="exec"
class NodeSetItAsImage:
@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 = ("IMAGE",)
RETURN_NAMES = ("image",)
FUNCTION = CURRENT_FUNCTION
CATEGORY = CURRENT_CATEGORY
# set NODE_NAME and NODE_DESC for yors_comfyui_node_setup
NODE_NAME = "as image"
NODE_DESC = "set it as image type"
# OUTPUT_NODE = True
# OUTPUT_IS_LIST = (True,)
def exec(self, a=None):
return (a,)
Author
ymc-github ymc.github@gmail.com
License
MIT
Project details
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
Close
Hashes for yors_comfyui_node_setup-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41c1a1f0cee39668454c65a65aa3b8a6121d5e8b116c2584607bad085274d0bd |
|
MD5 | 97566f4357cbf17328e952baac0bc2a9 |
|
BLAKE2b-256 | 07d9412887688d21ed4947d5b33a157985725d64d0771b442007ac7e60fafdc9 |
Close
Hashes for yors_comfyui_node_setup-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd27f17211e23c7b583a12c8598c4dda113a48571a67d0f00eaebf2bdf2d7e20 |
|
MD5 | e5c5dd0bdcd74d071761a92a47594cb4 |
|
BLAKE2b-256 | 228c22f6da1a89d4d257c64396063eb7006adc556592f6f493107fa68caedf66 |