Skip to content

Commit 49174ff

Browse files
authored
Merge pull request #3 from christian-byrne/main
Change paths to work on linux/mac
2 parents 4e274eb + dc0a1c2 commit 49174ff

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

FastStyleTransferNode.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
class VGG16(nn.Module):
21-
def __init__(self, vgg_path=os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\vgg\\vgg16-00b39a1b.pth"), train=False):
21+
def __init__(self, vgg_path=os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/vgg/vgg16-00b39a1b.pth"), train=False):
2222
super(VGG16, self).__init__()
2323
# Load VGG Skeleton, Pretrained Weights
2424
vgg16_features = models.vgg16(pretrained=False)
@@ -181,12 +181,12 @@ def INPUT_TYPES(s):
181181

182182

183183
def train(self, style_img, seed, batch_size, train_img_size, learning_rate, num_epochs, content_weight, style_weight, save_model_every):
184-
save_model_path = os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\models\\")
185-
dataset_path = os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\dataset\\")
186-
vgg_path = os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\vgg\\vgg16-00b39a1b.pth")
187-
save_image_path = os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\output\\")
184+
save_model_path = os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/models/")
185+
dataset_path = os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/dataset/")
186+
vgg_path = os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/vgg/vgg16-00b39a1b.pth")
187+
save_image_path = os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/output/")
188188
style_image_path = folder_paths.get_annotated_filepath(style_img)
189-
train_path = os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\train.py")
189+
train_path = os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/train.py")
190190

191191

192192
command = [
@@ -222,7 +222,7 @@ def INPUT_TYPES(s):
222222
return {
223223
"required": {
224224
"content_img": ("IMAGE",),
225-
"model": ([file for file in os.listdir(os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\models\\")) if file.endswith('.pth')], ),
225+
"model": ([file for file in os.listdir(os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/models/")) if file.endswith('.pth')], ),
226226
},
227227
}
228228

@@ -248,7 +248,7 @@ def styleTransfer(self, content_img, model):
248248

249249
# Load Transformer Network
250250
net = TransformerNetwork().to(device)
251-
model_path = os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-Fast-Style-Transfer\\models\\") + model
251+
model_path = os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-Fast-Style-Transfer/models/") + model
252252
net.load_state_dict(torch.load(model_path, map_location=device))
253253
net = net.to(device)
254254

0 commit comments

Comments
 (0)