vorstcavry commited on
Commit
d4c905a
1 Parent(s): 7f0507b

Update app.py

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