add node's description, node ListUnWrapper and some workflows
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
| ImageEqual | 图片是否相等(可用于通过判断遮罩图是否全黑来判定是否有遮罩) |
|
||||
| SDBaseVerNumber | 判断SD大模型版本是1.5还是xl |
|
||||
| ListWrapper | 包装成列表(任意类型) |
|
||||
| ListUnWrapper | 转成输出列表,后面连接的节点会把每个元素执行一遍,实现类似遍历效果 |
|
||||
| BboxToCropData | bbox转cropData,方便接入was节点使用 |
|
||||
| BboxToBbox | bbox两种格式(x,y,w,h)和(x1,y1,x2,y2)的相互转换 |
|
||||
| BboxesToBboxes | BboxToBbox节点的列表版本 |
|
||||
@@ -56,11 +57,18 @@
|
||||
|
||||
Tips: base64格式字符串比较长,会导致界面卡顿,接口请求带宽可能也会有瓶颈,条件允许可以把图片上传到OSS服务器得到URL,然后用LoadImageFromUrl加载,由于无相关OSS账号,上传OSS节点需自行编写,暂不支持。
|
||||
|
||||
### [示例](example/example.png)
|
||||
### 示例
|
||||

|
||||
### [工作流](example/example.png)
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## 更新记录
|
||||
### 2024-09-19
|
||||
- 添加ListUnWrapper节点
|
||||
|
||||
### 2024-09-04
|
||||
- 添加一些bbox相关节点
|
||||
|
||||
@@ -100,7 +108,8 @@ Tips: base64格式字符串比较长,会导致界面卡顿,接口请求带
|
||||
- 使用镜像地址(模型自动下载问题)
|
||||
- 配置路径:Settings -> [EasyApi] Huggingface Mirror
|
||||
- 配置路径:Settings -> [EasyApi] RawGithub Mirror
|
||||
|
||||
- 配置路径:Settings -> [EasyApi] Github Mirror
|
||||

|
||||
|
||||
- 菜单扩展
|
||||
- 重设某个节点的id(Node Context Menu)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -234,6 +234,7 @@ class CropImageByBbox:
|
||||
RETURN_NAMES = ("crop_image", "mask", "crop_bbox")
|
||||
FUNCTION = "crop"
|
||||
CATEGORY = "EasyApi/Bbox"
|
||||
DESCRIPTION = "根据bbox区域裁剪图片。 bbox的格式是左上角和右下角坐标: [x,y,x1,y1]"
|
||||
|
||||
def crop(self, image: torch.Tensor, bbox, margin):
|
||||
x, y, x1, y1 = bbox
|
||||
|
||||
@@ -40,6 +40,7 @@ class InsightFaceBBOXDetect:
|
||||
|
||||
# INPUT_IS_LIST = False
|
||||
# OUTPUT_IS_LIST = (False, False)
|
||||
DESCRIPTION = "检测图片中的人脸,bbox是一个包含所有人脸的json字符串,格式是每个人脸区域的左上角和右下角角坐标: [[x1_1,y1_1,x1_2,y1_2],[x2_1,y2_1,x2_2,y2_2],...]"
|
||||
|
||||
def detect(self, image, shape, shape_color, show_num, num_color='#FF0000', num_pos=None, num_sort=None,
|
||||
INSIGHTFACE=None):
|
||||
|
||||
@@ -395,6 +395,30 @@ class ListWrapper:
|
||||
return ([any_1, any_2],)
|
||||
|
||||
|
||||
class ListUnWrapper:
|
||||
@classmethod
|
||||
def INPUT_TYPES(self):
|
||||
return {"required": {
|
||||
"lst": (any_type, {}),
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = (any_type,)
|
||||
# RETURN_NAMES = ("STRING", )
|
||||
|
||||
FUNCTION = "unwrapper"
|
||||
|
||||
OUTPUT_NODE = False
|
||||
CATEGORY = "EasyApi/List"
|
||||
|
||||
# INPUT_IS_LIST = False
|
||||
OUTPUT_IS_LIST = (True, False)
|
||||
DESCRIPTION = "输出的是一个个的元素,相当于执行多次后面连接的那个节点,配合ListWrapper可以实现预览不同尺寸的图像"
|
||||
|
||||
def unwrapper(self, lst):
|
||||
return (lst,)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"GetImageBatchSize": GetImageBatchSize,
|
||||
"JoinList": JoinList,
|
||||
@@ -411,6 +435,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"ImageEqual": ImageEqual,
|
||||
"SDBaseVerNumber": SDBaseVerNumber,
|
||||
"ListWrapper": ListWrapper,
|
||||
"ListUnWrapper": ListUnWrapper,
|
||||
}
|
||||
|
||||
# A dictionary that contains the friendly/humanly readable titles for the nodes
|
||||
@@ -430,4 +455,5 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"ImageEqual": "Image Equal Judgment",
|
||||
"SDBaseVerNumber": "SD Base Version Number",
|
||||
"ListWrapper": "ListWrapper",
|
||||
"ListUnWrapper": "ListUnWrapper",
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 290 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 425 KiB |
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-easyapi-nodes"
|
||||
description = "Provides some features and nodes related to API calls."
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
license = { file = "LICENSE" }
|
||||
dependencies = ["segment_anything", "simple_lama_inpainting", "insightface"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user