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
2f032016
Commit
2f032016
authored
Jul 02, 2024
by
comfyanonymous
Browse files
Remove some empty lines.
parent
52aaee25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
server.py
server.py
+6
-6
No files found.
server.py
View file @
2f032016
...
@@ -111,7 +111,7 @@ class PromptServer():
...
@@ -111,7 +111,7 @@ class PromptServer():
# On reconnect if we are the currently executing client send the current node
# On reconnect if we are the currently executing client send the current node
if
self
.
client_id
==
sid
and
self
.
last_node_id
is
not
None
:
if
self
.
client_id
==
sid
and
self
.
last_node_id
is
not
None
:
await
self
.
send
(
"executing"
,
{
"node"
:
self
.
last_node_id
},
sid
)
await
self
.
send
(
"executing"
,
{
"node"
:
self
.
last_node_id
},
sid
)
async
for
msg
in
ws
:
async
for
msg
in
ws
:
if
msg
.
type
==
aiohttp
.
WSMsgType
.
ERROR
:
if
msg
.
type
==
aiohttp
.
WSMsgType
.
ERROR
:
logging
.
warning
(
'ws connection closed with exception %s'
%
ws
.
exception
())
logging
.
warning
(
'ws connection closed with exception %s'
%
ws
.
exception
())
...
@@ -132,9 +132,9 @@ class PromptServer():
...
@@ -132,9 +132,9 @@ class PromptServer():
async
def
get_extensions
(
request
):
async
def
get_extensions
(
request
):
files
=
glob
.
glob
(
os
.
path
.
join
(
files
=
glob
.
glob
(
os
.
path
.
join
(
glob
.
escape
(
self
.
web_root
),
'extensions/**/*.js'
),
recursive
=
True
)
glob
.
escape
(
self
.
web_root
),
'extensions/**/*.js'
),
recursive
=
True
)
extensions
=
list
(
map
(
lambda
f
:
"/"
+
os
.
path
.
relpath
(
f
,
self
.
web_root
).
replace
(
"
\\
"
,
"/"
),
files
))
extensions
=
list
(
map
(
lambda
f
:
"/"
+
os
.
path
.
relpath
(
f
,
self
.
web_root
).
replace
(
"
\\
"
,
"/"
),
files
))
for
name
,
dir
in
nodes
.
EXTENSION_WEB_DIRS
.
items
():
for
name
,
dir
in
nodes
.
EXTENSION_WEB_DIRS
.
items
():
files
=
glob
.
glob
(
os
.
path
.
join
(
glob
.
escape
(
dir
),
'**/*.js'
),
recursive
=
True
)
files
=
glob
.
glob
(
os
.
path
.
join
(
glob
.
escape
(
dir
),
'**/*.js'
),
recursive
=
True
)
extensions
.
extend
(
list
(
map
(
lambda
f
:
"/extensions/"
+
urllib
.
parse
.
quote
(
extensions
.
extend
(
list
(
map
(
lambda
f
:
"/extensions/"
+
urllib
.
parse
.
quote
(
...
@@ -154,7 +154,7 @@ class PromptServer():
...
@@ -154,7 +154,7 @@ class PromptServer():
type_dir
=
folder_paths
.
get_output_directory
()
type_dir
=
folder_paths
.
get_output_directory
()
return
type_dir
,
dir_type
return
type_dir
,
dir_type
def
compare_image_hash
(
filepath
,
image
):
def
compare_image_hash
(
filepath
,
image
):
# function to compare hashes of two images to see if it already exists, fix to #3465
# function to compare hashes of two images to see if it already exists, fix to #3465
if
os
.
path
.
exists
(
filepath
):
if
os
.
path
.
exists
(
filepath
):
...
@@ -167,7 +167,7 @@ class PromptServer():
...
@@ -167,7 +167,7 @@ class PromptServer():
f
.
close
()
f
.
close
()
return
a
.
hexdigest
()
==
b
.
hexdigest
()
return
a
.
hexdigest
()
==
b
.
hexdigest
()
return
False
return
False
def
image_upload
(
post
,
image_save_function
=
None
):
def
image_upload
(
post
,
image_save_function
=
None
):
image
=
post
.
get
(
"image"
)
image
=
post
.
get
(
"image"
)
overwrite
=
post
.
get
(
"overwrite"
)
overwrite
=
post
.
get
(
"overwrite"
)
...
@@ -205,7 +205,7 @@ class PromptServer():
...
@@ -205,7 +205,7 @@ class PromptServer():
filepath
=
os
.
path
.
join
(
full_output_folder
,
filename
)
filepath
=
os
.
path
.
join
(
full_output_folder
,
filename
)
i
+=
1
i
+=
1
if
not
image_is_duplicate
:
if
not
image_is_duplicate
:
if
image_save_function
is
not
None
:
if
image_save_function
is
not
None
:
image_save_function
(
image
,
post
,
filepath
)
image_save_function
(
image
,
post
,
filepath
)
else
:
else
:
...
...
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