huchenlei / sd-webui-openpose-editor

Openpose editor for ControlNet. Full hand/face support.
MIT License
652 stars 64 forks source link

[Bug]: Extention error on startup with Vlad's fork #10

Closed Lalimec closed 1 year ago

Lalimec commented 1 year ago

Is there an existing issue for this?

What happened?

I am not sure if this is caused by extention or the webui fork but I couldnt manage to get it work. The way I use Vlad's forks is point it to my previous a1111 installation to get models, extensions, scripts etc. This also can be another reason for the error, combined with some other issues, i dont know.

Steps to reproduce the problem

  1. On Vlad's webui fork, install this repo

What should have happened?

Well.. It should've work 😄

Commit where the problem happens

webui: Vlad  Version: 82095082a Tue Jun 6 15:32:22 2023 -0400
controlnet: 2598ca9e
openpose-editor: b5d80988

What browsers do you use to access the UI ?

No response

Command Line Arguments

--insecure', '--data-dir',
                         '/home/ubuntu/stable-diffusion-webui/', '--listen',
                         '--theme', 'dark', '--disable-safe-unpickle',
                         '--cors-origins', 'http://localhost:9999',
                         '--cors-origins', 'https://www.painthua.com

Console logs

(vlad2) ubuntu@ip-172-31-37-133:~/vlad-webui$ bash webui.sh
Create and activate python venv
Launching launch.py...
22:22:00-253387 INFO     Extension preload: 0.0s
                         /home/ubuntu/vlad-webui/extensions-builtin
22:22:00-257208 INFO     Extension preload: 0.0s
                         /home/ubuntu/stable-diffusion-webui/extensions
22:22:00-258332 INFO     Starting SD.Next
22:22:00-259020 INFO     Python 3.10.11 on Linux
22:22:00-266760 INFO     Version: 82095082a Tue Jun 6 15:32:22 2023 -0400
22:22:00-482815 INFO     Latest published version:
                         4a3ab4ed3193ce82578e951a45dbee188214838c
                         2023-06-08T20:10:39Z
22:22:00-484594 INFO     Setting environment tuning
22:22:00-485546 INFO     nVidia CUDA toolkit detected
22:22:01-563432 INFO     Torch 2.0.1+cu118
22:22:01-608147 INFO     Torch backend: nVidia CUDA 11.8 cuDNN 8700
22:22:01-621710 INFO     Torch detected GPU: NVIDIA A10G VRAM 22581 Arch (8, 6)
                         Cores 80
22:22:01-623287 INFO     Verifying requirements
22:22:01-637496 INFO     Installing packages
22:22:01-646465 INFO     Enabled extensions-builtin:
                         ['stable-diffusion-webui-rembg', 'ScuNET',
                         'a1111-sd-webui-lycoris', 'Lora',
                         'sd-webui-agent-scheduler', 'clip-interrogator-ext',
                         'multidiffusion-upscaler-for-automatic1111', 'LDSR',
                         'sd-webui-controlnet', 'sd-webui-model-converter',
                         'sd-extension-system-info', 'sd-dynamic-thresholding',
                         'SwinIR', 'stable-diffusion-webui-images-browser']
22:22:01-648967 INFO     Enabled extensions: ['Abysz-LAB-Ext',
                         'Stable-Diffusion-Webui-Civitai-Helper',
                         'clip-interrogator-ext',
                         'Auto-Photoshop-StableDiffusion-Plugin',
                         'stable-diffusion-webui-anti-burn',
                         'multidiffusion-upscaler-for-automatic1111',
                         'stable-diffusion-webui-state', 'sd-dynamic-prompts',
                         'canvas-zoom', 'put extensions here.txt',
                         'sd-webui-additional-networks', 'adetailer',
                         'deforum-for-automatic1111-webui',
                         'sd-webui-regional-prompter', 'sd-webui-controlnet',
                         'sd-webui-infinite-image-browsing',
                         'sd-webui-openpose-editor', 'sdweb-merge-board',
                         'OneButtonPrompt',
                         'Hypernetwork-MonkeyPatch-Extension',
                         'SD-CN-Animation',
                         'stable-diffusion-webui-images-browser']
22:22:01-652293 INFO     Running setup
22:22:01-653018 INFO     Installing repositories
22:22:02-752122 INFO     Installing submodules
22:22:03-565556 INFO     Updating submodules
22:22:06-264263 INFO     Enabled extensions-builtin:
                         ['stable-diffusion-webui-rembg', 'ScuNET',
                         'a1111-sd-webui-lycoris', 'Lora',
                         'sd-webui-agent-scheduler', 'clip-interrogator-ext',
                         'multidiffusion-upscaler-for-automatic1111', 'LDSR',
                         'sd-webui-controlnet', 'sd-webui-model-converter',
                         'sd-extension-system-info', 'sd-dynamic-thresholding',
                         'SwinIR', 'stable-diffusion-webui-images-browser']
22:22:15-923167 INFO     Enabled extensions: ['Abysz-LAB-Ext',
                         'Stable-Diffusion-Webui-Civitai-Helper',
                         'clip-interrogator-ext',
                         'Auto-Photoshop-StableDiffusion-Plugin',
                         'stable-diffusion-webui-anti-burn',
                         'multidiffusion-upscaler-for-automatic1111',
                         'stable-diffusion-webui-state', 'sd-dynamic-prompts',
                         'canvas-zoom', 'put extensions here.txt',
                         'sd-webui-additional-networks', 'adetailer',
                         'deforum-for-automatic1111-webui',
                         'sd-webui-regional-prompter', 'sd-webui-controlnet',
                         'sd-webui-infinite-image-browsing',
                         'sd-webui-openpose-editor', 'sdweb-merge-board',
                         'OneButtonPrompt',
                         'Hypernetwork-MonkeyPatch-Extension',
                         'SD-CN-Animation',
                         'stable-diffusion-webui-images-browser']
22:22:31-872096 INFO     Extensions enabled: ['stable-diffusion-webui-rembg',
                         'ScuNET', 'a1111-sd-webui-lycoris', 'Lora',
                         'sd-webui-agent-scheduler', 'clip-interrogator-ext',
                         'multidiffusion-upscaler-for-automatic1111', 'LDSR',
                         'sd-webui-controlnet', 'sd-webui-model-converter',
                         'sd-extension-system-info', 'sd-dynamic-thresholding',
                         'SwinIR', 'stable-diffusion-webui-images-browser',
                         'Abysz-LAB-Ext',
                         'Stable-Diffusion-Webui-Civitai-Helper',
                         'Auto-Photoshop-StableDiffusion-Plugin',
                         'stable-diffusion-webui-anti-burn',
                         'stable-diffusion-webui-state', 'sd-dynamic-prompts',
                         'canvas-zoom', 'put extensions here.txt',
                         'sd-webui-additional-networks', 'adetailer',
                         'deforum-for-automatic1111-webui',
                         'sd-webui-regional-prompter',
                         'sd-webui-infinite-image-browsing',
                         'sd-webui-openpose-editor', 'sdweb-merge-board',
                         'OneButtonPrompt',
                         'Hypernetwork-MonkeyPatch-Extension',
                         'SD-CN-Animation']
22:22:31-874383 WARNING  Extensions duplicates: ['clip-interrogator-ext',
                         'multidiffusion-upscaler-for-automatic1111',
                         'sd-webui-controlnet',
                         'stable-diffusion-webui-images-browser']
22:22:31-875350 INFO     Updating Wiki
22:22:32-103143 INFO     Extension preload: 0.0s
                         /home/ubuntu/vlad-webui/extensions-builtin
22:22:32-104222 INFO     Extension preload: 0.0s
                         /home/ubuntu/stable-diffusion-webui/extensions
22:22:32-105075 INFO     Server arguments: ['--insecure', '--data-dir',
                         '/home/ubuntu/stable-diffusion-webui/', '--listen',
                         '--theme', 'dark', '--disable-safe-unpickle',
                         '--cors-origins', 'http://localhost:9999',
                         '--cors-origins', 'https://www.painthua.com']
No module 'xformers'. Proceeding without it.
22:22:36-573520 INFO     Libraries loaded
22:22:36-576967 INFO     Using data path: /home/ubuntu/stable-diffusion-webui/
22:22:36-583545 INFO     Available VAEs:
                         /home/ubuntu/stable-diffusion-webui/models/VAE 5
22:22:36-584521 INFO     Skipping conflicting extension:
                         /home/ubuntu/stable-diffusion-webui/extensions/clip-int
                         errogator-ext
22:22:36-585470 INFO     Skipping conflicting extension:
                         /home/ubuntu/stable-diffusion-webui/extensions/multidif
                         fusion-upscaler-for-automatic1111
22:22:36-586380 INFO     Skipping conflicting extension:
                         /home/ubuntu/stable-diffusion-webui/extensions/sd-webui
                         -controlnet
22:22:36-587237 INFO     Skipping conflicting extension:
                         /home/ubuntu/stable-diffusion-webui/extensions/stable-d
                         iffusion-webui-images-browser
22:22:36-678762 INFO     Available models:
                         /home/ubuntu/stable-diffusion-webui/models/Stable-diffu
                         sion 150
2023-06-08 22:22:38,548 - ControlNet - INFO - ControlNet v1.1.220
ControlNet preprocessor location: /home/ubuntu/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator
2023-06-08 22:22:38,726 - ControlNet - INFO - ControlNet v1.1.220
[-] ADetailer initialized. version: 23.6.2, num models: 8
python_server_full_path:  /home/ubuntu/stable-diffusion-webui/extensions/Auto-Photoshop-StableDiffusion-Plugin/server/python_server
22:22:40-134138 INFO     Libraries loaded
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: /home/ubuntu/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/setting.json
Civitai Helper: No setting file, use default
22:22:41-072025 INFO     Loading UI theme: name=gradio/monochrome style=Auto
LAB
*Deforum ControlNet support: enabled*
22:22:43-689460 INFO     Setting Torch parameters: dtype=torch.float16
                         vae=torch.float16 unet=torch.float16
Loading weights: /home/ubuntu/stable-diffusion-webui/models/Stable-diffusion/_…
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
22:22:44-244782 INFO     Model created from config:
                         /home/ubuntu/vlad-webui/configs/v1-inference.yaml
Loading weights: /home/ubuntu/stable-diffusion-webui/models/VAE/vae-ft-mse-840…
22:22:45-375216 INFO     Applying scaled dot product cross attention
                         optimization
22:22:45-418318 INFO     Embeddings loaded: 38 ['0lg4kury', 'anime512',
                         'AS-Young', 'AS-Young-neg', 'AS-Younger',
                         'AshleyCipher', 'Asian-Less', 'Asian-Less-Neg',
                         'Asian-Less-Toon', 'atompunkstylesd15', 'awful512',
                         'bad-hands-5', 'beauty512', 'CeceGiacinti',
                         'cherrynobodysd15', 'DaphneDimakos',
                         'dollienobodysd15', 'EasyNegative', 'eonn',
                         'evelynnobodysd15', 'flower_style', 'jane_noexist',
                         'kristennobodysd15', 'LulaCipher', 'nbdy-celeste-sd15',
                         'nbdy-scarlet-sd15', 'Neg512-neg', 'neg_anime512',
                         'neg_facelift512', 'neg_hands512-neg',
                         'neg_realism512', 'No512-neg', 'Portrait512',
                         'realisticvision-negative-embedding', 'render512',
                         'selfie512', 'StacyHiggins', 'VeronicaCipher']
22:22:45-426911 INFO     Model loaded in 1.8s (load=0.2s create=0.4s apply=0.4s
                         vae=0.4s move=0.2s)
22:22:45-737592 INFO     Model load finished: {'ram': {'used': 13.08, 'total':
                         31.01}, 'gpu': {'used': 2.32, 'total': 22.05},
                         'retries': 0, 'oom': 0}
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
22:22:46-245196 INFO     Local URL: http://localhost:7860/
22:22:46-246361 INFO     API Docs: http://localhost:7860/docs
22:22:46-247124 INFO     Initializing middleware
22:22:46-445125 INFO     [AgentScheduler] Task queue is empty
22:22:46-446175 INFO     [AgentScheduler] Registering APIs
22:22:46-474987 ERROR    executing callback:
                         /home/ubuntu/stable-diffusion-webui/extensions/sd-webui
                         -openpose-editor/scripts/openpose_editor.py
                         app_started_callback: FileNotFoundError
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/ubuntu/vlad-webui/modules/script_callbacks.py:134 in                   │
│ app_started_callback                                                         │
│                                                                              │
│   133 │   │   │   t0 = time.time()                                           │
│ ❱ 134 │   │   │   c.callback(demo, app)                                      │
│   135 │   │   │   timer(t0, c.script, 'app_started')                         │
│                                                                              │
│ /home/ubuntu/stable-diffusion-webui/extensions/sd-webui-openpose-editor/scri │
│ pts/openpose_editor.py:94 in mount_openpose_api                              │
│                                                                              │
│    93 │   if not getattr(shared.cmd_opts, "disable_openpose_editor_auto_upda │
│ ❱  94 │   │   update_app()                                                   │
│    95                                                                        │
│                                                                              │
│ /home/ubuntu/stable-diffusion-webui/extensions/sd-webui-openpose-editor/scri │
│ pts/openpose_editor.py:84 in update_app                                      │
│                                                                              │
│    83 │                                                                      │
│ ❱  84 │   package_version = get_version_from_package_json()                  │
│    85 │   current_version = get_current_release()                            │
│                                                                              │
│ /home/ubuntu/stable-diffusion-webui/extensions/sd-webui-openpose-editor/scri │
│ pts/openpose_editor.py:47 in get_version_from_package_json                   │
│                                                                              │
│    46 def get_version_from_package_json():                                   │
│ ❱  47 │   with open(os.path.join(EXTENSION_DIR, "package.json")) as f:       │
│    48 │   │   data = json.load(f)                                            │
╰──────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [Errno 2] No such file or directory:
'extensions/sd-webui-openpose-editor/package.json'
22:22:47-649723 INFO     Startup time: 15.5s (torch=2.3s gradio=1.1s
                         libraries=1.1s models=0.1s scripts=4.3s onchange=0.1s
                         ui=4.9s launch=0.3s scripts app_started_callback=0.7s
                         checkpoint=0.7s)

Browser logs

DevTools failed to load source map: Could not load content for chrome-extension://hnmpcagpplmpfojmgmnngilcnanddlhb/browser-polyfill.min.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/style.css?1684266234.2299151 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/canvas-zoom/style.css?1686084977.8827372 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/style.css?1686261619.421115 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-dynamic-prompts/style.css?1684924792.0358348 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-additional-networks/style.css?1684266524.1618602 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-infinite-image-browsing/style.css?1686140435.8720932 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-regional-prompter/style.css?1684266312.2821693 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:124     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/style.css?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
bboxHint.js?1685629836.567625:515 [Violation] Added synchronous DOM mutation listener to a 'DOMNodeInserted' event. Consider using MutationObserver to make the page more responsive.
(anonymous) @ bboxHint.js?1685629836.567625:515
0.0.0.0/:80     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/canvas-zoom/javascript/canvas-zoom.js?1686250752.2547798 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:81     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/javascript/deforum-hints.js?1686261619.3891149 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:82     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/javascript/deforum.js?1686261619.3891149 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:83     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-dynamic-prompts/javascript/dynamic_prompting.js?1685616117.948287 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:84     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-dynamic-prompts/javascript/dynamic_prompting_hints.js?1684266666.0735338 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:85     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-additional-networks/javascript/additional_networks.js?1684266524.1618602 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:86     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-infinite-image-browsing/javascript/index.js?1686140435.8720932 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:87     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/sdweb-merge-board/javascript/select_tab.js?1684266576.048864 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:88     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/javascript/civitai_helper.js?1684266234.2299151 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:89     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/javascript/state.app.js?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:90     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/javascript/state.constants.js?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:91     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/javascript/state.core.js?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:92     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/javascript/state.ext.control-net.js?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:93     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/javascript/state.store.js?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
0.0.0.0/:94     GET http://0.0.0.0:7860/file=/home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-state/javascript/state.utils.js?1684266321.0821226 net::ERR_ABORTED 403 (Forbidden)
openpose_editor.js?1686262924.9007835:3     GET http://0.0.0.0:7860/openpose_editor_index 404 (Not Found)
checkEditorAvailable @ openpose_editor.js?1686262924.9007835:3
(anonymous) @ openpose_editor.js?1686262924.9007835:99
contentscript.js:203 [Violation] 'requestAnimationFrame' handler took 333ms
script.js?1686087023.9528072:57 [Violation] 'setTimeout' handler took 58ms

Additional information

image image image image

Lalimec commented 1 year ago

I've fixed the issue by changing the EXTENSION_DIR in scripts/openpose_editor.py

EXTENSION_DIR = "/home/ubuntu/stable-diffusion-webui/extensions/sd-webui-openpose-editor"
DIST_DIR = f"{EXTENSION_DIR}/dist"

Probably caused by my vlad webui's and extensions' directories being different and "extensions/sd-webui-openpose-editor" got searched in vlad webui root.

huchenlei commented 1 year ago

Switched to get extension dir from WebUI.

EXTENSION_DIR = scripts.basedir()
DIST_DIR = os.path.join(EXTENSION_DIR, 'dist')

I probably should have done this from the very beginning.

Lalimec commented 1 year ago

Did you changed anything else?

│
│    23                                                                        │
│ ❱  24 EXTENSION_DIR = scripts.basedir()                                      │
│    25 DIST_DIR = os.path.join(EXTENSION_DIR, 'dist')                         │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'scripts' is not defined
huchenlei commented 1 year ago

Did you changed anything else?

│
│    23                                                                        │
│ ❱  24 EXTENSION_DIR = scripts.basedir()                                      │
│    25 DIST_DIR = os.path.join(EXTENSION_DIR, 'dist')                         │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'scripts' is not defined

The issue is fixed on the main branch. You just need to update to the most recent version. Scripts is imported from modules namespace.