Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
a9e7a3db
Commit
a9e7a3db
authored
Jun 27, 2023
by
AUTOMATIC1111
Committed by
GitHub
Jun 27, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11199 from akx/makedirs
Use os.makedirs(..., exist_ok=True)
parents
001cbd36
165ab44f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
15 deletions
+6
-15
modules/codeformer_model.py
modules/codeformer_model.py
+1
-3
modules/extensions.py
modules/extensions.py
+1
-2
modules/gfpgan_model.py
modules/gfpgan_model.py
+1
-4
modules/modelloader.py
modules/modelloader.py
+1
-2
modules/sd_models.py
modules/sd_models.py
+1
-2
modules/textual_inversion/autocrop.py
modules/textual_inversion/autocrop.py
+1
-2
No files found.
modules/codeformer_model.py
View file @
a9e7a3db
...
@@ -20,9 +20,7 @@ codeformer = None
...
@@ -20,9 +20,7 @@ codeformer = None
def
setup_model
(
dirname
):
def
setup_model
(
dirname
):
global
model_path
os
.
makedirs
(
model_path
,
exist_ok
=
True
)
if
not
os
.
path
.
exists
(
model_path
):
os
.
makedirs
(
model_path
)
path
=
modules
.
paths
.
paths
.
get
(
"CodeFormer"
,
None
)
path
=
modules
.
paths
.
paths
.
get
(
"CodeFormer"
,
None
)
if
path
is
None
:
if
path
is
None
:
...
...
modules/extensions.py
View file @
a9e7a3db
...
@@ -7,8 +7,7 @@ from modules.paths_internal import extensions_dir, extensions_builtin_dir, scrip
...
@@ -7,8 +7,7 @@ from modules.paths_internal import extensions_dir, extensions_builtin_dir, scrip
extensions
=
[]
extensions
=
[]
if
not
os
.
path
.
exists
(
extensions_dir
):
os
.
makedirs
(
extensions_dir
,
exist_ok
=
True
)
os
.
makedirs
(
extensions_dir
)
def
active
():
def
active
():
...
...
modules/gfpgan_model.py
View file @
a9e7a3db
...
@@ -70,11 +70,8 @@ gfpgan_constructor = None
...
@@ -70,11 +70,8 @@ gfpgan_constructor = None
def
setup_model
(
dirname
):
def
setup_model
(
dirname
):
global
model_path
if
not
os
.
path
.
exists
(
model_path
):
os
.
makedirs
(
model_path
)
try
:
try
:
os
.
makedirs
(
model_path
,
exist_ok
=
True
)
from
gfpgan
import
GFPGANer
from
gfpgan
import
GFPGANer
from
facexlib
import
detection
,
parsing
# noqa: F401
from
facexlib
import
detection
,
parsing
# noqa: F401
global
user_path
global
user_path
...
...
modules/modelloader.py
View file @
a9e7a3db
...
@@ -95,8 +95,7 @@ def cleanup_models():
...
@@ -95,8 +95,7 @@ def cleanup_models():
def
move_files
(
src_path
:
str
,
dest_path
:
str
,
ext_filter
:
str
=
None
):
def
move_files
(
src_path
:
str
,
dest_path
:
str
,
ext_filter
:
str
=
None
):
try
:
try
:
if
not
os
.
path
.
exists
(
dest_path
):
os
.
makedirs
(
dest_path
,
exist_ok
=
True
)
os
.
makedirs
(
dest_path
)
if
os
.
path
.
exists
(
src_path
):
if
os
.
path
.
exists
(
src_path
):
for
file
in
os
.
listdir
(
src_path
):
for
file
in
os
.
listdir
(
src_path
):
fullpath
=
os
.
path
.
join
(
src_path
,
file
)
fullpath
=
os
.
path
.
join
(
src_path
,
file
)
...
...
modules/sd_models.py
View file @
a9e7a3db
...
@@ -95,8 +95,7 @@ except Exception:
...
@@ -95,8 +95,7 @@ except Exception:
def
setup_model
():
def
setup_model
():
if
not
os
.
path
.
exists
(
model_path
):
os
.
makedirs
(
model_path
,
exist_ok
=
True
)
os
.
makedirs
(
model_path
)
enable_midas_autodownload
()
enable_midas_autodownload
()
...
...
modules/textual_inversion/autocrop.py
View file @
a9e7a3db
...
@@ -298,8 +298,7 @@ def download_and_cache_models(dirname):
...
@@ -298,8 +298,7 @@ def download_and_cache_models(dirname):
download_url
=
'https://github.com/opencv/opencv_zoo/blob/91fb0290f50896f38a0ab1e558b74b16bc009428/models/face_detection_yunet/face_detection_yunet_2022mar.onnx?raw=true'
download_url
=
'https://github.com/opencv/opencv_zoo/blob/91fb0290f50896f38a0ab1e558b74b16bc009428/models/face_detection_yunet/face_detection_yunet_2022mar.onnx?raw=true'
model_file_name
=
'face_detection_yunet.onnx'
model_file_name
=
'face_detection_yunet.onnx'
if
not
os
.
path
.
exists
(
dirname
):
os
.
makedirs
(
dirname
,
exist_ok
=
True
)
os
.
makedirs
(
dirname
)
cache_file
=
os
.
path
.
join
(
dirname
,
model_file_name
)
cache_file
=
os
.
path
.
join
(
dirname
,
model_file_name
)
if
not
os
.
path
.
exists
(
cache_file
):
if
not
os
.
path
.
exists
(
cache_file
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment