When I first run the workflow in webui, comfyui loads the model. When I run the workflow again, it skips the step of loading the model, so the second subgraph is fast. However, after saving the script, the model is loaded every time it runs. I want to use this script as a service function in Flask. If there were many nodes in the workflow and they were loaded every time, it would take too long. Can we implement the caching principle of webui in the script?
When I first run the workflow in webui, comfyui loads the model. When I run the workflow again, it skips the step of loading the model, so the second subgraph is fast. However, after saving the script, the model is loaded every time it runs. I want to use this script as a service function in Flask. If there were many nodes in the workflow and they were loaded every time, it would take too long. Can we implement the caching principle of webui in the script?