Skip to content

Commit

Permalink
fix input default signature for strings so it works in new comfy
Browse files Browse the repository at this point in the history
  • Loading branch information
nickve28 committed Aug 17, 2024
1 parent 2a03cdc commit 3b58ec5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import re
import random
from PIL import Image
from operator import attrgetter

from .utils.file_utils import filename_without_extension, list_images
from .utils.tensor_utils import pil_to_tens
Expand All @@ -23,7 +22,7 @@ def INPUT_TYPES(cls):
return {
"required": {
"input": ("STRING", {}),
"regexp_filter": ("STRING", { "default": None, "multiline": True }),
"regexp_filter": ("STRING", { "default": "", "multiline": True }),
"delimiter": ("STRING", { "default": " ", "multiline": False })
}
}
Expand Down Expand Up @@ -57,7 +56,7 @@ def INPUT_TYPES(cls):
"include_subdirectories": ("BOOLEAN", { "default": False }),
},
"optional": {
"regexp_filter": ("STRING", { "default": None, "multiline": True })
"regexp_filter": ("STRING", { "default": "", "multiline": True })
},
"hidden": {"unique_id": "UNIQUE_ID"}
}
Expand Down Expand Up @@ -90,7 +89,7 @@ def sample_images(self, *_args, **kwargs):
regexp_filter = kwargs['regexp_filter']
include_subdirectories = kwargs['include_subdirectories']
unique_id = kwargs['unique_id']

# todo, this image logic is a bit underestimated
# make an ImageSelector class which should be comfy independent and easily testable too
full_path = os.path.expanduser(directory)
Expand Down
1 change: 0 additions & 1 deletion utils/tensor_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import numpy as np
from torch import Tensor
import torch
from torchvision.transforms import ToTensor
from PIL import Image

"""
Expand Down

0 comments on commit 3b58ec5

Please sign in to comment.