AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.53k stars 26.88k forks source link

[Bug]: Failed to install extension in LAN #16313

Closed limin05030 closed 3 months ago

limin05030 commented 3 months ago

Checklist

What happened?

When I use 127.0.0.1:7860 (./webui. sh), I can install the extension normally through Install from URL. But when I use 192.168.1.162:7860 (./webui.sh --listen), installing the extension will result in the following error:

*** Error completing request
*** Arguments: ('', 'https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans.git', '') {}
    Traceback (most recent call last):
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/call_queue.py", line 74, in f
        res = list(func(*args, **kwargs))
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/ui_extensions.py", line 670, in <lambda>
        fn=modules.ui.wrap_gradio_call_no_job(lambda *args: [gr.update(), *install_extension_from_url(*args)], extra_outputs=[gr.update(), gr.update()]),
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/ui_extensions.py", line 345, in install_extension_from_url
        check_access()
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/ui_extensions.py", line 23, in check_access
        assert not shared.cmd_opts.disable_extension_access, "extension access disabled because of command line flags"
    AssertionError: extension access disabled because of command line flags

Steps to reproduce the problem

  1. Use ./webui.sh --listen start WebUI
  2. Use Extensions -> Install from URL download extension, For example https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans.git

What should have happened?

Can install extensions normally.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

