Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TypeError: load() missing 1 required positional argument: 'map_location' using controlnet #449

Closed
4 of 6 tasks
ride5k opened this issue Apr 18, 2024 · 2 comments
Closed
4 of 6 tasks
Assignees
Labels
bug Something isn't working

Comments

@ride5k
Copy link

ride5k commented Apr 18, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

controlnet no longer works, console shows
TypeError: load() missing 1 required positional argument: 'map_location'

this occurs even when previewing CN output, as well as during image generation

Steps to reproduce the problem

Go to txt2img
enable controlnet / openpose / allow preview
upload image
click preview process button
gui displays ERROR

What should have happened?

controlnet should process the uploaded image and return a preview openpose

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2024-04-18-18-58.json

Console logs

venv "T:\auto1111\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.9.0-5-g74787236
Commit hash: 74787236d0ff94dc37506d198f3b2562991b8702
Installing sd-webui-controlnet requirement: changing albumentations version from 1.4.2 to 1.4.3
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\pytorch_lightning\utilities\distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
  rank_zero_deprecation(
Launching Web UI with arguments: --listen --no-half --precision full --theme=dark --disable-nan-check --disable-safe-unpickle --medvram --sub-quad-q-chunk-size 128 --sub-quad-kv-chunk-size 128 --sub-quad-chunk-threshold 20 --skip-torch-cuda-test --use-directml --api --cors-allow-origins=http://127.0.0.1:3456 --enable-insecure-extension-access --ckpt-dir=U:/extraSDstuff/U_models --skip-version-check --use-cpu gfpgan codeformer
ONNX: selected=DmlExecutionProvider, available=['DmlExecutionProvider', 'CPUExecutionProvider']
ControlNet preprocessor location: T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\downloads
2024-04-18 12:50:57,381 - ControlNet - INFO - ControlNet v1.1.444
2024-04-18 12:50:57,557 - ControlNet - INFO - ControlNet v1.1.444
Loading weights [15d2100594] from U:\extraSDstuff\U_models\.HDD\5done\amIReal_V44.safetensors
2024-04-18 12:50:57,786 - ControlNet - INFO - ControlNet UI callback registered.
Creating model from config: T:\auto1111\stable-diffusion-webui-directml\configs\v1-inference.yaml
Running on local URL:  http://0.0.0.0:7860
Applying attention optimization: V1... done.
Model loaded in 2.5s (load weights from disk: 0.5s, create model: 0.5s, apply weights to model: 0.4s, apply float(): 0.6s, calculate empty prompt: 0.5s).

To create a public link, set `share=True` in `launch()`.
Startup time: 13.3s (prepare environment: 11.4s, initialize shared: 1.1s, load scripts: 1.4s, create ui: 0.4s, gradio launch: 4.4s, add APIs: 0.3s).
2024-04-18 12:51:33,863 - ControlNet - INFO - Preview Resolution = 512
Traceback (most recent call last):
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "T:\auto1111\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\controlnet_ui\controlnet_ui_group.py", line 933, in run_annotator
    result = preprocessor.cached_call(
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\utils.py", line 81, in decorated_func
    return cached_func(*args, **kwargs)
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\utils.py", line 65, in cached_func
    return func(*args, **kwargs)
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\supported_preprocessor.py", line 170, in cached_call
    return self(*args, **kwargs)
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\legacy_preprocessors.py", line 97, in __call__
    result, is_image = self.call_function(
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 274, in run_model
    return remove_pad(self.model_openpose(
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 447, in __call__
    poses = self.detect_poses(oriImg, include_hand, include_face)
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 333, in detect_poses
    self.load_model()
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\openpose\__init__.py", line 220, in load_model
    self.body_estimation = Body(body_modelpath)
  File "T:\auto1111\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\openpose\body.py", line 19, in __init__
    model_dict = util.transfer(self.model, torch.load(model_path))
TypeError: load() missing 1 required positional argument: 'map_location'

Additional information

also created ticket with CN Mikubill/sd-webui-controlnet#2764

@ride5k
Copy link
Author

ride5k commented Apr 19, 2024

confirmed fixed. thank you for all your efforts!

@gudo09
Copy link

gudo09 commented Apr 22, 2024

confirmed fixed. thank you for all your efforts!

How do you fix it? I have the same issue

IllusiveMan196 added a commit to IllusiveMan196/stable-diffusion-webui-directml that referenced this issue May 10, 2024
commit 88c1224
Author: Seunghoon Lee <[email protected]>
Date:   Thu May 9 01:49:45 2024 +0900

    [DirectML] Fix samplers.

commit e2cbdab
Author: Seunghoon Lee <[email protected]>
Date:   Mon May 6 10:27:49 2024 +0900

    Fix bug.

commit 9514d91
Author: Seunghoon Lee <[email protected]>
Date:   Sun May 5 23:29:44 2024 +0900

    Fix ONNX/Olive.

commit 7fd77f2
Author: Seunghoon Lee <[email protected]>
Date:   Sun May 5 22:45:46 2024 +0900

    Fix ONNX/Olive generation.

commit 216340d
Author: Seunghoon Lee <[email protected]>
Date:   Sun May 5 20:10:54 2024 +0900

    Fix bug.

commit a92b859
Author: Seunghoon Lee <[email protected]>
Date:   Sun May 5 19:56:08 2024 +0900

    Support olive-ai 0.5.x.

commit 674c5ca
Author: Seunghoon Lee <[email protected]>
Date:   Tue Apr 30 16:12:53 2024 +0900

    Fix.

commit 89e60b8
Author: Seunghoon Lee <[email protected]>
Date:   Tue Apr 30 13:38:44 2024 +0900

    Rewrite ZLUDA installer.

commit 65588fc
Author: Seunghoon Lee <[email protected]>
Date:   Mon Apr 29 23:02:11 2024 +0900

    Fix.

commit 5d11e9c
Author: Seunghoon Lee <[email protected]>
Date:   Mon Apr 29 22:55:17 2024 +0900

    Bump ZLUDA.

commit 620b78c
Author: Seunghoon Lee <[email protected]>
Date:   Mon Apr 29 22:50:42 2024 +0900

    Improve ZLUDA installation.

commit 6130ef9
Merge: b7c5e60 1c0a0c4
Author: Seunghoon Lee <[email protected]>
Date:   Tue Apr 23 19:48:08 2024 +0900

    Merge remote-tracking branch 'upstream/master'

commit 1c0a0c4
Merge: e2b177c 7dfe959
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 18:00:36 2024 +0300

    Merge branch 'dev'

commit 7dfe959
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 18:00:23 2024 +0300

    update changelog

commit 8f64dad
Merge: e2b177c 821adc3
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 17:57:39 2024 +0300

    Merge pull request AUTOMATIC1111#15594 from AUTOMATIC1111/fix-get_crop_region_v2

    fix get_crop_region_v2

commit 821adc3
Author: w-e-w <[email protected]>
Date:   Mon Apr 22 23:03:27 2024 +0900

    fix get_crop_region_v2

    Co-Authored-By: Dowon <[email protected]>

commit e2b177c
Merge: e84703b e837124
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 12:26:24 2024 +0300

    Merge branch 'dev'

commit e837124
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 12:26:05 2024 +0300

    changelog

commit 3fdc3cf
Merge: 61f6479 e9809de
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 12:24:06 2024 +0300

    Merge pull request AUTOMATIC1111#15591 from AUTOMATIC1111/restore-1.8.0-style-naming-of-scripts

    Restore 1.8.0 style naming of scripts

commit e9809de
Author: w-e-w <[email protected]>
Date:   Mon Apr 22 18:21:48 2024 +0900

    restore 1.8.0-style naming of scripts

commit 61f6479
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 12:19:30 2024 +0300

    restore 1.8.0-style naming of scripts

commit e84703b
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 11:59:54 2024 +0300

    update changelog

commit e4aa0c3
Merge: a183ea4 6c7c176
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 11:50:34 2024 +0300

    Merge pull request AUTOMATIC1111#15587 from AUTOMATIC1111/fix-mistake-in-#15583

    fix mistake in AUTOMATIC1111#15583

commit a183ea4
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 22 11:49:55 2024 +0300

    undo adding scripts to sys.modules

commit 6c7c176
Author: w-e-w <[email protected]>
Date:   Mon Apr 22 00:10:49 2024 +0900

    fix mistake in AUTOMATIC1111#15583

commit e6a8d0b
Merge: d1998d7 db263df
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 18:06:40 2024 +0300

    Merge pull request AUTOMATIC1111#15583 from AUTOMATIC1111/get_crop_region_v2

    get_crop_region_v2

commit db263df
Author: w-e-w <[email protected]>
Date:   Sun Apr 21 19:34:11 2024 +0900

    get_crop_region_v2

commit d1998d7
Merge: c0eaeb1 8e1c356
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:43:19 2024 +0300

    Merge pull request AUTOMATIC1111#15531 from thatfuckingbird/fix-mistyped-function-name

    fix typo in function call (eror -> error)

commit c0eaeb1
Merge: 9bcfb92 a95326b
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:42:57 2024 +0300

    Merge pull request AUTOMATIC1111#15532 from huchenlei/fix_module

    Fix cls.__module__ value in extension script

commit 9bcfb92
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:41:28 2024 +0300

    rename logging from textual inversion to not confuse it with global logging module

commit d74fc56
Merge: a44ed23 63fd38a
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:23:38 2024 +0300

    Merge pull request AUTOMATIC1111#15547 from AUTOMATIC1111/numpy-DeprecationWarning-product---prod

    numpy DeprecationWarning product -> prod

commit a44ed23
Merge: daae178 9d4fdc4
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:22:58 2024 +0300

    Merge pull request AUTOMATIC1111#15555 from light-and-ray/fix_x1_upscalers

    fix x1 upscalers

commit daae178
Merge: ce19a7b 909c3df
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:22:30 2024 +0300

    Merge pull request AUTOMATIC1111#15560 from AUTOMATIC1111/api-downscale

    Remove API upscaling factor limits

commit ce19a7b
Merge: 8d6e72d 50190ca
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:22:04 2024 +0300

    Merge pull request AUTOMATIC1111#15544 from cabelo/master

    Compatibility with Debian 11, Fedora 34+ and openSUSE 15.4+

commit 8d6e72d
Merge: 6f4f6bf ba2a737
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:21:21 2024 +0300

    Merge pull request AUTOMATIC1111#15561 from speculativemoonstone/fix-launch-git-directories

    Allow webui.sh to be runnable from arbitrary directories containing a .git file

commit 6f4f6bf
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:18:58 2024 +0300

    add more info to the error message for AUTOMATIC1111#15567

commit 367b823
Merge: c8ac42a d212fb5
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:09:27 2024 +0300

    Merge pull request AUTOMATIC1111#15567 from AUTOMATIC1111/no-image-data-blocks-debug

    Hide 'No Image data blocks found.' message

commit c8ac42a
Merge: 449bc7b bba306d
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:07:58 2024 +0300

    Merge pull request AUTOMATIC1111#15533 from travisg/callback-fix

    fix: remove_callbacks_for_function should also remove from the ordered map

commit 449bc7b
Merge: 3810413 71314e4
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:06:45 2024 +0300

    Merge pull request AUTOMATIC1111#15534 from storyicon/fix-masking

    Fix images do not match / Coordinate 'right' is less than 'left'

commit 3810413
Merge: f8f5d6c b5b1487
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 07:00:28 2024 +0300

    Merge pull request AUTOMATIC1111#15581 from AUTOMATIC1111/FilenameGenerator-sampler-scheduler

    FilenameGenerator Sampler Scheduler

commit f8f5d6c
Merge: cde35be 5cb567c
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 06:59:56 2024 +0300

    Merge pull request AUTOMATIC1111#15577 from AUTOMATIC1111/api-get-schedulers

    Add schedulers API endpoint

commit cde35be
Merge: ff6f468 49fee7c
Author: AUTOMATIC1111 <[email protected]>
Date:   Sun Apr 21 06:59:38 2024 +0300

    Merge pull request AUTOMATIC1111#15582 from kaanyalova/avif-support

    Add avif support

commit 49fee7c
Author: kaanyalova <[email protected]>
Date:   Sat Apr 20 23:18:54 2024 +0300

    Add avif support

commit b5b1487
Author: w-e-w <[email protected]>
Date:   Sun Apr 21 02:26:50 2024 +0900

    FilenameGenerator Sampler Scheduler

commit 5cb567c
Author: missionfloyd <[email protected]>
Date:   Fri Apr 19 20:29:22 2024 -0600

    Add schedulers API endpoint

commit d212fb5
Author: missionfloyd <[email protected]>
Date:   Thu Apr 18 20:56:51 2024 -0600

    Hide 'No Image data blocks found.' message

commit b7c5e60
Author: Seunghoon Lee <[email protected]>
Date:   Fri Apr 19 10:09:47 2024 +0900

    Fix lshqqytiger#449.

commit 71314e4
Author: storyicon <[email protected]>
Date:   Thu Apr 18 11:59:25 2024 +0000

    feat:compatible with inconsistent/empty mask

    Signed-off-by: storyicon <[email protected]>

commit ba2a737
Author: Speculative Moonstone <[email protected]>
Date:   Thu Apr 18 04:25:32 2024 +0000

    Allow webui.sh to be runnable from directories containing a .git file

commit 909c3df
Author: missionfloyd <[email protected]>
Date:   Wed Apr 17 21:20:03 2024 -0600

    Remove API upscaling factor limits

commit 9d4fdc4
Author: Andray <[email protected]>
Date:   Thu Apr 18 01:53:23 2024 +0400

    fix x1 upscalers

commit 63fd38a
Author: w-e-w <[email protected]>
Date:   Wed Apr 17 15:44:49 2024 +0900

    numpy DeprecationWarning product -> prod

commit 50190ca
Author: Alessandro de Oliveira Faria (A.K.A. CABELO) <[email protected]>
Date:   Wed Apr 17 00:01:56 2024 -0300

    Compatibility with Debian 11, Fedora 34+ and openSUSE 15.4+

commit 0980fdf
Author: storyicon <[email protected]>
Date:   Tue Apr 16 07:35:33 2024 +0000

    fix: images do not match

    Signed-off-by: storyicon <[email protected]>

commit bba306d
Author: Travis Geiselbrecht <[email protected]>
Date:   Mon Apr 15 21:10:11 2024 -0700

    fix: remove callbacks properly in remove_callbacks_for_function()

    Like remove_current_script_callback just before, also remove from the
    ordered_callbacks_map to keep the callback map and ordered callback map
    in sync.

commit a95326b
Author: huchenlei <[email protected]>
Date:   Mon Apr 15 22:34:01 2024 -0400

    nit

commit 0f82948
Author: huchenlei <[email protected]>
Date:   Mon Apr 15 22:14:19 2024 -0400

    Fix cls.__module__

commit 8e1c356
Author: thatfuckingbird <[email protected]>
Date:   Mon Apr 15 21:17:24 2024 +0200

    fix typo in function call (eror -> error)

commit ff6f468
Merge: 3fadb4f adadb4e
Author: AUTOMATIC1111 <[email protected]>
Date:   Sat Apr 13 06:38:58 2024 +0300

    Merge branch 'master' into dev

commit 3fadb4f
Merge: ac8ffb3 592e40e
Author: AUTOMATIC1111 <[email protected]>
Date:   Thu Apr 11 19:33:55 2024 +0300

    Merge pull request AUTOMATIC1111#15492 from w-e-w/update-restricted_opts

    update restricted_opts

commit 592e40e
Author: w-e-w <[email protected]>
Date:   Thu Apr 11 22:51:29 2024 +0900

    update restricted_opts

commit 4068429
Author: storyicon <[email protected]>
Date:   Wed Apr 10 10:53:25 2024 +0000

    fix: Coordinate 'right' is less than 'left'

    Signed-off-by: storyicon <[email protected]>

commit ac8ffb3
Merge: a976f4d ef83f68
Author: AUTOMATIC1111 <[email protected]>
Date:   Tue Apr 9 16:00:56 2024 +0300

    Merge pull request AUTOMATIC1111#15470 from AUTOMATIC1111/read-infotext-Script-not-found

    error handling paste_field callables

commit ef83f68
Author: w-e-w <[email protected]>
Date:   Tue Apr 9 21:28:44 2024 +0900

    catch exception for all paste_fields callable

commit 600f339
Author: w-e-w <[email protected]>
Date:   Tue Apr 9 20:59:04 2024 +0900

    Warning when Script is not found

commit a976f4d
Merge: c48b6bf e3aabe6
Author: AUTOMATIC1111 <[email protected]>
Date:   Tue Apr 9 12:05:02 2024 +0300

    Merge pull request AUTOMATIC1111#15460 from AUTOMATIC1111/create_infotext-index-and-callable

    create_infotext allow index and callable, re-work Hires prompt infotext

commit c48b6bf
Merge: d9708c9 2580235
Author: AUTOMATIC1111 <[email protected]>
Date:   Tue Apr 9 11:00:30 2024 +0300

    Merge pull request AUTOMATIC1111#15465 from jordenyt/fix-extras-api-upscale-enabled

    Fix extra-single-image API not doing upscale failed

commit 2580235
Author: Jorden Tse <[email protected]>
Date:   Tue Apr 9 11:13:47 2024 +0800

    Fix extra-single-image API not doing upscale failed

commit d9708c9
Author: AUTOMATIC1111 <[email protected]>
Date:   Mon Apr 8 16:15:25 2024 +0300

    fix limited file write (thanks, Sylwia)

commit e3aabe6
Author: w-e-w <[email protected]>
Date:   Mon Apr 8 19:48:38 2024 +0900

    add documentation for create_infotext

commit 1e1176b
Author: w-e-w <[email protected]>
Date:   Mon Apr 8 18:18:33 2024 +0900

    non-serializable as None

commit 219e644
Author: w-e-w <[email protected]>
Date:   Mon Apr 8 01:41:52 2024 +0900

    re-work extra_generation_params for Hires prompt

commit 47ed9b2
Author: w-e-w <[email protected]>
Date:   Mon Apr 8 01:39:31 2024 +0900

    allow list or callables in generation_params

commit 6efdfe3
Author: w-e-w <[email protected]>
Date:   Sun Apr 7 22:58:12 2024 +0900

    if use use_main_prompt index = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants