|
21 | 21 |
|
22 | 22 | weight_load_location = None
|
23 | 23 |
|
24 |
| -xformers_available = False |
| 24 | +if os.environ.get('IGNORE_CMD_ARGS_ERRORS', None) is None: |
| 25 | + cmd_opts = parser.parse_args() |
| 26 | +else: |
| 27 | + cmd_opts, _ = parser.parse_known_args() |
| 28 | + |
| 29 | + |
| 30 | +restricted_opts = { |
| 31 | + "samples_filename_pattern", |
| 32 | + "directories_filename_pattern", |
| 33 | + "outdir_samples", |
| 34 | + "outdir_txt2img_samples", |
| 35 | + "outdir_img2img_samples", |
| 36 | + "outdir_extras_samples", |
| 37 | + "outdir_grids", |
| 38 | + "outdir_txt2img_grids", |
| 39 | + "outdir_save", |
| 40 | + "outdir_init_images" |
| 41 | +} |
| 42 | + |
| 43 | +# https://huggingface.co/datasets/freddyaboulton/gradio-theme-subdomains/resolve/main/subdomains.json |
| 44 | +gradio_hf_hub_themes = [ |
| 45 | + "gradio/glass", |
| 46 | + "gradio/monochrome", |
| 47 | + "gradio/seafoam", |
| 48 | + "gradio/soft", |
| 49 | + "freddyaboulton/dracula_revamped", |
| 50 | + "gradio/dracula_test", |
| 51 | + "abidlabs/dracula_test", |
| 52 | + "abidlabs/pakistan", |
| 53 | + "dawood/microsoft_windows", |
| 54 | + "ysharma/steampunk" |
| 55 | +] |
| 56 | + |
| 57 | + |
| 58 | +cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen or cmd_opts.server_name) and not cmd_opts.enable_insecure_extension_access |
| 59 | + |
| 60 | +devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_esrgan, devices.device_codeformer = \ |
| 61 | + (devices.cpu if any(y in cmd_opts.use_cpu for y in [x, 'all']) else devices.get_optimal_device() for x in ['sd', 'interrogate', 'gfpgan', 'esrgan', 'codeformer']) |
| 62 | + |
| 63 | +devices.dtype = torch.float32 if cmd_opts.no_half else torch.float16 |
| 64 | +devices.dtype_vae = torch.float32 if cmd_opts.no_half or cmd_opts.no_half_vae else torch.float16 |
| 65 | + |
| 66 | +device = devices.device |
| 67 | +weight_load_location = None if cmd_opts.lowram else "cpu" |
| 68 | + |
| 69 | +batch_cond_uncond = cmd_opts.always_batch_cond_uncond or not (cmd_opts.lowvram or cmd_opts.medvram) |
| 70 | +parallel_processing_allowed = not cmd_opts.lowvram and not cmd_opts.medvram |
| 71 | +xformers_available = False |
| 72 | +config_filename = cmd_opts.ui_settings_file |
25 | 73 |
|
26 | 74 | hypernetworks = {}
|
27 | 75 |
|
|
0 commit comments