carloscar commited on
Commit
c5fa94b
1 Parent(s): 7357831

startup options depending on if cuda is available or not

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. run.py +6 -0
Dockerfile CHANGED
@@ -121,4 +121,4 @@ RUN chmod +x on_start.sh
121
 
122
  EXPOSE 7860
123
 
124
- CMD ["/opt/venv/bin/python", "run.py", "--force-enable-xformers", "--xformers", "--listen", "--enable-insecure-extension-access", "--ui-config-file", "ui-config.json", "--ui-settings-file", "config.json", "--disable-console-progressbars", "--cors-allow-origins", "huggingface.co,hf.space", "--no-progressbar-hiding", "--enable-console-prompts", "--no-download-sd-model", "--api", "--skip-version-check"]
 
121
 
122
  EXPOSE 7860
123
 
124
+ CMD ["/opt/venv/bin/python", "run.py", "--listen", "--enable-insecure-extension-access", "--ui-config-file", "ui-config.json", "--ui-settings-file", "config.json", "--disable-console-progressbars", "--cors-allow-origins", "huggingface.co,hf.space", "--no-progressbar-hiding", "--enable-console-prompts", "--no-download-sd-model", "--api", "--skip-version-check"]
run.py CHANGED
@@ -26,4 +26,10 @@ def start():
26
 
27
 
28
  if __name__ == "__main__":
 
 
 
 
 
 
29
  start()
 
26
 
27
 
28
  if __name__ == "__main__":
29
+ import torch
30
+ if not torch.cuda.is_available():
31
+ sys.argv.extend(["--precision", "full", "--no-half", "--use-cpu", "SD", "BSRGAN", "ESRGAN", "SCUNet", "CodeFormer", "--all"])
32
+ else:
33
+ sys.argv.extend(["--force-enable-xformers", "--xformers"])
34
+
35
  start()