Skip to content

Instantly share code, notes, and snippets.

@FurkanGozukara
Created August 9, 2023 11:11
Show Gist options
  • Save FurkanGozukara/822ed8078dcf8bcfe72a0c81e22d62dc to your computer and use it in GitHub Desktop.
Save FurkanGozukara/822ed8078dcf8bcfe72a0c81e22d62dc to your computer and use it in GitHub Desktop.
fixed relauncher.py
import os
import time
def relaunch_process(launch_counter=0):
'''
'''
while launch_counter < 1:
print('Relauncher: Launching...')
if launch_counter > 0:
print(f'\tRelaunch count: {launch_counter}')
try:
launch_string = "/workspace/stable-diffusion-webui/webui.sh -f"
os.system(launch_string)
except Exception as err:
print(f"An error occurred: {err}")
finally:
print('Relauncher: Process is ending. Relaunching in 2s...')
launch_counter += 1
time.sleep(2)
if __name__ == "__main__":
relaunch_process()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment