Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
9bf6061d
"...composable_kernel_onnx.git" did not exist on "6ff3fe5d059f98b518091144bde9df7b8456af4f"
Commit
9bf6061d
authored
Mar 29, 2024
by
comfyanonymous
Browse files
Switch prints to logging in folder_paths and add some extra debug.
parent
5d8898c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
folder_paths.py
folder_paths.py
+10
-7
No files found.
folder_paths.py
View file @
9bf6061d
import
os
import
os
import
time
import
time
import
logging
supported_pt_extensions
=
set
([
'.ckpt'
,
'.pt'
,
'.bin'
,
'.pth'
,
'.safetensors'
])
supported_pt_extensions
=
set
([
'.ckpt'
,
'.pt'
,
'.bin'
,
'.pth'
,
'.safetensors'
])
...
@@ -44,7 +45,7 @@ if not os.path.exists(input_directory):
...
@@ -44,7 +45,7 @@ if not os.path.exists(input_directory):
try
:
try
:
os
.
makedirs
(
input_directory
)
os
.
makedirs
(
input_directory
)
except
:
except
:
print
(
"Failed to create input directory"
)
logging
.
error
(
"Failed to create input directory"
)
def
set_output_directory
(
output_dir
):
def
set_output_directory
(
output_dir
):
global
output_directory
global
output_directory
...
@@ -146,21 +147,23 @@ def recursive_search(directory, excluded_dir_names=None):
...
@@ -146,21 +147,23 @@ def recursive_search(directory, excluded_dir_names=None):
try
:
try
:
dirs
[
directory
]
=
os
.
path
.
getmtime
(
directory
)
dirs
[
directory
]
=
os
.
path
.
getmtime
(
directory
)
except
FileNotFoundError
:
except
FileNotFoundError
:
print
(
f
"Warning: Unable to access
{
directory
}
. Skipping this path."
)
logging
.
warning
(
f
"Warning: Unable to access
{
directory
}
. Skipping this path."
)
logging
.
debug
(
"recursive file list on directory {}"
.
format
(
directory
))
for
dirpath
,
subdirs
,
filenames
in
os
.
walk
(
directory
,
followlinks
=
True
,
topdown
=
True
):
for
dirpath
,
subdirs
,
filenames
in
os
.
walk
(
directory
,
followlinks
=
True
,
topdown
=
True
):
subdirs
[:]
=
[
d
for
d
in
subdirs
if
d
not
in
excluded_dir_names
]
subdirs
[:]
=
[
d
for
d
in
subdirs
if
d
not
in
excluded_dir_names
]
for
file_name
in
filenames
:
for
file_name
in
filenames
:
relative_path
=
os
.
path
.
relpath
(
os
.
path
.
join
(
dirpath
,
file_name
),
directory
)
relative_path
=
os
.
path
.
relpath
(
os
.
path
.
join
(
dirpath
,
file_name
),
directory
)
result
.
append
(
relative_path
)
result
.
append
(
relative_path
)
for
d
in
subdirs
:
for
d
in
subdirs
:
path
=
os
.
path
.
join
(
dirpath
,
d
)
path
=
os
.
path
.
join
(
dirpath
,
d
)
try
:
try
:
dirs
[
path
]
=
os
.
path
.
getmtime
(
path
)
dirs
[
path
]
=
os
.
path
.
getmtime
(
path
)
except
FileNotFoundError
:
except
FileNotFoundError
:
pr
in
t
(
f
"Warning: Unable to access
{
path
}
. Skipping this path."
)
logging
.
warn
in
g
(
f
"Warning: Unable to access
{
path
}
. Skipping this path."
)
continue
continue
logging
.
debug
(
"found {} files"
.
format
(
len
(
result
)))
return
result
,
dirs
return
result
,
dirs
def
filter_files_extensions
(
files
,
extensions
):
def
filter_files_extensions
(
files
,
extensions
):
...
@@ -248,8 +251,8 @@ def get_save_image_path(filename_prefix, output_dir, image_width=0, image_height
...
@@ -248,8 +251,8 @@ def get_save_image_path(filename_prefix, output_dir, image_width=0, image_height
err
=
"**** ERROR: Saving image outside the output folder is not allowed."
+
\
err
=
"**** ERROR: Saving image outside the output folder is not allowed."
+
\
"
\n
full_output_folder: "
+
os
.
path
.
abspath
(
full_output_folder
)
+
\
"
\n
full_output_folder: "
+
os
.
path
.
abspath
(
full_output_folder
)
+
\
"
\n
output_dir: "
+
output_dir
+
\
"
\n
output_dir: "
+
output_dir
+
\
"
\n
commonpath: "
+
os
.
path
.
commonpath
((
output_dir
,
os
.
path
.
abspath
(
full_output_folder
)))
"
\n
commonpath: "
+
os
.
path
.
commonpath
((
output_dir
,
os
.
path
.
abspath
(
full_output_folder
)))
print
(
err
)
logging
.
error
(
err
)
raise
Exception
(
err
)
raise
Exception
(
err
)
try
:
try
:
...
...
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