|
4 | 4 | from core.paths import * |
5 | 5 | # TODO do not use cargs |
6 | 6 |
|
| 7 | +# The parsed args (global) |
| 8 | +cargs = None |
| 9 | + |
7 | 10 | parser = argparse.ArgumentParser() |
8 | | -parser.add_argument("--gfpgan-dir", type=str, help="GFPGAN directory", default=('./src/gfpgan' if os.path.exists('./src/gfpgan') else './GFPGAN')) |
9 | | -parser.add_argument("--gfpgan-model", type=str, help="GFPGAN model file name", default=None) |
10 | | -parser.add_argument("--no-half", action='store_true', help="do not switch the model to 16-bit floats") |
11 | | -parser.add_argument("--no-half-vae", action='store_true', help="do not switch the VAE model to 16-bit floats") |
12 | | -parser.add_argument("--no-progressbar-hiding", action='store_true', help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser)") |
13 | | -parser.add_argument("--max-batch-count", type=int, default=16, help="maximum batch count value for the UI") |
14 | | -parser.add_argument("--embeddings-dir", type=str, default=rootdir / 'embeddings', help="embeddings directory for textual inversion (default: embeddings)") |
15 | | -parser.add_argument("--hypernetwork-dir", type=str, default=modeldir / 'modules/hypernetworks', help="hypernetwork directory") |
16 | | -parser.add_argument("--allow-code", action='store_true', help="allow custom script execution from webui") |
17 | | -parser.add_argument("--medvram", action='store_true', help="enable stable diffusion model optimizations for sacrificing a little speed for low VRM usage") |
18 | | -parser.add_argument("--lowvram", action='store_true', help="enable stable diffusion model optimizations for sacrificing a lot of speed for very low VRM usage") |
19 | | -parser.add_argument("--always-batch-cond-uncond", action='store_true', help="disables cond/uncond batching that is enabled to save memory with --medvram or --lowvram") |
20 | | -parser.add_argument("--unload-gfpgan", action='store_true', help="does not do anything.") |
21 | | -parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast") |
22 | | -parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site (doesn't work for me but you might have better luck)") |
23 | | -parser.add_argument("--ngrok", type=str, help="ngrok authtoken, alternative to gradio --share", default=None) |
24 | | -parser.add_argument("--codeformer-models-path", type=str, help="Path to directory with codeformer model file(s).", default=modeldir / 'Codeformer') |
25 | | -parser.add_argument("--gfpgan-models-path", type=str, help="Path to directory with GFPGAN model file(s).", default=(modeldir / 'GFPGAN').as_posix()) |
26 | | -parser.add_argument("--esrgan-models-path", type=str, help="Path to directory with ESRGAN model file(s).", default=(modeldir / 'ESRGAN').as_posix()) |
27 | | -parser.add_argument("--bsrgan-models-path", type=str, help="Path to directory with BSRGAN model file(s).", default=(modeldir / 'BSRGAN').as_posix()) |
28 | | -parser.add_argument("--realesrgan-models-path", type=str, help="Path to directory with RealESRGAN model file(s).", default=(modeldir / 'RealESRGAN').as_posix()) |
29 | | -parser.add_argument("--scunet-models-path", type=str, help="Path to directory with ScuNET model file(s).", default=(modeldir / 'ScuNET').as_posix()) |
30 | | -parser.add_argument("--swinir-models-path", type=str, help="Path to directory with SwinIR model file(s).", default=modeldir / 'SwinIR') |
31 | | -parser.add_argument("--ldsr-models-path", type=str, help="Path to directory with LDSR model file(s).", default=modeldir / 'LDSR') |
32 | | -parser.add_argument("--xformers", action='store_true', help="enable xformers for cross attention layers") |
33 | | -parser.add_argument("--force-enable-xformers", action='store_true', help="enable xformers for cross attention layers regardless of whether the checking code thinks you can run it; do not make bug reports if this fails to work") |
34 | | -parser.add_argument("--opt-split-attention", action='store_true', help="force-enables Doggettx's cross-attention layer optimization. By default, it's on for torch cuda.") |
35 | | -parser.add_argument("--opt-split-attention-invokeai", action='store_true', help="force-enables InvokeAI's cross-attention layer optimization. By default, it's on when cuda is unavailable.") |
36 | | -parser.add_argument("--opt-split-attention-v1", action='store_true', help="enable older version of split attention optimization that does not consume all the VRAM it can find") |
37 | | -parser.add_argument("--disable-opt-split-attention", action='store_true', help="force-disables cross-attention layer optimization") |
38 | | -parser.add_argument("--use-cpu", nargs='+', choices=['StableDiffusion', 'GFPGAN', 'BSRGAN', 'ESRGAN', 'SCUNet', 'CodeFormer'], help="use CPU as torch device for specified modules", default=[]) |
39 | | -parser.add_argument("--listen", action='store_true', help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests") |
40 | | -parser.add_argument("--port", type=int, help="launch gradio with given server port, you need root/admin rights for ports < 1024, defaults to 7860 if available", default=None) |
41 | | -parser.add_argument("--show-negative-prompt", action='store_true', help="does not do anything", default=False) |
42 | | -parser.add_argument("--ui-config-file", type=str, help="filename to use for ui configuration", default=rootdir / 'ui-config.json') |
43 | | -parser.add_argument("--hide-ui-dir-config", action='store_true', help="hide directory configuration from webui", default=False) |
44 | | -parser.add_argument("--ui-settings-file", type=str, help="filename to use for ui settings", default=rootdir / 'config.json') |
45 | | -parser.add_argument("--gradio-debug", action='store_true', help="launch gradio with --debug option") |
46 | | -parser.add_argument("--gradio-auth", type=str, help='set gradio authentication like "username:password"; or comma-delimit multiple like "u1:p1,u2:p2,u3:p3"', default=None) |
47 | | -parser.add_argument("--gradio-img2img-tool", type=str, help='gradio image uploader tool: can be either editor for ctopping, or color-sketch for drawing', choices=["color-sketch", "editor"], default="editor") |
48 | | -parser.add_argument("--opt-channelslast", action='store_true', help="change memory type for stable diffusion to channels last") |
49 | | -parser.add_argument("--styles-file", type=str, help="filename to use for styles", default=rootdir / 'styles.csv') |
50 | | -parser.add_argument("--autolaunch", action='store_true', help="open the webui URL in the system's default browser upon launch", default=False) |
51 | | -parser.add_argument("--use-textbox-seed", action='store_true', help="use textbox for seeds in UI (no up/down, but possible to input long seeds)", default=False) |
52 | | -parser.add_argument("--disable-console-progressbars", action='store_true', help="do not output progressbars to console", default=False) |
53 | | -parser.add_argument('--vae-path', type=str, help='Path to Variational Autoencoders model', default=None) |
54 | | -parser.add_argument("--disable-safe-unpickle", action='store_true', help="disable checking pytorch models for malicious code", default=False) |
| 11 | +parser.add_argument("--dry", type=str, help="Only install and test the core, do not launch server.") |
| 12 | + |
| 13 | +# parser.add_argument("--gfpgan-dir", type=str, help="GFPGAN directory", default=('./src/gfpgan' if os.path.exists('./src/gfpgan') else './GFPGAN')) |
| 14 | +# parser.add_argument("--gfpgan-model", type=str, help="GFPGAN model file name", default=None) |
| 15 | +# parser.add_argument("--no-half", action='store_true', help="do not switch the model to 16-bit floats") |
| 16 | +# parser.add_argument("--no-half-vae", action='store_true', help="do not switch the VAE model to 16-bit floats") |
| 17 | +# parser.add_argument("--no-progressbar-hiding", action='store_true', help="do not hide progressbar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser)") |
| 18 | +# parser.add_argument("--max-batch-count", type=int, default=16, help="maximum batch count value for the UI") |
| 19 | +# parser.add_argument("--embeddings-dir", type=str, default=rootdir / 'embeddings', help="embeddings directory for textual inversion (default: embeddings)") |
| 20 | +# parser.add_argument("--hypernetwork-dir", type=str, default=modeldir / 'modules/hypernetworks', help="hypernetwork directory") |
| 21 | +# parser.add_argument("--allow-code", action='store_true', help="allow custom script execution from webui") |
| 22 | +# parser.add_argument("--medvram", action='store_true', help="enable stable diffusion model optimizations for sacrificing a little speed for low VRM usage") |
| 23 | +# parser.add_argument("--lowvram", action='store_true', help="enable stable diffusion model optimizations for sacrificing a lot of speed for very low VRM usage") |
| 24 | +# parser.add_argument("--always-batch-cond-uncond", action='store_true', help="disables cond/uncond batching that is enabled to save memory with --medvram or --lowvram") |
| 25 | +# parser.add_argument("--unload-gfpgan", action='store_true', help="does not do anything.") |
| 26 | +# parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast") |
| 27 | +# parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site (doesn't work for me but you might have better luck)") |
| 28 | +# parser.add_argument("--ngrok", type=str, help="ngrok authtoken, alternative to gradio --share", default=None) |
| 29 | +# parser.add_argument("--codeformer-models-path", type=str, help="Path to directory with codeformer model file(s).", default=modeldir / 'Codeformer') |
| 30 | +# parser.add_argument("--gfpgan-models-path", type=str, help="Path to directory with GFPGAN model file(s).", default=(modeldir / 'GFPGAN').as_posix()) |
| 31 | +# parser.add_argument("--esrgan-models-path", type=str, help="Path to directory with ESRGAN model file(s).", default=(modeldir / 'ESRGAN').as_posix()) |
| 32 | +# parser.add_argument("--bsrgan-models-path", type=str, help="Path to directory with BSRGAN model file(s).", default=(modeldir / 'BSRGAN').as_posix()) |
| 33 | +# parser.add_argument("--realesrgan-models-path", type=str, help="Path to directory with RealESRGAN model file(s).", default=(modeldir / 'RealESRGAN').as_posix()) |
| 34 | +# parser.add_argument("--scunet-models-path", type=str, help="Path to directory with ScuNET model file(s).", default=(modeldir / 'ScuNET').as_posix()) |
| 35 | +# parser.add_argument("--swinir-models-path", type=str, help="Path to directory with SwinIR model file(s).", default=modeldir / 'SwinIR') |
| 36 | +# parser.add_argument("--ldsr-models-path", type=str, help="Path to directory with LDSR model file(s).", default=modeldir / 'LDSR') |
| 37 | +# parser.add_argument("--xformers", action='store_true', help="enable xformers for cross attention layers") |
| 38 | +# parser.add_argument("--force-enable-xformers", action='store_true', help="enable xformers for cross attention layers regardless of whether the checking code thinks you can run it; do not make bug reports if this fails to work") |
| 39 | +# parser.add_argument("--opt-split-attention", action='store_true', help="force-enables Doggettx's cross-attention layer optimization. By default, it's on for torch cuda.") |
| 40 | +# parser.add_argument("--opt-split-attention-invokeai", action='store_true', help="force-enables InvokeAI's cross-attention layer optimization. By default, it's on when cuda is unavailable.") |
| 41 | +# parser.add_argument("--opt-split-attention-v1", action='store_true', help="enable older version of split attention optimization that does not consume all the VRAM it can find") |
| 42 | +# parser.add_argument("--disable-opt-split-attention", action='store_true', help="force-disables cross-attention layer optimization") |
| 43 | +# parser.add_argument("--use-cpu", nargs='+', choices=['stable_diffusion', 'GFPGAN', 'BSRGAN', 'ESRGAN', 'SCUNet', 'CodeFormer'], help="use CPU as torch device for specified modules", default=[]) |
| 44 | +# parser.add_argument("--listen", action='store_true', help="launch gradio with 0.0.0.0 as server name, allowing to respond to network requests") |
| 45 | +# parser.add_argument("--port", type=int, help="launch gradio with given server port, you need root/admin rights for ports < 1024, defaults to 7860 if available", default=None) |
| 46 | +# parser.add_argument("--show-negative-prompt", action='store_true', help="does not do anything", default=False) |
| 47 | +# parser.add_argument("--ui-config-file", type=str, help="filename to use for ui configuration", default=rootdir / 'ui-config.json') |
| 48 | +# parser.add_argument("--hide-ui-dir-config", action='store_true', help="hide directory configuration from webui", default=False) |
| 49 | +# parser.add_argument("--ui-settings-file", type=str, help="filename to use for ui settings", default=rootdir / 'config.json') |
| 50 | +# parser.add_argument("--gradio-debug", action='store_true', help="launch gradio with --debug option") |
| 51 | +# parser.add_argument("--gradio-auth", type=str, help='set gradio authentication like "username:password"; or comma-delimit multiple like "u1:p1,u2:p2,u3:p3"', default=None) |
| 52 | +# parser.add_argument("--gradio-img2img-tool", type=str, help='gradio image uploader tool: can be either editor for ctopping, or color-sketch for drawing', choices=["color-sketch", "editor"], default="editor") |
| 53 | +# parser.add_argument("--opt-channelslast", action='store_true', help="change memory type for stable diffusion to channels last") |
| 54 | +# parser.add_argument("--styles-file", type=str, help="filename to use for styles", default=rootdir / 'styles.csv') |
| 55 | +# parser.add_argument("--autolaunch", action='store_true', help="open the webui URL in the system's default browser upon launch", default=False) |
| 56 | +# parser.add_argument("--use-textbox-seed", action='store_true', help="use textbox for seeds in UI (no up/down, but possible to input long seeds)", default=False) |
| 57 | +# parser.add_argument("--disable-console-progressbars", action='store_true', help="do not output progressbars to console", default=False) |
| 58 | +# parser.add_argument('--vae-path', type=str, help='Path to Variational Autoencoders model', default=None) |
| 59 | +# parser.add_argument("--disable-safe-unpickle", action='store_true', help="disable checking pytorch models for malicious code", default=False) |
55 | 60 |
|
56 | | -cargs = None |
|
0 commit comments