{
    "Platform": "Linux-5.15.0-117-generic-x86_64-with-glibc2.31",
    "Python": "3.10.14",
    "Version": "v1.10.1",
    "Commit": "82a973c04367123ae98bd9abdf80d9eda9b910e2",
    "Git status": "On branch master\nYour branch is up to date with 'origin/master'.\n\nnothing to commit, working tree clean",
    "Script path": "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui",
    "Data path": "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui",
    "Extensions dir": "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/extensions",
    "Checksum": "17bf3d07adc4669308f1cd8d6524efcaee52e322747fbb570dcf9cfdab62427e",
    "Commandline": [
        "launch.py",
        "--listen"
    ],
    "Torch env info": {
        "torch_version": "2.1.2+cu121",
        "is_debug_build": "False",
        "cuda_compiled_version": "12.1",
        "gcc_version": "(Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0",
        "clang_version": "10.0.0-4ubuntu1 ",
        "cmake_version": "version 3.16.3",
        "os": "Ubuntu 20.04.6 LTS (x86_64)",
        "libc_version": "glibc-2.31",
        "python_version": "3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0] (64-bit runtime)",
        "python_platform": "Linux-5.15.0-117-generic-x86_64-with-glibc2.31",
        "is_cuda_available": "True",
        "cuda_runtime_version": "12.2.140",
        "cuda_module_loading": "LAZY",
        "nvidia_driver_version": "550.90.07",
        "nvidia_gpu_models": "GPU 0: NVIDIA GeForce RTX 3090",
        "cudnn_version": null,
        "pip_version": "pip3",
        "pip_packages": [
            "numpy==1.26.2",
            "open-clip-torch==2.20.0",
            "pytorch-lightning==1.9.4",
            "torch==2.1.2+cu121",
            "torchdiffeq==0.2.3",
            "torchmetrics==1.4.0.post0",
            "torchsde==0.2.6",
            "torchvision==0.16.2+cu121",
            "triton==2.1.0"
        ],
        "conda_packages": "",
        "hip_compiled_version": "N/A",
        "hip_runtime_version": "N/A",
        "miopen_runtime_version": "N/A",
        "caching_allocator_config": "",
        "is_xnnpack_available": "True",
        "cpu_info": [
            "Architecture:                         x86_64",
            "CPU op-mode(s):                       32-bit, 64-bit",
            "Byte Order:                           Little Endian",
            "Address sizes:                        39 bits physical, 48 bits virtual",
            "CPU(s):                               16",
            "On-line CPU(s) list:                  0-15",
            "Thread(s) per core:                   1",
            "Core(s) per socket:                   10",
            "Socket(s):                            1",
            "NUMA node(s):                         1",
            "Vendor ID:                            GenuineIntel",
            "CPU family:                           6",
            "Model:                                151",
            "Model name:                           12th Gen Intel(R) Core(TM) i5-12600KF",
            "Stepping:                             2",
            "CPU MHz:                              3700.000",
            "CPU max MHz:                          4900.0000",
            "CPU min MHz:                          800.0000",
            "BogoMIPS:                             7372.80",
            "Virtualization:                       VT-x",
            "L1d cache:                            240 KiB",
            "L1i cache:                            160 KiB",
            "L2 cache:                             6.3 MiB",
            "NUMA node0 CPU(s):                    0-15",
            "Vulnerability Gather data sampling:   Not affected",
            "Vulnerability Itlb multihit:          Not affected",
            "Vulnerability L1tf:                   Not affected",
            "Vulnerability Mds:                    Not affected",
            "Vulnerability Meltdown:               Not affected",
            "Vulnerability Mmio stale data:        Not affected",
            "Vulnerability Reg file data sampling: Mitigation; Clear Register File",
            "Vulnerability Retbleed:               Not affected",
            "Vulnerability Spec rstack overflow:   Not affected",
            "Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl and seccomp",
            "Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization",
            "Vulnerability Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S",
            "Vulnerability Srbds:                  Not affected",
            "Vulnerability Tsx async abort:        Not affected",
            "Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr flush_l1d arch_capabilities"
        ]
    },
    "Exceptions": [],
    "CPU": {
        "model": "x86_64",
        "count logical": 16,
        "count physical": 10
    },
    "RAM": {
        "total": "31GB",
        "used": "2GB",
        "free": "716MB",
        "active": "11GB",
        "inactive": "18GB",
        "buffers": "244MB",
        "cached": "28GB",
        "shared": "18MB"
    },
    "Extensions": [],
    "Inactive extensions": [],
    "Environment": {
        "GIT": "git",
        "GRADIO_ANALYTICS_ENABLED": "False"
    },
    "Config": {
        "ldsr_steps": 100,
        "ldsr_cached": false,
        "SCUNET_tile": 256,
        "SCUNET_tile_overlap": 8,
        "SWIN_tile": 192,
        "SWIN_tile_overlap": 8,
        "SWIN_torch_compile": false,
        "hypertile_enable_unet": false,
        "hypertile_enable_unet_secondpass": false,
        "hypertile_max_depth_unet": 3,
        "hypertile_max_tile_unet": 256,
        "hypertile_swap_size_unet": 3,
        "hypertile_enable_vae": false,
        "hypertile_max_depth_vae": 3,
        "hypertile_max_tile_vae": 128,
        "hypertile_swap_size_vae": 3,
        "sd_model_checkpoint": "v1-5-pruned-emaonly.safetensors [6ce0161689]",
        "sd_checkpoint_hash": "6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa"
    },
    "Startup": {
        "total": 3.6491878032684326,
        "records": {
            "initial startup": 0.003630399703979492,
            "prepare environment/checks": 4.601478576660156e-05,
            "prepare environment/git version info": 0.0045778751373291016,
            "prepare environment/torch GPU test": 0.8092715740203857,
            "prepare environment/clone repositores": 0.035086870193481445,
            "prepare environment/run extensions installers": 9.393692016601562e-05,
            "prepare environment": 0.8704712390899658,
            "launcher": 0.000278472900390625,
            "import torch": 1.230853796005249,
            "import gradio": 0.31851983070373535,
            "setup paths": 0.41629719734191895,
            "import ldm": 0.0015864372253417969,
            "import sgm": 3.337860107421875e-06,
            "initialize shared": 0.0903775691986084,
            "other imports": 0.20444822311401367,
            "opts onchange": 0.00018978118896484375,
            "setup SD model": 2.8133392333984375e-05,
            "setup codeformer": 0.0002510547637939453,
            "setup gfpgan": 0.002482175827026367,
            "set samplers": 1.3828277587890625e-05,
            "list extensions": 0.00040078163146972656,
            "restore config state file": 4.76837158203125e-06,
            "list SD models": 0.0041730403900146484,
            "list localizations": 6.67572021484375e-05,
            "load scripts/custom_code.py": 0.0004630088806152344,
            "load scripts/img2imgalt.py": 0.0001392364501953125,
            "load scripts/loopback.py": 6.937980651855469e-05,
            "load scripts/outpainting_mk_2.py": 7.915496826171875e-05,
            "load scripts/poor_mans_outpainting.py": 5.364418029785156e-05,
            "load scripts/postprocessing_codeformer.py": 4.506111145019531e-05,
            "load scripts/postprocessing_gfpgan.py": 3.790855407714844e-05,
            "load scripts/postprocessing_upscale.py": 8.559226989746094e-05,
            "load scripts/prompt_matrix.py": 6.246566772460938e-05,
            "load scripts/prompts_from_file.py": 0.00011348724365234375,
            "load scripts/sd_upscale.py": 5.650520324707031e-05,
            "load scripts/xyz_grid.py": 0.0007920265197753906,
            "load scripts/ldsr_model.py": 0.1080787181854248,
            "load scripts/lora_script.py": 0.05005359649658203,
            "load scripts/scunet_model.py": 0.00826263427734375,
            "load scripts/swinir_model.py": 0.008092880249023438,
            "load scripts/hotkey_config.py": 7.081031799316406e-05,
            "load scripts/extra_options_section.py": 8.20159912109375e-05,
            "load scripts/hypertile_script.py": 0.016559600830078125,
            "load scripts/postprocessing_autosized_crop.py": 9.107589721679688e-05,
            "load scripts/postprocessing_caption.py": 5.0067901611328125e-05,
            "load scripts/postprocessing_create_flipped_copies.py": 3.9577484130859375e-05,
            "load scripts/postprocessing_focal_crop.py": 0.0002963542938232422,
            "load scripts/postprocessing_split_oversized.py": 5.221366882324219e-05,
            "load scripts/soft_inpainting.py": 0.00012421607971191406,
            "load scripts/comments.py": 0.008191585540771484,
            "load scripts/refiner.py": 8.487701416015625e-05,
            "load scripts/sampler.py": 6.222724914550781e-05,
            "load scripts/seed.py": 0.00012350082397460938,
            "load scripts": 0.2023303508758545,
            "load upscalers": 0.0005490779876708984,
            "refresh VAE": 0.00037932395935058594,
            "refresh textual inversion templates": 1.9311904907226562e-05,
            "scripts list_optimizers": 0.00015997886657714844,
            "scripts list_unets": 1.0013580322265625e-05,
            "reload hypernetworks": 0.00022840499877929688,
            "initialize extra networks": 0.0006251335144042969,
            "scripts before_ui_callback": 0.0002117156982421875,
            "create ui": 0.2686192989349365,
            "gradio launch": 0.04978466033935547,
            "add APIs": 0.003467559814453125,
            "app_started_callback/lora_script.py": 0.00016498565673828125,
            "app_started_callback": 0.0001685619354248047
        }
    },
    "Packages": [
        "accelerate==0.21.0",
        "aenum==3.1.15",
        "aiofiles==23.2.1",
        "aiohappyeyeballs==2.3.4",
        "aiohttp==3.10.0",
        "aiosignal==1.3.1",
        "altair==5.3.0",
        "antlr4-python3-runtime==4.9.3",
        "anyio==3.7.1",
        "async-timeout==4.0.3",
        "attrs==23.2.0",
        "blendmodes==2022",
        "certifi==2024.7.4",
        "charset-normalizer==3.3.2",
        "clean-fid==0.1.35",
        "click==8.1.7",
        "clip @ https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip#sha256=b5842c25da441d6c581b53a5c60e0c2127ebafe0f746f8e15561a006c6c3be6a",
        "contourpy==1.2.1",
        "cycler==0.12.1",
        "deprecation==2.1.0",
        "diskcache==5.6.3",
        "einops==0.4.1",
        "exceptiongroup==1.2.2",
        "facexlib==0.3.0",
        "fastapi==0.94.0",
        "ffmpy==0.4.0",
        "filelock==3.15.4",
        "filterpy==1.4.5",
        "fonttools==4.53.1",
        "frozenlist==1.4.1",
        "fsspec==2024.6.1",
        "ftfy==6.2.0",
        "gitdb==4.0.11",
        "GitPython==3.1.32",
        "gradio==3.41.2",
        "gradio_client==0.5.0",
        "h11==0.12.0",
        "httpcore==0.15.0",
        "httpx==0.24.1",
        "huggingface-hub==0.24.5",
        "idna==3.7",
        "imageio==2.34.2",
        "importlib_resources==6.4.0",
        "inflection==0.5.1",
        "Jinja2==3.1.4",
        "jsonmerge==1.8.0",
        "jsonschema==4.23.0",
        "jsonschema-specifications==2023.12.1",
        "kiwisolver==1.4.5",
        "kornia==0.6.7",
        "lark==1.1.2",
        "lazy_loader==0.4",
        "lightning-utilities==0.11.6",
        "llvmlite==0.43.0",
        "MarkupSafe==2.1.5",
        "matplotlib==3.9.1",
        "mpmath==1.3.0",
        "multidict==6.0.5",
        "networkx==3.3",
        "numba==0.60.0",
        "numpy==1.26.2",
        "omegaconf==2.2.3",
        "open-clip-torch==2.20.0",
        "opencv-python==4.10.0.84",
        "orjson==3.10.6",
        "packaging==24.1",
        "pandas==2.2.2",
        "piexif==1.1.3",
        "Pillow==9.5.0",
        "pillow-avif-plugin==1.4.3",
        "pip==24.2",
        "protobuf==3.20.0",
        "psutil==5.9.5",
        "pydantic==1.10.17",
        "pydub==0.25.1",
        "pyparsing==3.1.2",
        "python-dateutil==2.9.0.post0",
        "python-multipart==0.0.9",
        "pytorch-lightning==1.9.4",
        "pytz==2024.1",
        "PyWavelets==1.6.0",
        "PyYAML==6.0.1",
        "referencing==0.35.1",
        "regex==2024.7.24",
        "requests==2.32.3",
        "resize-right==0.0.2",
        "rpds-py==0.19.1",
        "safetensors==0.4.2",
        "scikit-image==0.21.0",
        "scipy==1.14.0",
        "semantic-version==2.10.0",
        "sentencepiece==0.2.0",
        "setuptools==69.5.1",
        "six==1.16.0",
        "smmap==5.0.1",
        "sniffio==1.3.1",
        "spandrel==0.3.4",
        "spandrel_extra_arches==0.1.1",
        "starlette==0.26.1",
        "sympy==1.13.1",
        "tifffile==2024.7.24",
        "timm==1.0.8",
        "tokenizers==0.13.3",
        "tomesd==0.1.3",
        "toolz==0.12.1",
        "torch==2.1.2+cu121",
        "torchdiffeq==0.2.3",
        "torchmetrics==1.4.0.post0",
        "torchsde==0.2.6",
        "torchvision==0.16.2+cu121",
        "tqdm==4.66.4",
        "trampoline==0.1.2",
        "transformers==4.30.2",
        "triton==2.1.0",
        "typing_extensions==4.12.2",
        "tzdata==2024.1",
        "urllib3==2.2.2",
        "uvicorn==0.30.4",
        "wcwidth==0.2.13",
        "websockets==11.0.3",
        "yarl==1.9.4"
    ]
}

