diff --git a/README.md b/README.md new file mode 100644 index 0000000..432d7df --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# ComfyUI OOTDiffusion + +A ComfyUI custom node that simply integrates the OOTDiffusion functionality. + +一个简单接入 OOTDiffusion 的 ComfyUI 节点。 + +## Instruction 指南 + +根据 https://git-lfs.com 安装 git lfs: + +```txt +sudo apt install git-lfs +git lfs install +``` + +拉取 Huggingface 库至 `models/OOTDiffusion` 目录: + +```txt +git clone https://huggingface.co/levihsu/OOTDiffusion models/OOTDiffusion +``` + +启动 ComfyUI 即可。 + +## 节点 + +LoadOOTDPipeline: 加载 OOTD Pipeline + +OOTDGenerate: 生成图像 diff --git a/humanparsing/parsing_api.py b/humanparsing/parsing_api.py index 9ddecff..0eeccac 100644 --- a/humanparsing/parsing_api.py +++ b/humanparsing/parsing_api.py @@ -124,7 +124,8 @@ def load_atr_model(): label = ['Background', 'Hat', 'Hair', 'Sunglasses', 'Upper-clothes', 'Skirt', 'Pants', 'Dress', 'Belt', 'Left-shoe', 'Right-shoe', 'Face', 'Left-leg', 'Right-leg', 'Left-arm', 'Right-arm', 'Bag', 'Scarf'] model = networks.init_model('resnet101', num_classes=num_classes, pretrained=None) - state_dict = torch.load('models/humanparsing/exp-schp-201908301523-atr.pth')['state_dict'] + #! annotated config + state_dict = torch.load('models/OOTDiffusion/checkpoints/humanparsing/exp-schp-201908301523-atr.pth')['state_dict'] new_state_dict = OrderedDict() for k, v in state_dict.items(): name = k[7:] # remove `module.` @@ -142,7 +143,8 @@ def load_lip_model(): 'Socks', 'Pants', 'Jumpsuits', 'Scarf', 'Skirt', 'Face', 'Left-arm', 'Right-arm', 'Left-leg', 'Right-leg', 'Left-shoe', 'Right-shoe'] model = networks.init_model('resnet101', num_classes=num_classes, pretrained=None) - state_dict = torch.load('models/humanparsing/exp-schp-201908261155-lip.pth')['state_dict'] + #! annotated config + state_dict = torch.load('models/OOTDiffusion/checkpoints/humanparsing/exp-schp-201908261155-lip.pth')['state_dict'] new_state_dict = OrderedDict() for k, v in state_dict.items(): name = k[7:] # remove `module.`