1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Tweak server/custom node load order

- Load custom nodes after creating server
 - Add routes after loading custom nodes
Custom nodes can now add routes via PromptServer.instance
This commit is contained in:
pythongosssss
2023-04-01 12:44:29 +01:00
parent 06c2c19b5a
commit 313f1f83a6
3 changed files with 10 additions and 6 deletions

View File

@@ -40,6 +40,7 @@ if __name__ == "__main__":
except:
pass
from nodes import init_custom_nodes
import execution
import server
import folder_paths
@@ -98,6 +99,8 @@ if __name__ == "__main__":
server = server.PromptServer(loop)
q = execution.PromptQueue(server)
init_custom_nodes()
server.add_routes()
hijack_progress(server)
threading.Thread(target=prompt_worker, daemon=True, args=(q,server,)).start()
@@ -113,7 +116,6 @@ if __name__ == "__main__":
except:
address = '127.0.0.1'
dont_print = False
if '--dont-print-server' in sys.argv:
dont_print = True