skip filenames starting with . for img2img and extras batch modes
This commit is contained in:
parent
cf8da8e1b0
commit
a1e5e0d766
|
@ -72,7 +72,7 @@ def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_
|
||||||
|
|
||||||
if input_dir == '':
|
if input_dir == '':
|
||||||
return outputs, "Please select an input directory.", ''
|
return outputs, "Please select an input directory.", ''
|
||||||
image_list = [file for file in [os.path.join(input_dir, x) for x in sorted(os.listdir(input_dir))] if os.path.isfile(file)]
|
image_list = shared.listfiles(input_dir)
|
||||||
for img in image_list:
|
for img in image_list:
|
||||||
try:
|
try:
|
||||||
image = Image.open(img)
|
image = Image.open(img)
|
||||||
|
|
|
@ -19,7 +19,7 @@ import modules.scripts
|
||||||
def process_batch(p, input_dir, output_dir, args):
|
def process_batch(p, input_dir, output_dir, args):
|
||||||
processing.fix_seed(p)
|
processing.fix_seed(p)
|
||||||
|
|
||||||
images = [file for file in [os.path.join(input_dir, x) for x in os.listdir(input_dir)] if os.path.isfile(file)]
|
images = shared.listfiles(input_dir)
|
||||||
|
|
||||||
print(f"Will process {len(images)} images, creating {p.n_iter * p.batch_size} new images for each.")
|
print(f"Will process {len(images)} images, creating {p.n_iter * p.batch_size} new images for each.")
|
||||||
|
|
||||||
|
|
|
@ -450,3 +450,8 @@ total_tqdm = TotalTQDM()
|
||||||
|
|
||||||
mem_mon = modules.memmon.MemUsageMonitor("MemMon", device, opts)
|
mem_mon = modules.memmon.MemUsageMonitor("MemMon", device, opts)
|
||||||
mem_mon.start()
|
mem_mon.start()
|
||||||
|
|
||||||
|
|
||||||
|
def listfiles(dirname):
|
||||||
|
filenames = [os.path.join(dirname, x) for x in sorted(os.listdir(dirname)) if not x.startswith(".")]
|
||||||
|
return [file for file in filenames if os.path.isfile(file)]
|
||||||
|
|
Loading…
Reference in New Issue