AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: ''DepthModel' object has no attribute 'should_delete'' #10229

Closed marianobiotico closed 1 year ago

marianobiotico commented 1 year ago

Is there an existing issue for this?

What happened?

For a while this error began to appear when starting an animation in deforum. I already tried everything, and I see that the same thing is happening to other people but no one responds with a solution. Does anyone know what could be happening?

Steps to reproduce the problem

  1. start an animation normally in deforum

What should have happened?

This error is not normal, it has appeared from one moment to the next when an animation of 600 frames was canceled at 191 frames

Commit where the problem happens

http://127.0.0.1:7860

What platforms do you use to access the UI ?

Windows 10

What browsers do you use to access the UI ?

Firefox

112.0.2 (64-bit)

Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 22.6s (load scripts: 17.5s, reload script modules: 0.2s, create ui: 4.2s, gradio launch: 0.6s).
Deforum extension for auto1111 webui, v2.4b
Git commit: 6878a60b (Thu May  4 12:23:52 2023)
Video to extract: D:\clip_1.mp4
Extracting video (1 every 1) frames to D:\stable-diffusion-webui\outputs/img2img-images\venturapics\inputframes...
Trying to extract frames from video with input FPS of 23.976023976023978. Please wait patiently.
Frames already unpacked
Using 282 input frames from D:\stable-diffusion-webui\outputs/img2img-images\venturapics\inputframes...
Using init_image from video: D:\stable-diffusion-webui\outputs\img2img-images\venturapics\inputframes\clip_1000000001.jpg
Saving animation frames to:
D:\stable-diffusion-webui\outputs/img2img-images\venturapics

*START OF TRACEBACK*
Traceback (most recent call last):
  File "D:\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum.py", line 109, in run_deforum
    render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root.animation_prompts, root)
  File "D:\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\render.py", line 112, in render_animation
    depth_model = DepthModel(root.models_path, device, root.half_precision, keep_in_vram=keep_in_vram, depth_algorithm=anim_args.depth_algorithm, Width=args.W, Height=args.H, midas_weight=anim_args.midas_weight)
  File "D:\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\depth.py", line 29, in __new__
    model_deleted = cls._instance and cls._instance.should_delete
AttributeError: 'DepthModel' object has no attribute 'should_delete'
*END OF TRACEBACK*

User friendly error message:
Error: 'DepthModel' object has no attribute 'should_delete'. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.

List of extensions

Cozy-Nest https://github.com/Nevysha/Cozy-Nest.git 479195ab (Mon May 8 20:52:31 2023) unknown SD-CN-Animation https://github.com/volotat/SD-CN-Animation.git c987f645 (Sun May 7 22:19:50 2023) unknown batch-face-swap https://github.com/kex0/batch-face-swap.git 902d36ae (Wed May 3 06:50:19 2023) unknown ddetailer https://github.com/dustysys/ddetailer.git 22a17414 (Mon Nov 28 09:33:31 2022) unknown deforum-for-automatic1111-webui https://github.com/deforum-art/deforum-for-automatic1111-webui.git 6878a60b (Thu May 4 12:23:52 2023) unknown depth-image-io-for-SDWebui https://github.com/AnonymousCervine/depth-image-io-for-SDWebui.git eb22863d (Sat Feb 4 06:52:38 2023) unknown depthmap2mask https://github.com/Extraltodeus/depthmap2mask.git 377e9224 (Thu Apr 13 04:10:08 2023) unknown ebsynth_utility https://github.com/s9roll7/ebsynth_utility.git c255e64a (Sat Apr 22 00:49:32 2023) unknown infinite-zoom-automatic1111-webui https://github.com/v8hid/infinite-zoom-automatic1111-webui.git 1139764b (Wed May 3 17:08:52 2023) unknown multi-subject-render https://github.com/Extraltodeus/multi-subject-render.git 03427e26 (Mon Mar 6 14:11:30 2023) unknown sd-pixel https://github.com/Leodotpy/sd-pixel.git 6d35dec2 (Sat May 6 18:17:16 2023) unknown sd-webui-additional-networks https://github.com/kohya-ss/sd-webui-additional-networks.git 75141070 (Wed May 3 09:52:01 2023) unknown sd-webui-controlnet https://github.com/Mikubill/sd-webui-controlnet.git 5d387abf (Thu May 4 02:03:32 2023) unknown sd-webui-text2video https://github.com/deforum-art/sd-webui-text2video.git 4fea1ada (Sun Apr 23 10:39:51 2023) unknown sd_dreambooth_extension https://github.com/d8ahazard/sd_dreambooth_extension.git 926ae204 (Fri Mar 31 15:12:45 2023) unknown stable-diffusion-webui-images-browser https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git 2f5bbd88 (Wed May 3 21:17:36 2023) unknown xformers https://github.com/facebookresearch/xformers.git 6425fd0c (Fri Apr 28 08:34:25 2023) unknown LDSR built-in
Lora built-in
ScuNET built-in
SwinIR built-in
prompt-bracket-checker built-in

Console logs

venv "D:\stable-diffusion-webui\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)]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing requirements for Web UI
Installing requirements for Batch Face Swap

Fetching updates for midas...
Checking out commit for midas with hash: 1645b7e...

current transparent-background 1.2.3

Installing requirements 1 for Infinite-Zoom

Installing SD-CN-Animation requirement: scikit-image==0.19.2

Installing opencv-python
Installing opencv-python for pixel extension

If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision: 926ae204ef5de17efca2059c334b6098492a0641
Successfully installed fastapi-0.94.1 gitpython-3.1.31 google-auth-oauthlib-0.4.6 requests-2.30.0 transformers-4.26.1

Does your project take forever to startup?
Repetitive dependency installation may be the reason.
Automatic1111's base project sets strict requirements on outdated dependencies.
If an extension is using a newer version, the dependency is uninstalled and reinstalled twice every startup.

[+] xformers version 0.0.20.dev526 installed.
[+] torch version 2.0.0+cu118 installed.
[+] torchvision version 0.15.1+cu118 installed.
[+] accelerate version 0.18.0 installed.
[+] diffusers version 0.14.0 installed.
[+] transformers version 4.26.1 installed.
[+] bitsandbytes version 0.35.4 installed.

Launching Web UI with arguments: --xformers --no-half --disable-nan-check
Installing openmim
Installing mmcv-full
Error loading script: ddetailer.py
Traceback (most recent call last):
  File "D:\stable-diffusion-webui\modules\scripts.py", line 256, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "D:\stable-diffusion-webui\modules\script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\stable-diffusion-webui\extensions\ddetailer\scripts\ddetailer.py", line 61, in <module>
    startup()
  File "D:\stable-diffusion-webui\extensions\ddetailer\scripts\ddetailer.py", line 49, in startup
    run(f'"{python}" -m mim install mmcv-full', desc=f"Installing mmcv-full", errdesc=f"Couldn't install mmcv-full")
  File "D:\stable-diffusion-webui\launch.py", line 97, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install mmcv-full.
Command: "D:\stable-diffusion-webui\venv\Scripts\python.exe" -m mim install mmcv-full
Error code: 1
stdout: Looking in links: https://download.openmmlab.com/mmcv/dist/cu118/torch2.0.0/index.html
Collecting mmcv-full
  Using cached mmcv-full-1.7.1.tar.gz (605 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

stderr: WARNING: Ignoring invalid distribution -ransformers (d:\stable-diffusion-webui\venv\lib\site-packages)
WARNING: Ignoring invalid distribution -rotobuf (d:\stable-diffusion-webui\venv\lib\site-packages)
  error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1

  [14 lines of output]
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\elect\AppData\Local\Temp\pip-install-s2_zsiy1\mmcv-full_3710bfa36ed545ac800756a229db6730\setup.py", line 465, in <module>
      ext_modules=get_extensions(),
    File "C:\Users\elect\AppData\Local\Temp\pip-install-s2_zsiy1\mmcv-full_3710bfa36ed545ac800756a229db6730\setup.py", line 369, in get_extensions
      ext_ops = extension(
    File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1048, in CUDAExtension
      library_dirs += library_paths(cuda=True)
    File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py", line 1186, in library_paths
      paths.append(_join_cuda_home(lib_dir))
    File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\utils\cpp_extension.py", line 2223, in _join_cuda_home
      raise EnvironmentError('CUDA_HOME environment variable is not set. '
  OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[AddNet] Updating model hashes...
100%|████████████████████████████████████████████████████████████████████████████████| 25/25 [00:00<00:00, 3326.17it/s]
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████| 25/25 [00:00<00:00, 12523.30it/s]
ControlNet v1.1.134
ControlNet v1.1.134
Loading weights [9aba26abdf] from D:\stable-diffusion-webui\models\Stable-diffusion\deliberate_v2.safetensors
Creating model from config: D:\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded in 5.2s (load weights from disk: 0.3s, create model: 0.7s, apply weights to model: 1.0s, move model to device: 1.9s, load textual inversion embeddings: 1.3s).
*Deforum ControlNet support: enabled*
CUDA SETUP: Loading binary D:\stable-diffusion-webui\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cudaall.dll...
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 22.6s (load scripts: 17.5s, reload script modules: 0.2s, create ui: 4.2s, gradio launch: 0.6s).
Deforum extension for auto1111 webui, v2.4b
Git commit: 6878a60b (Thu May  4 12:23:52 2023)
Video to extract: D:\clip_1.mp4
Extracting video (1 every 1) frames to D:\stable-diffusion-webui\outputs/img2img-images\venturapics\inputframes...
Trying to extract frames from video with input FPS of 23.976023976023978. Please wait patiently.
Frames already unpacked
Using 282 input frames from D:\stable-diffusion-webui\outputs/img2img-images\venturapics\inputframes...
Using init_image from video: D:\stable-diffusion-webui\outputs\img2img-images\venturapics\inputframes\clip_1000000001.jpg
Saving animation frames to:
D:\stable-diffusion-webui\outputs/img2img-images\venturapics

*START OF TRACEBACK*
Traceback (most recent call last):
  File "D:\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum.py", line 109, in run_deforum
    render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root.animation_prompts, root)
  File "D:\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\render.py", line 112, in render_animation
    depth_model = DepthModel(root.models_path, device, root.half_precision, keep_in_vram=keep_in_vram, depth_algorithm=anim_args.depth_algorithm, Width=args.W, Height=args.H, midas_weight=anim_args.midas_weight)
  File "D:\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\depth.py", line 29, in __new__
    model_deleted = cls._instance and cls._instance.should_delete
AttributeError: 'DepthModel' object has no attribute 'should_delete'
*END OF TRACEBACK*

User friendly error message:
Error: 'DepthModel' object has no attribute 'should_delete'. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.

Additional information

No response

marianobiotico commented 1 year ago

I discovered that the error was that I was needing to do the animation in the resolution: 960x540. I went back to the usual resolutions and all is well.

yyheart commented 1 year ago

me too,only change resolution?

Yang9322 commented 1 year ago

I have the same problem and found that Reddit has a similar issue, but no one seems to have a solution.

rageprim commented 1 year ago

I got it worked by changing the resolution upwards but reinstalled the app and now it wont work again

cfreak1996 commented 1 year ago

any solution for the problem, I am facing same issue please help

fervguida commented 1 year ago

I have the same problem! Everything worked perfectly and all of a sudden this error appeared.

rageprim commented 1 year ago

any solution for the problem, I am facing same issue please help

I think mostly this is related to wrong or problematic commands in motion or prompts. First check all of the motion key frames or any other key framing. the format needs to be right (Example: 0: (25)) and be divided by an comma then check the prompts. the last line should not have "," after the double quotation. change the resolution to 512 * 512 if this worked then changed it back to 720 or any wanted resolution.

THEDARKDEACON commented 1 year ago

I had to change back to 2D to fix

Smileassassin-dongqingzhang commented 1 year ago

关键帧->3D->Depth Warping & FOV 取消Use depth warping前面的对勾

KanuToCL commented 1 year ago

Found that, in order to shake this bug away, just: hit 2D or 3D (the opposite of what you are trying to run), hit Generate, interrupt, relaunch and use your original preference of wither 2D or 3D.

It was related to this code snippet in stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\run_deforum.py in LINE 94

try: # dispatch to appropriate renderer JobStatusTracker().update_phase(job_id, DeforumJobPhase.GENERATING) JobStatusTracker().update_output_info(job_id, outdir=args.outdir, timestring=root.timestring) if anim_args.animation_mode == '2D' or anim_args.animation_mode == '3D': if anim_args.use_mask_video: render_animation_with_video_mask(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root) # allow mask video without an input video else: render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root) elif anim_args.animation_mode == 'Video Input': render_input_video(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root)#TODO: prettify code elif anim_args.animation_mode == 'Interpolation': render_interpolation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root) else: print('Other modes are not available yet!') except Exception as e: JobStatusTracker().fail_job(job_id, error_type="RETRYABLE", message="Generation error.") print("\n*START OF TRACEBACK*") traceback.print_exc() print("*END OF TRACEBACK*\n") print("User friendly error message:") print(f"Error: {e}. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \\.") return None, None, None, f"Error: '{e}'. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \\. Full error message is in your terminal/ cli." finally:

abuaysam commented 1 year ago

3D->Depth Warping & FOV > un check( Use depth warping) , that's work for me

2467916158 commented 11 months ago

关键帧->3D->Depth Warping & FOV 取消使用深度扭曲前面的对勾

牛逼

snoopy233pp commented 1 month ago

关键帧->3D->Depth Warping & FOV 取消Use depth warping前面的对勾

this work