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
e61755ea
Commit
e61755ea
authored
Feb 26, 2024
by
comfyanonymous
Browse files
Update the old updater if present when running on the windows standalone.
parent
36f7face
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
main.py
main.py
+7
-0
new_updater.py
new_updater.py
+35
-0
No files found.
main.py
View file @
e61755ea
...
@@ -193,6 +193,13 @@ if __name__ == "__main__":
...
@@ -193,6 +193,13 @@ if __name__ == "__main__":
folder_paths
.
set_temp_directory
(
temp_dir
)
folder_paths
.
set_temp_directory
(
temp_dir
)
cleanup_temp
()
cleanup_temp
()
if
args
.
windows_standalone_build
:
try
:
import
new_updater
new_updater
.
update_windows_updater
()
except
:
pass
loop
=
asyncio
.
new_event_loop
()
loop
=
asyncio
.
new_event_loop
()
asyncio
.
set_event_loop
(
loop
)
asyncio
.
set_event_loop
(
loop
)
server
=
server
.
PromptServer
(
loop
)
server
=
server
.
PromptServer
(
loop
)
...
...
new_updater.py
0 → 100644
View file @
e61755ea
import
os
import
shutil
base_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
def
update_windows_updater
():
top_path
=
os
.
path
.
dirname
(
base_path
)
updater_path
=
os
.
path
.
join
(
base_path
,
".ci/update_windows/update.py"
)
bat_path
=
os
.
path
.
join
(
base_path
,
".ci/update_windows/update_comfyui.bat"
)
dest_updater_path
=
os
.
path
.
join
(
top_path
,
"update/update.py"
)
dest_bat_path
=
os
.
path
.
join
(
top_path
,
"update/update_comfyui.bat"
)
dest_bat_deps_path
=
os
.
path
.
join
(
top_path
,
"update/update_comfyui_and_python_dependencies.bat"
)
try
:
with
open
(
dest_bat_path
,
'rb'
)
as
f
:
contents
=
f
.
read
()
except
:
return
if
not
contents
.
startswith
(
b
"..
\\
python_embeded
\\
python.exe .
\\
update.py"
):
return
shutil
.
copy
(
updater_path
,
dest_updater_path
)
try
:
with
open
(
dest_bat_deps_path
,
'rb'
)
as
f
:
contents
=
f
.
read
()
contents
=
contents
.
replace
(
b
'..
\\
python_embeded
\\
python.exe .
\\
update.py ..
\\
ComfyUI
\\
'
,
b
'call update_comfyui.bat nopause'
)
with
open
(
dest_bat_deps_path
,
'wb'
)
as
f
:
f
.
write
(
contents
)
except
:
pass
shutil
.
copy
(
bat_path
,
dest_bat_path
)
print
(
"Updated the windows standalone package updater."
)
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