startup options depending on if cuda is available or not
Browse files- Dockerfile +1 -1
- 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", "--
|
|
|
|
| 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()
|