File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,23 @@ def import_custom_nodes() -> None:
1414 creates a PromptQueue, and initializes the custom nodes.
1515 """
1616 if has_manager :
17- import manager_core as manager
18- if hasattr (manager , "get_config" ):
19- print ("Patching manager_core.get_config to enforce offline mode." )
20- get_config = manager .get_config
21- def _get_config (* args , ** kwargs ):
22- config = get_config (* args , ** kwargs )
23- config ["network_mode" ] = "offline"
24- return config
25- manager .get_config = _get_config
17+ try :
18+ import manager_core as manager
19+ except ImportError :
20+ print ("Could not import manager_core, proceeding without it." )
21+ return
22+ else :
23+ if hasattr (manager , "get_config" ):
24+ print ("Patching manager_core.get_config to enforce offline mode." )
25+ try :
26+ get_config = manager .get_config
27+ def _get_config (* args , ** kwargs ):
28+ config = get_config (* args , ** kwargs )
29+ config ["network_mode" ] = "offline"
30+ return config
31+ manager .get_config = _get_config
32+ except Exception as e :
33+ print ("Failed to patch manager_core.get_config:" , e )
2634
2735 import asyncio
2836 import execution
You can’t perform that action at this time.
0 commit comments