AssertionError: extension access disabled because of command line flags解决方案

2024-03-27 1307阅读

温馨提示:这篇文章已超过394天没有更新,请注意相关的内容是否还可用!

本文收录于《AI绘画从入门到精通》专栏,专栏总目录:点这里,订阅后可阅读专栏内所有文章。

大家好,我是水滴~~

本文介绍在 Stable Diffusion WebUI 中安装插件时出现 AssertionError: extension access disabled because of command line flags 异常的解决方案,希望能对你有所帮助!

AssertionError: extension access disabled because of command line flags解决方案

文章目录

  • 问题描述
  • 解决方案

    问题描述

    今天在 Stable Diffusion WebUI 中安装插件时报了 AssertionError: extension access disabled because of command line flags 异常,中文意思是:由于命令行标志而禁用扩展访问。

    控制台异常内容:

    *** Arguments: ('https://github.com/continue-revolution/sd-webui-segment-anything.git', ['ads', 'localization', 'installed'], 0, 'segment-anything') {}
        Traceback (most recent call last):
          File "D:\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 57, in f
            res = list(func(*args, **kwargs))
          File "D:\StableDiffusion\stable-diffusion-webui\modules\ui_extensions.py", line 399, in install_extension_from_index
            ext_table, message = install_extension_from_url(None, url)
          File "D:\StableDiffusion\stable-diffusion-webui\modules\ui_extensions.py", line 344, in install_extension_from_url
            check_access()
          File "D:\StableDiffusion\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
    ---
    

    WebUI 界面中的异常提醒:

    AssertionError: extension access disabled because of command line flags解决方案

    解决方案

    经过一番摸索后,在官方找到了答案!

    原文:As extensions allow the user to install and run arbitrary code, this can be used maliciously, and is disabled by default when running with options that allow remote users to connect to the server (–share or --listen) - you’ll still have the UI, but trying to install anything will result in error. If you want to use those options and still be able to install extensions, use --enable-insecure-extension-access command line flag.

    中文意思:由于扩展允许用户安装和运行任意代码,这可以被恶意使用,并且在默认情况下,在运行允许远程用户连接到服务器的选项(--share或--listen)时禁用-您仍然拥有UI,但尝试安装任何东西都会导致错误。如果您希望使用这些选项并且仍然能够安装扩展,请使用--enable-insecure-extension-access命令行标志。

    原来是我开启了局域网访问,那就好办了,现在给出两种解决方案:

    • 将--share或--listen参数去掉,这样就无法局域网或外网访问了。
    • 添加 --enable-insecure-extension-access参数,这样不影响网络访问,也能安装插件。这个案例风险自己把控。
VPS购买请点击我

免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们,邮箱:ciyunidc@ciyunshuju.com。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!

目录[+]