Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update invoke.bat.in isolate environment variables #1833

Merged
merged 1 commit into from
Dec 7, 2022
Merged

Update invoke.bat.in isolate environment variables #1833

merged 1 commit into from
Dec 7, 2022

Conversation

lynnewu
Copy link
Contributor

@lynnewu lynnewu commented Dec 6, 2022

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

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
@tildebyte
Copy link
Contributor

@lynnewu; Have you tested this?

@lynnewu
Copy link
Contributor Author

lynnewu commented Dec 7, 2022

@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 lynnewu closed this Dec 7, 2022
@tildebyte tildebyte reopened this Dec 7, 2022
@tildebyte
Copy link
Contributor

Yes, on a single physical machine running Windows 10.

Nice work. TYVM.

@lynnewu
Copy link
Contributor Author

lynnewu commented Dec 7, 2022

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.

Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lstein lstein merged commit 4d76116 into invoke-ai:main Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants