1 Star 0 Fork 15

雪狐/ComfyUI_Lam_1

forked from yanlang0123/ComfyUI_Lam 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
AspectRatio.py 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
马噥 提交于 2023-11-28 17:29 +08:00 . 新增风格选择工具,删除多余文件
class AspectRatio:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"aspect_ratio": (['704×1408 ∣ 1:2','704×1344 ∣ 11:21','768×1344 ∣ 4:7','768×1280 ∣ 3:5'
,'832×1216 ∣ 13:19','832×1152 ∣ 13:18','896×1152 ∣ 7:9','896×1088 ∣ 14:17'
,'960×1088 ∣ 15:17','960×1024 ∣ 15:16','1024×1024 ∣ 1:1','1024×960 ∣ 16:15'
,'1088×960 ∣ 17:15','1088×896 ∣ 17:14','1152×896 ∣ 9:7','1152×832 ∣ 18:13'
,'1216×832 ∣ 19:13','1280×768 ∣ 5:3','1344×768 ∣ 7:4','1344×704 ∣ 21:11'
,'1408×704 ∣ 2:1','1472×704 ∣ 23:11','1536×640 ∣ 12:5','1600×640 ∣ 5:2'
,'1664×576 ∣ 26:9','1728×576 ∣ 3:1'], {"default": "1152×896 ∣ 9:7"}),
"width": ("INT", {"default": 0, "min": 0, "max": 99999}),
"height": ("INT", {"default": 0, "min": 0, "max": 99999}),
}
}
RETURN_TYPES = ("INT","INT",)
RETURN_NAMES = ("宽","高",)
FUNCTION = "aspect_ratio"
CATEGORY = "lam"
def aspect_ratio(self,aspect_ratio,width,height):
#判断不为自定义,提前宽高
if width==0 and height==0:
aspect_ratio = aspect_ratio.split("∣")
width = int(aspect_ratio[0].split("×")[0])
height = int(aspect_ratio[0].split("×")[1])
return (width,height,)
NODE_CLASS_MAPPINGS = {
"AspectRatio": AspectRatio
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"AspectRatio": "宽高比"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/assassindesign/ComfyUI_Lam_1.git
git@gitee.com:assassindesign/ComfyUI_Lam_1.git
assassindesign
ComfyUI_Lam_1
ComfyUI_Lam_1
cu121

搜索帮助