保存图片自定义节点
This commit is contained in:
parent
854c1b6cdc
commit
876521c9cc
|
|
@ -4,6 +4,7 @@ from PIL import Image
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
|
||||||
class SaveImagePath:
|
class SaveImagePath:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
|
|
@ -49,7 +50,9 @@ class SaveImagePath:
|
||||||
|
|
||||||
pil_image = Image.fromarray(image_path)
|
pil_image = Image.fromarray(image_path)
|
||||||
|
|
||||||
output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "output")
|
# output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "output")
|
||||||
|
# base_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
output_dir = 'root/comfy/ComfyUI/output'
|
||||||
if not os.path.exists(output_dir):
|
if not os.path.exists(output_dir):
|
||||||
os.makedirs(output_dir)
|
os.makedirs(output_dir)
|
||||||
|
|
||||||
|
|
@ -59,10 +62,11 @@ class SaveImagePath:
|
||||||
|
|
||||||
return (p,)
|
return (p,)
|
||||||
|
|
||||||
|
|
||||||
# 节点类定义结束,以下是用于注册节点的字典结构(通常在实际使用中由ComfyUI等框架来解析和注册)
|
# 节点类定义结束,以下是用于注册节点的字典结构(通常在实际使用中由ComfyUI等框架来解析和注册)
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"SaveImagePath": SaveImagePath
|
"SaveImagePath": SaveImagePath
|
||||||
}
|
}
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
"SaveImagePath": "保存图片路径"
|
"SaveImagePath": "保存图片路径"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue