lshqqytiger / stable-diffusion-webui-amdgpu

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

[Bug]: launch.py: error: unrecognized arguments: --onnx #428

Closed vicroc4 closed 1 week ago

vicroc4 commented 8 months ago

Checklist

What happened?

When attempting to launch Webui with --onnx option, I get the following error:

launch.py: error: unrecognized arguments: --onnx

Steps to reproduce the problem

  1. Install Webui using recommended procedures
  2. Put --onnx --use-directml as launch arguments in webui-user.bat
  3. Launch Webui by running webui.user.bat

What should have happened?

Webui should launch with ONNX runtime enabled.

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome, Microsoft Edge

Sysinfo

sysinfo-2024-03-28-10-51.json

Console logs

venv "C:\Users\vicro\Documents\stable-diffusion-directml\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: 1.8.0-RC
Commit hash: 25a3b6cbeea8a07afd5e4594afc2f1c79f41ac1a
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
usage: launch.py [-h] [--update-all-extensions] [--skip-python-version-check] [--skip-torch-cuda-test]
                 [--reinstall-xformers] [--reinstall-torch] [--update-check] [--test-server] [--log-startup]
                 [--skip-prepare-environment] [--skip-install] [--skip-ort] [--dump-sysinfo] [--loglevel LOGLEVEL]
                 [--do-not-download-clip] [--data-dir DATA_DIR] [--config CONFIG] [--ckpt CKPT] [--ckpt-dir CKPT_DIR]
                 [--vae-dir VAE_DIR] [--gfpgan-dir GFPGAN_DIR] [--gfpgan-model GFPGAN_MODEL] [--no-half]
                 [--no-half-vae] [--no-progressbar-hiding] [--max-batch-count MAX_BATCH_COUNT]
                 [--embeddings-dir EMBEDDINGS_DIR] [--textual-inversion-templates-dir TEXTUAL_INVERSION_TEMPLATES_DIR]
                 [--hypernetwork-dir HYPERNETWORK_DIR] [--localizations-dir LOCALIZATIONS_DIR] [--allow-code]
                 [--medvram] [--medvram-sdxl] [--lowvram] [--lowram] [--always-batch-cond-uncond] [--unload-gfpgan]
                 [--precision {full,autocast}] [--upcast-sampling] [--share] [--ngrok NGROK]
                 [--ngrok-region NGROK_REGION] [--ngrok-options NGROK_OPTIONS] [--enable-insecure-extension-access]
                 [--codeformer-models-path CODEFORMER_MODELS_PATH] [--gfpgan-models-path GFPGAN_MODELS_PATH]
                 [--esrgan-models-path ESRGAN_MODELS_PATH] [--bsrgan-models-path BSRGAN_MODELS_PATH]
                 [--realesrgan-models-path REALESRGAN_MODELS_PATH] [--dat-models-path DAT_MODELS_PATH]
                 [--clip-models-path CLIP_MODELS_PATH] [--xformers] [--force-enable-xformers]
                 [--xformers-flash-attention] [--deepdanbooru] [--opt-split-attention] [--opt-sub-quad-attention]
                 [--sub-quad-q-chunk-size SUB_QUAD_Q_CHUNK_SIZE] [--sub-quad-kv-chunk-size SUB_QUAD_KV_CHUNK_SIZE]
                 [--sub-quad-chunk-threshold SUB_QUAD_CHUNK_THRESHOLD] [--opt-split-attention-invokeai]
                 [--opt-split-attention-v1] [--opt-sdp-attention] [--opt-sdp-no-mem-attention]
                 [--disable-opt-split-attention] [--disable-nan-check] [--use-cpu USE_CPU [USE_CPU ...]]
                 [--use-cpu-torch] [--use-directml] [--use-zluda] [--use-ipex]
                 [--disable-model-loading-ram-optimization] [--listen] [--port PORT] [--show-negative-prompt]
                 [--ui-config-file UI_CONFIG_FILE] [--hide-ui-dir-config] [--freeze-settings]
                 [--freeze-settings-in-sections FREEZE_SETTINGS_IN_SECTIONS]
                 [--freeze-specific-settings FREEZE_SPECIFIC_SETTINGS] [--ui-settings-file UI_SETTINGS_FILE]
                 [--gradio-debug] [--gradio-auth GRADIO_AUTH] [--gradio-auth-path GRADIO_AUTH_PATH]
                 [--gradio-img2img-tool GRADIO_IMG2IMG_TOOL] [--gradio-inpaint-tool GRADIO_INPAINT_TOOL]
                 [--gradio-allowed-path GRADIO_ALLOWED_PATH] [--opt-channelslast] [--styles-file STYLES_FILE]
                 [--autolaunch] [--theme THEME] [--use-textbox-seed] [--disable-console-progressbars]
                 [--enable-console-prompts] [--vae-path VAE_PATH] [--disable-safe-unpickle] [--api]
                 [--api-auth API_AUTH] [--api-log] [--nowebui] [--ui-debug-mode] [--device-id DEVICE_ID]
                 [--administrator] [--cors-allow-origins CORS_ALLOW_ORIGINS]
                 [--cors-allow-origins-regex CORS_ALLOW_ORIGINS_REGEX] [--tls-keyfile TLS_KEYFILE]
                 [--tls-certfile TLS_CERTFILE] [--disable-tls-verify] [--server-name SERVER_NAME] [--gradio-queue]
                 [--no-gradio-queue] [--skip-version-check] [--no-hashing] [--no-download-sd-model]
                 [--subpath SUBPATH] [--add-stop-route] [--api-server-stop] [--timeout-keep-alive TIMEOUT_KEEP_ALIVE]
                 [--disable-all-extensions] [--disable-extra-extensions] [--skip-load-model-at-start]
                 [--ldsr-models-path LDSR_MODELS_PATH] [--lora-dir LORA_DIR]
                 [--lyco-dir-backcompat LYCO_DIR_BACKCOMPAT] [--scunet-models-path SCUNET_MODELS_PATH]
                 [--swinir-models-path SWINIR_MODELS_PATH]
launch.py: error: unrecognized arguments: --onnx
Press any key to continue . . .

Additional information

Sysinfo generated without --onnx option because Webui won't even dump sysinfo with it in the command line.

lshqqytiger commented 8 months ago

https://github.com/lshqqytiger/stable-diffusion-webui-directml/discussions/149#discussioncomment-8392257

vicroc4 commented 8 months ago

#149 (comment)

Okay, I think I got a bit further after that. But now it's complaining that there's no module named "jsonmerge":

Traceback (most recent call last): File "c:\stableolive\stable-diffusion-webui-directml\launch.py", line 48, in main() File "c:\stableolive\stable-diffusion-webui-directml\launch.py", line 44, in main start() File "c:\stableolive\stable-diffusion-webui-directml\modules\launch_utils.py", line 666, in start import webui File "C:\stableolive\stable-diffusion-webui-directml\webui.py", line 13, in initialize.imports() File "C:\stableolive\stable-diffusion-webui-directml\modules\initialize.py", line 36, in imports shared_init.initialize() File "C:\stableolive\stable-diffusion-webui-directml\modules\shared_init.py", line 62, in initialize initialize_onnx() File "c:\stableolive\stable-diffusion-webui-directml\modules\onnx_impl__init.py", line 232, in initialize from .pipelines.onnx_stable_diffusion_pipeline import OnnxStableDiffusionPipeline File "c:\stableolive\stable-diffusion-webui-directml\modules\onnx_impl\pipelines__init__.py", line 15, in from modules.sd_models import CheckpointInfo File "C:\stableolive\stable-diffusion-webui-directml\modules\sd_models.py", line 17, in from modules import paths, shared, shared_items, modelloader, devices, script_callbacks, sd_vae, sd_disable_initialization, errors, hashes, sd_models_config, sd_unet, sd_models_xl, cache, extra_networks, processing, lowvram, sd_hijack, patches File "C:\stableolive\stable-diffusion-webui-directml\modules\sd_vae.py", line 5, in from modules import paths, shared, devices, script_callbacks, sd_models, extra_networks, lowvram, sd_hijack, hashes File "C:\stableolive\stable-diffusion-webui-directml\modules\sd_hijack.py", line 5, in from modules import devices, sd_hijack_optimizations, shared, script_callbacks, errors, sd_unet, patches File "C:\stableolive\stable-diffusion-webui-directml\modules\sd_hijack_optimizations.py", line 13, in from modules.hypernetworks import hypernetwork File "C:\stableolive\stable-diffusion-webui-directml\modules\hypernetworks\hypernetwork.py", line 13, in from modules import devices, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint, errors File "C:\stableolive\stable-diffusion-webui-directml\modules\sd_samplers.py", line 1, in from modules import sd_samplers_kdiffusion, sd_samplers_timesteps, sd_samplers_diffusers, sd_samplers_lcm, shared File "C:\stableolive\stable-diffusion-webui-directml\modules\sd_samplers_kdiffusion.py", line 3, in import k_diffusion.sampling File "C:\stableolive\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\init__.py", line 1, in from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils File "C:\stableolive\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\config.py", line 6, in from jsonmerge import merge ModuleNotFoundError: No module named 'jsonmerge'

lshqqytiger commented 8 months ago

This will solve the problem.

.\venv\Scripts\activate
pip install -r requirements.txt
vicroc4 commented 8 months ago

This will solve the problem.

.\venv\Scripts\activate
pip install -r requirements.txt

It did not. Same issue.

lshqqytiger commented 8 months ago

requirements.txt has jsonmerge: https://github.com/lshqqytiger/stable-diffusion-webui-directml/blob/ce3d044680100834e862bee6fefb413bfc835ece/requirements.txt#L13 Can you open and check your requirements.txt?

vicroc4 commented 8 months ago

My requirements.txt does have jsonmerge. I can attach it when I have a chance to get on my computer again if you need me to.

More pertinently, I tried reinstalling the requirements with pip again and it said that the requirement for jsonmerge was already satisfied by an existing installation.

On Fri, Mar 29, 2024, 1:09 AM Seunghoon Lee @.***> wrote:

requirements.txt has jsonmerge: https://github.com/lshqqytiger/stable-diffusion-webui-directml/blob/ce3d044680100834e862bee6fefb413bfc835ece/requirements.txt#L13 Can you open and check your requirements.txt?

— Reply to this email directly, view it on GitHub https://github.com/lshqqytiger/stable-diffusion-webui-directml/issues/428#issuecomment-2026658858, or unsubscribe https://github.com/notifications/unsubscribe-auth/APA5A7N2ZOKPYIZ6DHFW4BDY2TZP5AVCNFSM6AAAAABFMRX73CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRWGY2TQOBVHA . You are receiving this because you authored the thread.Message ID: @.*** com>

lshqqytiger commented 8 months ago

Make sure that you ran pip with virtual environment enabled.

ThisGameIsRyan commented 1 week ago

Hey, I am getting the same issue. :/

lshqqytiger commented 1 week ago

This issue was created 8 months ago, and is not valid now. Please describe the problem you have and create new issue if needed.