@ -20,7 +20,7 @@ import nodes
import torch
import torch
version = [ 1 , 16 ]
version = [ 1 , 17 ]
version_str = f " V { version [ 0 ] } . { version [ 1 ] } " + ( f ' . { version [ 2 ] } ' if len ( version ) > 2 else ' ' )
version_str = f " V { version [ 0 ] } . { version [ 1 ] } " + ( f ' . { version [ 2 ] } ' if len ( version ) > 2 else ' ' )
print ( f " ### Loading: ComfyUI-Manager ( { version_str } ) " )
print ( f " ### Loading: ComfyUI-Manager ( { version_str } ) " )
@ -1198,6 +1198,7 @@ class GitProgress(RemoteProgress):
self . pbar . pos = 0
self . pbar . pos = 0
self . pbar . refresh ( )
self . pbar . refresh ( )
def is_valid_url ( url ) :
def is_valid_url ( url ) :
try :
try :
result = urlparse ( url )
result = urlparse ( url )
@ -1205,6 +1206,7 @@ def is_valid_url(url):
except ValueError :
except ValueError :
return False
return False
def gitclone_install ( files ) :
def gitclone_install ( files ) :
print ( f " install: { files } " )
print ( f " install: { files } " )
for url in files :
for url in files :
@ -1240,6 +1242,11 @@ def gitclone_install(files):
return True
return True
def pip_install ( packages ) :
install_cmd = [ ' #FORCE ' , sys . executable , " -m " , " pip " , " install " , ' -U ' ] + packages
try_install_script ( ' pip install via manager ' , ' . ' , install_cmd )
import platform
import platform
import subprocess
import subprocess
import time
import time
@ -1430,6 +1437,16 @@ async def install_custom_node_git_url(request):
return web . Response ( status = 400 )
return web . Response ( status = 400 )
@server . PromptServer . instance . routes . get ( " /customnode/install/pip " )
async def install_custom_node_git_url ( request ) :
res = False
if " packages " in request . rel_url . query :
packages = request . rel_url . query [ ' packages ' ]
pip_install ( packages . split ( ' ' ) )
return web . Response ( status = 200 )
@server . PromptServer . instance . routes . post ( " /customnode/uninstall " )
@server . PromptServer . instance . routes . post ( " /customnode/uninstall " )
async def uninstall_custom_node ( request ) :
async def uninstall_custom_node ( request ) :
json_data = await request . json ( )
json_data = await request . json ( )