mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-01 20:35:06 +08:00
fix import filetype
This commit is contained in:
parent
e86c2a4b4d
commit
de16e85d10
@ -1,6 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import filetype
|
|
||||||
|
|
||||||
from modules import shared
|
from modules import shared
|
||||||
from modules.paths_internal import script_path, cwd
|
from modules.paths_internal import script_path, cwd
|
||||||
@ -54,6 +53,7 @@ def walk_files(path, allowed_extensions=None, allowed_mime=None):
|
|||||||
file_allowed = True
|
file_allowed = True
|
||||||
|
|
||||||
if allowed_mime is not None:
|
if allowed_mime is not None:
|
||||||
|
import filetype
|
||||||
if filetype.guess(filepath).mime.startswith(allowed_mime):
|
if filetype.guess(filepath).mime.startswith(allowed_mime):
|
||||||
file_allowed = True
|
file_allowed = True
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user