vorstcavry commited on
Commit
1ea6cc2
·
1 Parent(s): 636edcb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -27
app.py CHANGED
@@ -199,30 +199,12 @@ DownLoad(r"https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv
199
  #strt Stable Diffusion Webui
200
  print("Done\nStarting Webui...")
201
  os.chdir(user_home / r"stable-diffusion-webui")
202
- import subprocess
203
- import pathlib
204
-
205
- user_home = pathlib.Path("/home/user") # Gantilah dengan path yang sesuai
206
-
207
- args = [
208
- executable,
209
- user_home / "stable-diffusion-webui" / "launch.py",
210
- "--precision", "full",
211
- "--no-half",
212
- "--no-half-vae",
213
- "--enable-insecure-extension-access",
214
- "--medvram",
215
- "--skip-torch-cuda-test",
216
- "--enable-console-prompts",
217
- "--ui-settings-file=" + str(pathlib.Path(__file__).parent / "config.json"),
218
- "--hf-token-out",
219
- "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" # Gantilah dengan token yang sesuai
220
- ]
221
-
222
- args = [arg.as_posix() if isinstance(arg, pathlib.PosixPath) else arg for arg in args]
223
-
224
- try:
225
- ret = subprocess.run(args)
226
- except Exception as e:
227
- print("Error:", e)
228
- del os ,user_home ,executable ,subprocess
 
199
  #strt Stable Diffusion Webui
200
  print("Done\nStarting Webui...")
201
  os.chdir(user_home / r"stable-diffusion-webui")
202
+ gc.collect()
203
+ while True:
204
+ ret=subprocess.run([executable ,user_home / r"stable-diffusion-webui" / r"launch.py",r"--precision",r"full",r"--no-half",r"--no-half-vae",r"--enable-insecure-extension-access",r"--medvram",r"--skip-torch-cuda-test",r"--enable-console-prompts",r"--ui-settings-file="+str(pathlib.Path(__file__).parent /r"config.json")])
205
+ if(ret.returncode == 0 ):
206
+ del ret
207
+ gc.collect()
208
+ else :
209
+ del ret
210
+ del os ,user_home ,pyexecutable ,subprocess