InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

Update invoke.bat.in isolate environment variables

Open lynnewu opened this issue 3 years ago • 4 comments

Without locally scoped (to the script) environment variables, this script can only be run once and then you need to start a new cmd session to get a clean environment.

Surrounding the script with setlocal/endlocal achieves this.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setlocal https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/endlocal

lynnewu avatar Dec 06 '22 19:12 lynnewu

@lynnewu; Have you tested this?

tildebyte avatar Dec 07 '22 01:12 tildebyte

@lynnewu; Have you tested this?

Yes, on a single physical machine running Windows 10.

Before - cancel out of a working/running invoke.bat session. Restart it. Get the dreaded "No module named 'ldm'" error. Also note it leaves the prompt changed, to (invoked) H:\invokeAI> image

After - Here's a screenshot showing me terminating a running copy and then immediately restarting it successfully.

image

lynnewu avatar Dec 07 '22 01:12 lynnewu

Yes, on a single physical machine running Windows 10.

Nice work. TYVM.

tildebyte avatar Dec 07 '22 01:12 tildebyte

Yes, on a single physical machine running Windows 10.

Nice work. TYVM.

YW. Apologies for closing. This is the first time I've ever done this.

lynnewu avatar Dec 07 '22 15:12 lynnewu