Console logs

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on ll user
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.31
Cannot locate TCMalloc. Do you have tcmalloc or google-perftool installed on your system? (improves CPU memory usage)
Python 3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: --listen
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 3.6s (prepare environment: 0.9s, import torch: 1.2s, import gradio: 0.3s, setup paths: 0.4s, other imports: 0.2s, load scripts: 0.2s, create ui: 0.3s).
Creating model from config: /home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/configs/v1-inference.yaml
/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:1150: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Applying attention optimization: Doggettx... done.
Model loaded in 1.8s (load weights from disk: 0.3s, create model: 0.2s, apply weights to model: 1.1s).
*** Error completing request
*** Arguments: ('', 'https://github.com/hanamizuki-ai/stable-diffusion-webui-localization-zh_Hans.git', '') {}
    Traceback (most recent call last):
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/call_queue.py", line 74, in f
        res = list(func(*args, **kwargs))
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/ui_extensions.py", line 670, in <lambda>
        fn=modules.ui.wrap_gradio_call_no_job(lambda *args: [gr.update(), *install_extension_from_url(*args)], extra_outputs=[gr.update(), gr.update()]),
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/ui_extensions.py", line 345, in install_extension_from_url
        check_access()
      File "/home/ll/Image/AUTOMATIC1111/stable-diffusion-webui/modules/ui_extensions.py", line 23, in check_access
        assert not shared.cmd_opts.disable_extension_access, "extension access disabled because of command line flags"
    AssertionError: extension access disabled because of command line flags

---

Additional information

No response

w-e-w commented 3 months ago

this is intended behavior allowing extensions to be installed when accessible from another computer is Arbitrary Remote Code Execution

read wiki search for --enable-insecure-exten ...... https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings

DO NOT USE this flag when you don't need it

limin05030 commented 3 months ago

this is intended behavior allowing extensions to be installed when accessible from another computer is Arbitrary Remote Code Execution

read wiki search for --enable-insecure-exten ...... https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings

DO NOT USE this flag when you don't need it

Thank you very much for your answer.

If that's the case, I suggest adding a clear indication on the UI that this behavior is not supported. Even adding relevant prompts in the log is acceptable, otherwise for newcomers, they may not know how to handle such issues unless they read the document thoroughly.