stable-diffusion-webui COMMANDLINE_ARGS参数详解

强大的stable-diffusion-webui通过webui-user.bat/sh (Windows/Linux) 文件进行配置,今天的主角是COMMANDLINE_ARGS参数,以下就是COMMANDLINE_ARGS参数带详解,附送google翻译的描述。

Argument Command Value Default Description 描述(google翻译)
CONFIGURATION
-h, –help None FALSE Show this help message and exit. 显示此帮助消息并退出。
–exit Terminate after installation 安装后终止
–data-dir DATA_DIR ./ base path where all user data is stored 存储所有用户数据的基本路径
–config CONFIG configs/stable-diffusion/v1-inference.yaml Path to config which constructs model. 构造模型的配置路径。
–ckpt CKPT model.ckpt Path to checkpoint of Stable Diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded. 稳定扩散模型检查点的路径;如果指定,该检查点将被添加到检查点列表中并加载。
–ckpt-dir CKPT_DIR None Path to directory with Stable Diffusion checkpoints. 具有稳定扩散检查点的目录路径。
–no-download-sd-model None FALSE Don’t download SD1.5 model even if no model is found. 即使没有找到模型,也不要下载SD1.5模型。
–do-not-download-clip None FALSE do not download CLIP model even if it’s not included in the checkpoint 即使未包含在检查点中,也不要下载 CLIP 模型
–vae-dir VAE_PATH None Path to Variational Autoencoders model 变分自动编码器模型的路径
–vae-path VAE_PATH None Checkpoint to use as VAE; setting this argument 用作 VAE 的检查点;设置这个参数
–gfpgan-dir GFPGAN_DIR GFPGAN/ GFPGAN directory. GFPGAN 目录。
–gfpgan-model GFPGAN_MODEL GFPGAN model file name.
–codeformer-models-path CODEFORMER_MODELS_PATH models/Codeformer/ Path to directory with codeformer model file(s). 包含 Codeformer 模型文件的目录路径。
–gfpgan-models-path GFPGAN_MODELS_PATH models/GFPGAN Path to directory with GFPGAN model file(s). 包含 GFPGAN 模型文件的目录路径。
–esrgan-models-path ESRGAN_MODELS_PATH models/ESRGAN Path to directory with ESRGAN model file(s). 包含 ESRGAN 模型文件的目录路径。
–bsrgan-models-path BSRGAN_MODELS_PATH models/BSRGAN Path to directory with BSRGAN model file(s). 包含 BSRGAN 模型文件的目录路径。
–realesrgan-models-path REALESRGAN_MODELS_PATH models/RealESRGAN Path to directory with RealESRGAN model file(s). RealESRGAN 模型文件的目录路径。
–scunet-models-path SCUNET_MODELS_PATH models/ScuNET Path to directory with ScuNET model file(s). ScuNET 模型文件的目录路径。
–swinir-models-path SWINIR_MODELS_PATH models/SwinIR Path to directory with SwinIR and SwinIR v2 model file(s). 包含 SwinIR 和 SwinIR v2 模型文件的目录路径。
–ldsr-models-path LDSR_MODELS_PATH models/LDSR Path to directory with LDSR model file(s). 包含 LDSR 模型文件的目录路径。
–lora-dir LORA_DIR models/Lora Path to directory with Lora networks. Lora 网络目录的路径。
–clip-models-path CLIP_MODELS_PATH None Path to directory with CLIP model file(s). 包含 CLIP 模型文件的目录路径。
–embeddings-dir EMBEDDINGS_DIR embeddings/ Embeddings directory for textual inversion (default: embeddings). 用于文本反转的嵌入目录(默认值:嵌入)。
–textual-inversion-templates-dir TEXTUAL_INVERSION_TEMPLATES_DIR textual_inversion_templates Directory with textual inversion templates. 带有文本反转模板的目录。
–hypernetwork-dir HYPERNETWORK_DIR models/hypernetworks/ hypernetwork directory. 超网络目录。
–localizations-dir LOCALIZATIONS_DIR localizations/ Localizations directory. 本地化目录。
–styles-file STYLES_FILE styles.csv Filename to use for styles. 用于样式的文件名。
–ui-config-file UI_CONFIG_FILE ui-config.json Filename to use for UI configuration. 用于 UI 配置的文件名。
–no-progressbar-hiding None FALSE Do not hide progress bar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser). 不要在 gradio UI 中隐藏进度条(我们隐藏它是因为如果浏览器中有硬件加速,它会减慢 ML 速度)。
–max-batch-count MAX_BATCH_COUNT 16 Maximum batch count value for the UI. UI 的最大批次计数值。
–ui-settings-file UI_SETTINGS_FILE config.json Filename to use for UI settings. 用于 UI 设置的文件名。
–allow-code None FALSE Allow custom script execution from web UI. 允许从 Web UI 执行自定义脚本。
–share None FALSE Use share=True for gradio and make the UI accessible through their site. 用于share=Truegradio 并使 UI 可通过其网站访问。
–listen None FALSE Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests. 使用 0.0.0.0 作为服务器名称启动 gradio,允许响应网络请求。
–port PORT 7860 Launch gradio with given server port, you need root/admin rights for ports < 1024; defaults to 7860 if available. 使用给定的服务器端口启动 gradio,您需要端口 < 1024 的 root/admin 权限;如果可用,默认为 7860。
–hide-ui-dir-config None FALSE Hide directory configuration from web UI. 从 Web UI 隐藏目录配置。
–freeze-settings None FALSE disable editing settings 禁用编辑设置
–enable-insecure-extension-access None FALSE Enable extensions tab regardless of other options. 无论其他选项如何,都启用扩展选项卡。
–gradio-debug None FALSE Launch gradio with –debug option. 启动带有–debug选项的 gradio。
–gradio-auth GRADIO_AUTH None Set gradio authentication like username:password; or comma-delimit multiple like u1:p1,u2:p2,u3:p3. 设置 gradio 身份验证,例如username:password;或用逗号分隔多个,例如u1:p1,u2:p2,u3:p3.
–gradio-auth-path GRADIO_AUTH_PATH None Set gradio authentication file path ex. /path/to/auth/file same auth format as –gradio-auth. 设置gradio认证文件路径ex。/path/to/auth/file与 相同的身份验证格式–gradio-auth。
–disable-console-progressbars None FALSE Do not output progress bars to console. 不要将进度条输出到控制台。
–enable-console-prompts None FALSE Print prompts to console when generating with txt2img and img2img. 使用 txt2img 和 img2img 生成时将提示打印到控制台。
–api None FALSE Launch web UI with API. 使用 API 启动 Web UI。
–api-auth API_AUTH None Set authentication for API like username:password; or comma-delimit multiple like u1:p1,u2:p2,u3:p3. 设置 API 的身份验证,例如username:password;或用逗号分隔多个,例如u1:p1,u2:p2,u3:p3.
–api-log None FALSE Enable logging of all API requests. 启用所有 API 请求的日志记录。
–nowebui None FALSE Only launch the API, without the UI. 只启动 API,不启动 UI。
–ui-debug-mode None FALSE Don’t load model to quickly launch UI. 不要加载模型来快速启动 UI。
–device-id DEVICE_ID None Select the default CUDA device to use (export CUDA_VISIBLE_DEVICES=0,1 etc might be needed before). 选择要使用的默认 CUDA 设备(CUDA_VISIBLE_DEVICES=0,1之前可能需要导出等)。
–administrator None FALSE Administrator privileges. 管理员权限。
–cors-allow-origins CORS_ALLOW_ORIGINS None Allowed CORS origin(s) in the form of a comma-separated list (no spaces). 允许的 CORS 来源采用逗号分隔列表的形式(无空格)。
–cors-allow-origins-regex CORS_ALLOW_ORIGINS_REGEX None Allowed CORS origin(s) in the form of a single regular expression. 允许采用单个正则表达式形式的 CORS 来源。
–tls-keyfile TLS_KEYFILE None Partially enables TLS, requires –tls-certfile to fully function. 部分启用 TLS,需要–tls-certfile完全发挥作用。
–tls-certfile TLS_CERTFILE None Partially enables TLS, requires –tls-keyfile to fully function. 部分启用 TLS,需要–tls-keyfile完全发挥作用。
–disable-tls-verify None FALSE When passed, enables the use of self-signed certificates. 通过后,即可使用自签名证书。
–server-name SERVER_NAME None Sets hostname of server. 设置服务器的主机名。
–no-gradio-queue None FALSE Disables gradio queue; causes the webpage to use http requests instead of websockets; was the default in earlier versions. 禁用渐变队列;导致网页使用http请求而不是websocket;是早期版本中的默认值。
–gradio-allowed-path None None Add path to Gradio’s allowed_paths; make it possible to serve files from it. 添加Gradio的路径allowed_paths;使得可以从中提供文件。
–no-hashing None FALSE Disable SHA-256 hashing of checkpoints to help loading performance. 禁用检查点的 SHA-256 哈希以帮助加载性能。
–skip-version-check None FALSE Do not check versions of torch and xformers. 不要检查 torch 和 xformers 的版本。
–skip-python-version-check None FALSE Do not check versions of Python. 不检查 Python 的版本。
–skip-torch-cuda-test None FALSE Do not check if CUDA is able to work properly. 不检查CUDA是否能够正常工作。
–skip-install None FALSE Skip installation of packages. 跳过软件包的安装。
–loglevel None None log level; one of: CRITICAL, ERROR, WARNING, INFO, DEBUG 日志级别;以下之一:严重、错误、警告、信息、调试
–log-startup None FALSE launch.py argument: print a detailed log of what’s happening at startup launch.py​​ 参数:打印启动时发生的情况的详细日志
–api-server-stop None FALSE enable server stop/restart/kill via api 通过 api 启用服务器停止/重新启动/终止
–timeout-keep-alive int 30 set timeout_keep_alive for uvicorn 为 uvicorn 设置 timeout_keep_alive
PERFORMANCE
–xformers None FALSE Enable xformers for cross attention layers. 为交叉注意力层启用 xformers。
–force-enable-xformers None FALSE 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. 为交叉注意层启用 xformers,无论检查代码是否认为您可以运行它;如果这不起作用,请不要报告错误。
–xformers-flash-attention None FALSE Enable xformers with Flash Attention to improve reproducibility (supported for SD2.x or variant only). 启用带有 Flash Attention 的 xformers 以提高再现性(仅支持 SD2.x 或变体)。
–opt-sdp-attention None FALSE Enable scaled dot product cross-attention layer optimization; requires PyTorch 2.* 启用缩放点积交叉注意层优化;需要 PyTorch 2.*
–opt-sdp-no-mem-attention FALSE None Enable scaled dot product cross-attention layer optimization without memory efficient attention, makes image generation deterministic; requires PyTorch 2.* 启用缩放点积交叉注意力层优化,无需内存高效注意力,使图像生成具有确定性;需要 PyTorch 2.*
–opt-split-attention None FALSE Force-enables Doggettx’s cross-attention layer optimization. By default, it’s on for CUDA-enabled systems. 强制启用 Doggettx 的交叉注意力层优化。默认情况下,它在启用 CUDA 的系统上处于打开状态。
–opt-split-attention-invokeai None FALSE Force-enables InvokeAI’s cross-attention layer optimization. By default, it’s on when CUDA is unavailable. 强制启用 InvokeAI 的交叉注意力层优化。默认情况下,当 CUDA 不可用时它会打开。
–opt-split-attention-v1 None FALSE Enable older version of split attention optimization that does not consume all VRAM available. 启用旧版本的分割注意力优化,不会消耗所有可用的 VRAM。
–opt-sub-quad-attention None FALSE Enable memory efficient sub-quadratic cross-attention layer optimization. 实现内存高效的次二次交叉注意力层优化。
–sub-quad-q-chunk-size SUB_QUAD_Q_CHUNK_SIZE 1024 Query chunk size for the sub-quadratic cross-attention layer optimization to use. 用于次二次交叉注意力层优化的查询块大小。
–sub-quad-kv-chunk-size SUB_QUAD_KV_CHUNK_SIZE None KV chunk size for the sub-quadratic cross-attention layer optimization to use. 用于次二次交叉注意力层优化的 KV 块大小。
–sub-quad-chunk-threshold SUB_QUAD_CHUNK_THRESHOLD None The percentage of VRAM threshold for the sub-quadratic cross-attention layer optimization to use chunking. 使用分块进行次二次交叉注意力层优化的 VRAM 阈值的百分比。
–opt-channelslast None FALSE Enable alternative layout for 4d tensors, may result in faster inference only on Nvidia cards with Tensor cores (16xx and higher). 启用 4d 张量的替代布局,可能会导致仅在具有 Tensor 核心(16xx 及更高)的 Nvidia 卡上更快的推理。
–disable-opt-split-attention None FALSE Force-disables cross-attention layer optimization. 强制禁用交叉注意力层优化。
–disable-nan-check None FALSE Do not check if produced images/latent spaces have nans; useful for running without a checkpoint in CI. 不检查生成的图像/潜在空间是否有 nan;对于在 CI 中没有检查点的情况下运行很有用。
–use-cpu {all, sd, interrogate, gfpgan, bsrgan, esrgan, scunet, codeformer} None Use CPU as torch device for specified modules. 使用CPU作为指定模块的火炬设备。
–no-half None FALSE Do not switch the model to 16-bit floats. 不要将模型切换为 16 位浮点数。
–precision {full,autocast} autocast Evaluate at this precision. 以此精度进行评估。
–no-half-vae None FALSE Do not switch the VAE model to 16-bit floats. 不要将 VAE 模型切换为 16 位浮点数。
–upcast-sampling None FALSE Upcast sampling. No effect with –no-half. Usually produces similar results to –no-half with better performance while using less memory. 向上采样。对 没有影响–no-half。通常会–no-half在使用更少内存的情况下产生与更好性能类似的结果。
–medvram None FALSE Enable Stable Diffusion model optimizations for sacrificing a some performance for low VRAM usage. 启用稳定扩散模型优化,以牺牲一些性能来降低 VRAM 使用率。
–medvram-sdxl None FALSE enable –medvram optimization just for SDXL models –medvram仅针对 SDXL 模型启用优化
–lowvram None FALSE Enable Stable Diffusion model optimizations for sacrificing a lot of speed for very low VRAM usage. 启用稳定扩散模型优化,以牺牲大量速度以获得非常低的 VRAM 使用率。
–lowram None FALSE Load Stable Diffusion checkpoint weights to VRAM instead of RAM. 将稳定扩散检查点权重加载到 VRAM 而不是 RAM。
–disable-model-loading-ram-optimization None FALSE disable an optimization that reduces RAM use when loading a model 禁用加载模型时减少 RAM 使用的优化
FEATURES
–autolaunch None FALSE Open the web UI URL in the system’s default browser upon launch. 启动时在系统默认浏览器中打开 Web UI URL。
–theme None Unset Open the web UI with the specified theme (light or dark). If not specified, uses the default browser theme. light打开具有指定主题(或)的 Web UI dark。如果未指定,则使用默认浏览器主题。
–use-textbox-seed None FALSE Use textbox for seeds in UI (no up/down, but possible to input long seeds). 在 UI 中使用种子文本框(无向上/向下,但可以输入长种子)。
–disable-safe-unpickle None FALSE Disable checking PyTorch models for malicious code. 禁用检查 PyTorch 模型是否存在恶意代码。
–ngrok NGROK None ngrok authtoken, alternative to gradio –share. ngrok authtoken,gradio 的替代品–share。
–ngrok-region NGROK_REGION us The region in which ngrok should start. ngrok 应该启动的区域。
–update-check None None On startup, notifies whether or not your web UI version (commit) is up-to-date with the current master branch. 启动时,通知您的 Web UI 版本(提交)是否与当前主分支保持同步。
–update-all-extensions None None On startup, it pulls the latest updates for all extensions you have installed. 启动时,它会提取您已安装的所有扩展的最新更新。
–reinstall-xformers None FALSE Force-reinstall xformers. Useful for upgrading – but remove it after upgrading or you’ll reinstall xformers perpetually. 强制重新安装 xformers。对于升级很有用 – 但升级后将其删除,否则您将永久重新安装 xformers。
–reinstall-torch None FALSE Force-reinstall torch. Useful for upgrading – but remove it after upgrading or you’ll reinstall torch perpetually. 强制重新安装割炬。对于升级很有用 – 但升级后将其删除,否则您将永久重新安装 torch。
–tests TESTS FALSE Run test to validate web UI functionality, see wiki topic for more details. 运行测试以验证 Web UI 功能,请参阅 wiki 主题了解更多详细信息。
–no-tests None FALSE Do not run tests even if –tests option is specified. –tests即使指定了选项,也不运行测试。
–dump-sysinfo None FALSE launch.py argument: dump limited sysinfo file (without information about extensions, options) to disk and quit launch.py​​ 参数:将有限的 sysinfo 文件(没有有关扩展、选项的信息)转储到磁盘并退出
–disable-all-extensions None FALSE disable all non-built-in extensions from running 禁用所有非内置扩展运行
–disable-extra-extensions None FALSE disable all extensions from running 禁用所有扩展程序运行
DEFUNCT OPTIONS
–show-negative-prompt None FALSE No longer has an effect. 不再有效果。
–deepdanbooru None FALSE No longer has an effect. 不再有效果。
–unload-gfpgan None FALSE No longer has an effect. 不再有效果。
–gradio-img2img-tool GRADIO_IMG2IMG_TOOL None No longer has an effect. 不再有效果。
–gradio-inpaint-tool GRADIO_INPAINT_TOOL None No longer has an effect. 不再有效果。
–gradio-queue None FALSE No longer has an effect. 不再有效果。
–add-stop-route None FALSE No longer has an effect. 不再有效果。
–always-batch-cond-uncond None FALSE No longer has an effect, move into UI under Setting > Optimizations 不再有效果,移至UI下Setting > Optimizations

参考:https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注