1 Star 0 Fork 0

RTools/ComfyUI_LayerStyle

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
water_color.py 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
chflame 提交于 2024-03-24 22:05 +08:00 . remove attribute OUTPUT_NODE of all nodes
from .imagefunc import *
NODE_NAME = 'WaterColor'
class WaterColor:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(self):
return {
"required": {
"image": ("IMAGE", ),
"line_density": ("INT", {"default": 50, "min": 1, "max": 100, "step": 1}), # 透明度
"opacity": ("INT", {"default": 100, "min": 0, "max": 100, "step": 1}), # 透明度
},
"optional": {
}
}
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("image",)
FUNCTION = 'water_color'
CATEGORY = '😺dzNodes/LayerFilter'
def water_color(self, image, line_density, opacity
):
ret_images = []
for i in image:
i = torch.unsqueeze(i, 0)
_canvas = tensor2pil(i).convert('RGB')
_image = image_watercolor(_canvas, level=101-line_density)
ret_image = chop_image(_canvas, _image, 'normal', opacity)
ret_images.append(pil2tensor(ret_image))
log(f"{NODE_NAME} Processed {len(ret_images)} image(s).", message_type='finish')
return (torch.cat(ret_images, dim=0),)
NODE_CLASS_MAPPINGS = {
"LayerFilter: WaterColor": WaterColor
}
NODE_DISPLAY_NAME_MAPPINGS = {
"LayerFilter: WaterColor": "LayerFilter: WaterColor"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huatool/ComfyUI_LayerStyle.git
git@gitee.com:huatool/ComfyUI_LayerStyle.git
huatool
ComfyUI_LayerStyle
ComfyUI_LayerStyle
main

搜索帮助