mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-05 03:32:37 +00:00
Textual Inversion: Preprocess and Training will only pick-up image files
This commit is contained in:
@@ -12,12 +12,13 @@ def preprocess(process_src, process_dst, process_width, process_height, process_
|
||||
height = process_height
|
||||
src = os.path.abspath(process_src)
|
||||
dst = os.path.abspath(process_dst)
|
||||
extns = [".jpg",".jpeg",".png"]
|
||||
|
||||
assert src != dst, 'same directory specified as source and destination'
|
||||
|
||||
os.makedirs(dst, exist_ok=True)
|
||||
|
||||
files = os.listdir(src)
|
||||
files = [i for i in os.listdir(src) if os.path.splitext(i.casefold())[1] in extns]
|
||||
|
||||
shared.state.textinfo = "Preprocessing..."
|
||||
shared.state.job_count = len(files)
|
||||
|
Reference in New Issue
Block a user