From 76750b0121533a77c56f190487075dcb4da23f4c Mon Sep 17 00:00:00 2001 From: Kevin Turner <83819+keturn@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:40:07 -0700 Subject: [PATCH] doc(development): add section on hot reloading with --dev_reload --- docs/contributing/LOCAL_DEVELOPMENT.md | 14 ++++++++++++++ invokeai/app/api_app.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/contributing/LOCAL_DEVELOPMENT.md b/docs/contributing/LOCAL_DEVELOPMENT.md index b0b03e42a4..f93ec56e96 100644 --- a/docs/contributing/LOCAL_DEVELOPMENT.md +++ b/docs/contributing/LOCAL_DEVELOPMENT.md @@ -75,6 +75,20 @@ pytest --cov; open ./coverage/html/index.html ![html-detail](../assets/contributing/html-detail.png) +### Reloading Changes + +Experimenting with changes to the Python source code is a drag if you have to re-start the server — +and re-load those multi-gigabyte models — +after every change. + +For a faster development workflow, add the `--dev_reload` flag when starting the server. +The server will watch for changes to all the Python files in the `invokeai` directory and apply those changes to the +running server on the fly. + +This will allow you to avoid restarting the server (and reloading models) in most cases, but there are some caveats; see +the [jurigged documentation](https://github.com/breuleux/jurigged#caveats) for details. + + ## Front End diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py index 7ed2dedd44..e167e6903c 100644 --- a/invokeai/app/api_app.py +++ b/invokeai/app/api_app.py @@ -213,7 +213,7 @@ def invoke_api(): import jurigged except ImportError as e: logger.error( - "Can't start `--dev_reload` because jurigged is not found; `pip install -e '.[dev]'` to include development dependencies.", + 'Can\'t start `--dev_reload` because jurigged is not found; `pip install -e ".[dev]"` to include development dependencies.', exc_info=e, ) else: