Repository: stable-diffusion-webui
Issue: [Bug]: swinIR breaks on OSX 
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

When trying to upscale an image with swinIR_4x execution aborts 

### Steps to reproduce the problem

On the extras tab I inserted an image and selected swinIR_4x as the upscaler 

### What should have happened?

All the upscalers work

### Sysinfo

    "Platform": "macOS-13.6.1-arm64-arm-64bit",
    "Python": "3.10.13",
    "Version": "v1.6.0-2-g4afaaf8a",
    "Commit": "4afaaf8a020c1df457bcf7250cb1c7f609699fa7",
    "Script path": "/Users/jan/Documents/ML/stable-diffusion-webui",
    "Data path": "/Users/jan/Documents/ML/stable-diffusion-webui",
    "Extensions dir": "/Users/jan/Documents/ML/stable-diffusion-webui/extensions",
    "Checksum": "535eee3f2b75edcaec3b175fe1b3badf4ef45b70c64456179a24636ad885878e",
    "Commandline": [
        "launch.py",
        "--medvram",
        "--medvram-sdxl",
        "--skip-torch-cuda-test",
        "--upcast-sampling",
        "--no-half-vae",
        "--use-cpu",
        "interrogate"
    ],
    "Torch env info": {
        "torch_version": "2.0.1",
        "is_debug_build": "False",
        "cuda_compiled_version": null,
        "gcc_version": null,
        "clang_version": "15.0.0 (clang-1500.0.40.1)",
        "cmake_version": "version 3.27.7",
        "os": "macOS 13.6.1 (arm64)",
        "libc_version": "N/A",
        "python_version": "3.10.13 (main, Nov  1 2023, 16:34:31) [Clang 14.0.3 (clang-1403.0.22.14.1)] (64-bit runtime)",
        "python_platform": "macOS-13.6.1-arm64-arm-64bit",
        "is_cuda_available": "False",
        "cuda_runtime_version": null,
        "cuda_module_loading": "N/A",
        "nvidia_driver_version": null,
        "nvidia_gpu_models": null,
        "cudnn_version": null,
        "pip_version": "pip3",
        "pip_packages": [
            "numpy==1.23.5",
            "open-clip-torch==2.20.0",
            "pytorch-lightning==1.9.4",
            "torch==2.0.1",
            "torchdiffeq==0.2.3",
            "torchmetrics==1.2.0",
            "torchsde==0.2.5",
            "torchvision==0.15.2"
        ],
        "conda_packages": [
            "numpy                     1.23.5                   pypi_0    pypi",
            "open-clip-torch           2.7.0                    pypi_0    pypi",
            "pytorch-lightning         1.9.4                    pypi_0    pypi",
            "torch                     1.13.1                   pypi_0    pypi",
            "torchdiffeq               0.2.3                    pypi_0    pypi",
            "torchmetrics              0.11.0                   pypi_0    pypi",
            "torchsde                  0.2.5                    pypi_0    pypi",
            "torchvision               0.12.0                   pypi_0    pypi"
        ],
        "hip_compiled_version": "N/A",
        "hip_runtime_version": "N/A",
        "miopen_runtime_version": "N/A",
        "caching_allocator_config": "",
        "is_xnnpack_available": "True",
        "cpu_info": "Apple M1 Pro"
    },

### What browsers do you use to access the UI ?

Google Chrome, Brave, Apple Safari

### Console logs

```Shell
*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=889x1200 at 0x2B7E82D70>, None, '', '', True, 0, 4, 512, 512, True, 'SwinIR_4x', 'None', 0, 0, 0, 0) {}
    Traceback (most recent call last):
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 670, in call_user_compiler
        compiled_fn = compiler_fn(gm, self.fake_example_inputs())
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/debug_utils.py", line 1055, in debug_wrapper
        compiled_gm = compiler_fn(gm, example_inputs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/__init__.py", line 1390, in __call__
        return compile_fx(model_, inputs_, config_patches=self.config)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 455, in compile_fx
        return aot_autograd(
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/backends/common.py", line 48, in compiler_fn
        cg = aot_module_simplified(gm, example_inputs, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2822, in aot_module_simplified
        compiled_fn = create_aot_dispatcher_function(
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
        r = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 2515, in create_aot_dispatcher_function
        compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1715, in aot_wrapper_dedupe
        return compiler_fn(flat_fn, leaf_flat_args, aot_config)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_functorch/aot_autograd.py", line 1328, in aot_dispatch_base
        compiled_fw = aot_config.fw_compiler(fw_module, flat_args_with_views_handled)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
        r = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 430, in fw_compiler
        return inner_compile(
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/debug_utils.py", line 595, in debug_wrapper
        compiled_fn = compiler_fn(gm, example_inputs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/debug.py", line 239, in inner
        return fn(*args, **kwargs)
      File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 79, in inner
        return func(*args, **kwds)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 177, in compile_fx_inner
        compiled_fn = graph.compile_to_fn()
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/graph.py", line 586, in compile_to_fn
        return self.compile_to_module().call
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
        r = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/graph.py", line 571, in compile_to_module
        code = self.codegen()
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/graph.py", line 520, in codegen
        self.scheduler = Scheduler(self.buffers)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
        r = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/scheduler.py", line 605, in __init__
        group_fn = self.get_backend(node.get_device()).group_fn
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/scheduler.py", line 1131, in get_backend
        self.backends[device] = self.create_backend(device)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_inductor/scheduler.py", line 1116, in create_backend
        device_props = torch.cuda.get_device_properties(device)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/cuda/__init__.py", line 395, in get_device_properties
        _lazy_init()  # will define _get_device_properties
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/cuda/__init__.py", line 239, in _lazy_init
        raise AssertionError("Torch not compiled with CUDA enabled")
    AssertionError: Torch not compiled with CUDA enabled

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "/Users/jan/Documents/ML/stable-diffusion-webui/modules/call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "/Users/jan/Documents/ML/stable-diffusion-webui/modules/call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/modules/postprocessing.py", line 59, in run_postprocessing
        scripts.scripts_postproc.run(pp, args)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/modules/scripts_postprocessing.py", line 130, in run
        script.process(pp, **process_args)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/scripts/postprocessing_upscale.py", line 100, in process
        upscaled_image = self.upscale(pp.image, pp.info, upscaler1, upscale_mode, upscale_by, upscale_to_width, upscale_to_height, upscale_crop)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/scripts/postprocessing_upscale.py", line 70, in upscale
        image = upscaler.scaler.upscale(image, upscale_by, upscaler.data_path)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/modules/upscaler.py", line 62, in upscale
        img = self.do_upscale(img, selected_model)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/extensions-builtin/SwinIR/scripts/swinir_model.py", line 59, in do_upscale
        img = upscale(img, model)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/extensions-builtin/SwinIR/scripts/swinir_model.py", line 134, in upscale
        output = inference(img, model, tile, tile_overlap, window_size, scale)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/extensions-builtin/SwinIR/scripts/swinir_model.py", line 168, in inference
        out_patch = model(in_patch)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
        return forward_call(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 82, in forward
        return self.dynamo_ctx(self._orig_mod.forward)(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 209, in _fn
        return fn(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 337, in catch_errors
        return callback(frame, cache_size, hooks)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 404, in _convert_frame
        result = inner_convert(frame, cache_size, hooks)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 104, in _fn
        return fn(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 262, in _convert_frame_assert
        return _compile(
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
        r = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 324, in _compile
        out_code = transform_code_object(code, transform)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/bytecode_transformation.py", line 445, in transform_code_object
        transformations(instructions, code_options)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 311, in transform
        tracer.run()
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1726, in run
        super().run()
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 576, in run
        and self.step()
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 540, in step
        getattr(self, inst.opname)(inst)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/symbolic_convert.py", line 1792, in RETURN_VALUE
        self.output.compile_subgraph(
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 541, in compile_subgraph
        self.compile_and_call_fx_graph(tx, pass2.graph_output_vars(), root)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 588, in compile_and_call_fx_graph
        compiled_fn = self.call_user_compiler(gm)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
        r = func(*args, **kwargs)
      File "/Users/jan/Documents/ML/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_dynamo/output_graph.py", line 675, in call_user_compiler
        raise BackendCompilerFailed(self.compiler_fn, e) from e
    torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised AssertionError: Torch not compiled with CUDA enabled

    Set torch._dynamo.config.verbose=True for more information


    You can suppress this exception and fall back to eager by setting:
        torch._dynamo.config.suppress_errors = True
```


### Additional information

_No response_