deforum-art / deforum-stable-diffusion

https://deforum.github.io/
Other
2.2k stars 387 forks source link

RecursionError: maximum recursion depth exceeded in comparison #173

Closed Vendaciousness closed 1 year ago

Vendaciousness commented 1 year ago

(Using Automatic1111/stable-diffusion-webui) Saw a similar bug, but there was no traceback, so I'll put up mine. This happened on frame 715/900. Every long render I've done (over 240 frames) has ended this way in the last few days.

Deforum progress: 60092it [11:48:29,  1.41it/s]
Error completing request
Arguments: ('task(48ymrksf2cxqv12)', None, False, '', '3D', 900, 'wrap', '0:(0)', '0: ((0.005 * cos((120 / 60 * 3.141 * (t + 0) / 30))**1 + 1.010))', '0:(0.005)', '0:(0)', '0: ((0.05 * cos((120 / 60 * 3.141 * (t + 0) / 30))**1 + 1.10))', '0:(0)', '0:(0)', '0:(0)', '0:(0)', '0:(0)', False, '0:(0)', '0:(0)', '0:(0)', '0:(53)', '0: (0.065)', '0: (0.75)', '0: (1.0)', '0: (20)', '0:(1.5)', False, '0:(1)', '0:(0)', False, '0: (25)', '0: (95)', '0: (1)', '0: (200)', '0: (10000)', '0:(s), 1:(-1), "max_f-2":(-1), "max_f-1":(s)', False, '0: ("Euler a")', '0: ("{video_mask}")', False, '0: ("{video_mask}")', False, '0: ("model1.ckpt"), 100: ("model2.ckpt")', False, '0: (2)', False, '0: (1.05)', '0: (5)', '0: (1.0)', '0: (0.1)', '0: (0.0)', 'HSV', '', 1.0, False, 1, 'DIS Fine', True, 10, 'perlin', 8, 8, 4, 0.5, True, 0.2, 'border', 'bicubic', False, 'C:\\Users\\illi\\Pictures\\Input\\blank.mp4', 1, 0, -1, False, False, 'https://deforum.github.io/a1/VM1.mp4', False, '20230129210106', '{\n    "0": "an equirectangular image of an epic elegant masterpiece mysterious sci-fi matte painting of a crystal cavern full of precious glowing faceted gems lit from within, digital art, dynamic lighting, vibrant colors by  cyril rolando and natalie shau insanely detailed and intricate  --neg animation_prompts_negative\\": \\"humans, character, 1man, 1girl, 1woman, 1child, pets, 1cat, Blurry, ((overexposed)), bad anatomy, deformed, blurred, motion blur, ugly, distorted, deformed, deformation, distortion, artifacts, low quality"\n}', '', '', 1024, 512, True, False, -1, 'Euler a', False, 0, 0, 25, 0.0, 1, True, True, False, False, False, 'Deforum_20230403140440', '{timestring}_{index}_{prompt}.png', 'iter', 1, False, False, True, 0.11, None, False, False, False, False, 'https://deforum.github.io/a1/M1.jpg', 1.0, 1.0, 4, 1, False, 4, 'reroll', 10.0, False, 30, False, False, 'FFMPEG mp4', 'C:\\Users\\Illi\\stable-diffusion-webui\\venv\\lib\\site-packages\\imageio_ffmpeg\\binaries\\ffmpeg-win64-v4.2.2.exe', '17', 'slow', 'None', 'https://deforum.github.io/a1/A1.mp3', False, 'realesr-animevideov3', 'x2', False, False, 'x0_pred', 'C:/SD/20230124234916_%09d.png', 'testvidmanualsettings.mp4', False, 'None', 2, False, 2, False, None, True, False, 'None', True, 'None', False, 'DIS Fine', False, 'None', False, 'None', False, False, '0:(0.5)', '0:(1)', '0:(0.5)', '0:(1)', '0:(100)', '0:(0)', False, '{\n    "0": "https://deforum.github.io/a1/Gi1.png",\n    "max_f/4-5": "https://deforum.github.io/a1/Gi2.png",\n    "max_f/2-10": "https://deforum.github.io/a1/Gi3.png",\n    "3*max_f/4-15": "https://deforum.github.io/a1/Gi4.jpg",\n    "max_f-20": "https://deforum.github.io/a1/Gi1.png"\n}', '0:(0.75)', '0:(0.35)', '0:(0.25)', '0:(20)', '0:(0.075)', None, None, True, '', '', True, False, False, False, False, 'canny', 'control_sd15_canny [fef5e48e]', 1, 0, 1, 512, 100, 200, 'Scale to Fit (Inner Fit)') {}
Traceback (most recent call last):
  File "C:\Users\Illi\stable-diffusion-webui\modules\call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "C:\Users\Illi\stable-diffusion-webui\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum.py", line 86, in run_deforum
    render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root.animation_prompts, root)
  File "C:\Users\Illi\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\render.py", line 492, in render_animation
    disposable_image = generate(args, keys, anim_args, loop_args, controlnet_args, root, frame_idx, sampler_name=scheduled_sampler_name)
  File "C:\Users\Illi\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 60, in generate
    image, caught_vae_exception = generate_with_nans_check(args, keys, anim_args, loop_args, controlnet_args, root, frame, return_sample, sampler_name)
  File "C:\Users\Illi\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 94, in generate_with_nans_check
    raise e
  File "C:\Users\Illi\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 88, in generate_with_nans_check
    image = generate_inner(args, keys, anim_args, loop_args, controlnet_args, root, frame, return_sample, sampler_name)
  File "C:\Users\Illi\stable-diffusion-webui/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 263, in generate_inner
    processed = processing.process_images(p)
  File "C:\Users\Illi\stable-diffusion-webui\modules\processing.py", line 503, in process_images
    res = process_images_inner(p)
  File "C:\Users\Illi\stable-diffusion-webui\modules\processing.py", line 655, in process_images_inner
    x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
  File "C:\Users\Illi\stable-diffusion-webui\modules\processing.py", line 655, in <listcomp>
    x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))]
  File "C:\Users\Illi\stable-diffusion-webui\modules\processing.py", line 440, in decode_first_stage
    x = model.decode_first_stage(x)
  File "C:\Users\Illi\stable-diffusion-webui\modules\sd_hijack_utils.py", line 17, in <lambda>
    setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
  File "C:\Users\Illi\stable-diffusion-webui\modules\sd_hijack_utils.py", line 26, in __call__
    return self.__sub_func(self.__orig_func, *args, **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\modules\sd_hijack_unet.py", line 76, in <lambda>
    first_stage_sub = lambda orig_func, self, x, **kwargs: orig_func(self, x.to(devices.dtype_vae), **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 826, in decode_first_stage
    return self.first_stage_model.decode(z)
  File "C:\Users\Illi\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap
    return first_stage_model_decode(z)
  File "C:\Users\Illi\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap
    return first_stage_model_decode(z)
  File "C:\Users\Illi\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap
    return first_stage_model_decode(z)
  [Previous line repeated 958 more times]
  File "C:\Users\Illi\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\autoencoder.py", line 90, in decode
    dec = self.decoder(z)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 630, in forward
    h = self.mid.block_1(h, temb)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 133, in forward
    h = self.conv1(h)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "C:\Users\Illi\stable-diffusion-webui\extensions-builtin\Lora\lora.py", line 319, in lora_Conv2d_forward
    return torch.nn.Conv2d_forward_before_lora(self, input)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\conv.py", line 458, in _conv_forward
    _pair(0), self.dilation, self.groups)
  File "C:\Users\Illi\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\utils.py", line 9, in parse
    if isinstance(x, collections.abc.Iterable):
  File "C:\Users\Illi\AppData\Local\Programs\Python\Python310\lib\abc.py", line 119, in __instancecheck__
    return _abc_instancecheck(cls, instance)
RecursionError: maximum recursion depth exceeded in comparison

I think Deforum is the most valuable extension ever made for Stable Diffusion by far and I appreciate you guys SO MUCH! Thank you!!!

aleatorydialogue commented 1 year ago

I have been having the same sort of issue, did you figure this out?

Vendaciousness commented 1 year ago

Unfortunately, not yet. It still happened a few times since I wrote up the bug, but not in the last few days. Instead, I'll come back in the morning and find Chrome has crashed, but SD keeps running the job, so it's okay, I guess...lol

I may not be getting it anymore because I reinstalled my SD and removed all the SD plugins I wasn't actively using, as I've had Deforum crash due to other extensions numerous times. Ones I recall crashing it are the Additional Networks, Multidiffusion & Tiled VAE.

These webui-user.bat args also may help with Deforum issues "--xformers --force-enable-xformers" and "--reinstall-xformers" will reinstall xformers (just remove it after running it once) may have helped me. I also use "--medvram --opt-split-attention-v1" and I don't get Out of Memory errors anymore.

Sorry I couldn't help. Definitely join the Deforum Discord if you haven't already. There's a ton of info that's nowhere else on the net. You can use the search function in the top right corner while in the server to search for your problems. I'm Vendacious#6006 on there, so add me if you like. I'm planning on using Deforum a lot, now that I'm getting more consistent results. -V

On Sun, Apr 9, 2023 at 4:00 PM aleatorydialogue @.***> wrote:

I have been having the same sort of issue, did you figure this out?

— Reply to this email directly, view it on GitHub https://github.com/deforum-art/deforum-stable-diffusion/issues/173#issuecomment-1501232071, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6LVXXJ5UDVFZ6IBJLZLO5TXAM5SHANCNFSM6AAAAAAWUTG3F4 . You are receiving this because you authored the thread.Message ID: @.***>

Vendaciousness commented 1 year ago

Here's a recent one. I still get this error nearly every time I run a job that's more than a few hundred frames.

Animation frame: 16/450                                                          | 440/12158 [08:31<1:38:28,  1.98it/s]
Seed: 2843713707
Prompt: lovecraftian amorphous horror, moody atmospheric lighting, techno horror, dangerous, art by Yoshiyuki Sadamoto
Neg Prompt: easynegative, two heads, text, logo, watermark  easynegative, two heads, text, logo, watermark
Applying scaled dot product cross attention optimization (without memory efficient attention).
╭─────┬────┬───────┬────┬────┬────┬────┬────┬────╮
│Steps│CFG │Denoise│Tr X│Tr Y│Tr Z│Ro X│Ro Y│Ro Z│
├─────┼────┼───────┼────┼────┼────┼────┼────┼────┤
│ 35  │15.0│ 0.75  │ 0  │ 25 │ 0  │ 0  │ 0  │ 0  │
╰─────┴────┴───────┴────┴────┴────┴────┴────┴────╯
Reading ControlNet *static* base frame at C:\Users\illi\Pictures\Output\Deforum-Me\controlnet_1_inputframes\000000001.jpg
Reading ControlNet *static* base frame at C:\Users\illi\Pictures\Output\Deforum-Me\controlnet_2_inputframes\000000001.jpg
Loading model from cache: control_v11p_sd15_softedge [a8575a2a]
Loading preprocessor: hed
Pixel Perfect Mode Enabled.
resize_mode = ResizeMode.INNER_FIT
raw_H = 512
raw_W = 512
target_H = 512
target_W = 512
estimation = 512.0
preprocessor resolution = 512
100%|██████████████████████████████████████████████████████████████████████████████████| 27/27 [00:28<00:00,  1.06s/it]
Animation frame: 17/450  ▏                                                       | 467/12158 [09:03<1:38:54,  1.97it/s]
Seed: 2843713707
Prompt: lovecraftian amorphous horror, moody atmospheric lighting, techno horror, dangerous, art by Yoshiyuki Sadamoto
Neg Prompt: easynegative, two heads, text, logo, watermark  easynegative, two heads, text, logo, watermark
Applying scaled dot product cross attention optimization (without memory efficient attention).
╭─────┬────┬───────┬────┬────┬────┬────┬────┬────╮
│Steps│CFG │Denoise│Tr X│Tr Y│Tr Z│Ro X│Ro Y│Ro Z│
├─────┼────┼───────┼────┼────┼────┼────┼────┼────┤
│ 35  │15.0│ 0.75  │ 0  │ 25 │ 0  │ 0  │ 0  │ 0  │
╰─────┴────┴───────┴────┴────┴────┴────┴────┴────╯
Reading ControlNet *static* base frame at C:\Users\illi\Pictures\Output\Deforum-Me\controlnet_1_inputframes\000000001.jpg
Reading ControlNet *static* base frame at C:\Users\illi\Pictures\Output\Deforum-Me\controlnet_2_inputframes\000000001.jpg
Loading model from cache: control_v11p_sd15_softedge [a8575a2a]
Loading preprocessor: hed
Pixel Perfect Mode Enabled.
resize_mode = ResizeMode.INNER_FIT
raw_H = 512
raw_W = 512
target_H = 512
target_W = 512
estimation = 512.0
preprocessor resolution = 512
  0%|                                                                                           | 0/27 [00:02<?, ?it/s]

*START OF TRACEBACK*
Traceback (most recent call last):
  File "C:\SD\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 "C:\SD/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\render.py", line 549, in render_animation
    # generation
  File "C:\SD/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 64, in generate
    image, caught_vae_exception = generate_with_nans_check(args, keys, anim_args, loop_args, controlnet_args, root, frame, return_sample, sampler_name)
  File "C:\SD/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 98, in generate_with_nans_check
    raise e
  File "C:\SD/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 92, in generate_with_nans_check
    image = generate_inner(args, keys, anim_args, loop_args, controlnet_args, root, frame, return_sample, sampler_name)
  File "C:\SD/extensions/deforum-for-automatic1111-webui/scripts\deforum_helpers\generate.py", line 267, in generate_inner
    processed = processing.process_images(p)
  File "C:\SD\modules\processing.py", line 503, in process_images
    res = process_images_inner(p)
  File "C:\SD\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
    return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
  File "C:\SD\modules\processing.py", line 653, in process_images_inner
    samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
  File "C:\SD\modules\processing.py", line 1087, in sample
    samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning)
  File "C:\SD\modules\sd_samplers_kdiffusion.py", line 331, in sample_img2img
    samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
  File "C:\SD\modules\sd_samplers_kdiffusion.py", line 234, in launch_sampling
    return func()
  File "C:\SD\modules\sd_samplers_kdiffusion.py", line 331, in <lambda>
    samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
  File "C:\SD\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\SD\repositories\k-diffusion\k_diffusion\sampling.py", line 148, in sample_euler_ancestral
    callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigmas[i], 'denoised': denoised})
  File "C:\SD\modules\sd_samplers_kdiffusion.py", line 220, in callback_state
    sd_samplers_common.store_latent(latent)
  File "C:\SD\modules\sd_samplers_common.py", line 58, in store_latent
    shared.state.assign_current_image(sample_to_image(decoded))
  File "C:\SD\modules\sd_samplers_common.py", line 46, in sample_to_image
    return single_sample_to_image(samples[index], approximation)
  File "C:\SD\modules\sd_samplers_common.py", line 37, in single_sample_to_image
    x_sample = processing.decode_first_stage(shared.sd_model, sample.unsqueeze(0))[0]
  File "C:\SD\modules\processing.py", line 440, in decode_first_stage
    x = model.decode_first_stage(x)
  File "C:\SD\modules\sd_hijack_utils.py", line 17, in <lambda>
    setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
  File "C:\SD\modules\sd_hijack_utils.py", line 28, in __call__
    return self.__orig_func(*args, **kwargs)
  File "C:\SD\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\SD\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 826, in decode_first_stage
    return self.first_stage_model.decode(z)
  File "C:\SD\modules\lowvram.py", line 52, in first_stage_model_decode_wrap
    return first_stage_model_decode(z)
  File "C:\SD\modules\lowvram.py", line 52, in first_stage_model_decode_wrap
    return first_stage_model_decode(z)
  File "C:\SD\modules\lowvram.py", line 52, in first_stage_model_decode_wrap
    return first_stage_model_decode(z)
  [Previous line repeated 952 more times]
  File "C:\SD\repositories\stable-diffusion-stability-ai\ldm\models\autoencoder.py", line 90, in decode
    dec = self.decoder(z)
  File "C:\SD\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\SD\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 631, in forward
    h = self.mid.attn_1(h)
  File "C:\SD\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\SD\modules\sd_hijack_optimizations.py", line 498, in sdp_no_mem_attnblock_forward
    return sdp_attnblock_forward(self, x)
  File "C:\SD\modules\sd_hijack_optimizations.py", line 479, in sdp_attnblock_forward
    q = self.q(h_)
  File "C:\SD\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\SD\extensions-builtin\Lora\lora.py", line 319, in lora_Conv2d_forward
    return torch.nn.Conv2d_forward_before_lora(self, input)
  File "C:\SD\venv\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "C:\SD\venv\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
RecursionError: maximum recursion depth exceeded while calling a Python object
*END OF TRACEBACK*

User friendly error message:
Error: maximum recursion depth exceeded while calling a Python object. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.
Deforum progress:   4%|██▏

Commits: python: 3.10.6  •  torch: 2.0.0+cu118  •  xformers: N/A  •  gradio: 3.23.0  •  commit: 22bcc7be  •  checkpoint: [d725be5d18]

Here's the full settings file:

{
    "W": 512,
    "H": 512,
    "tiling": false,
    "restore_faces": false,
    "seed": -1,
    "sampler": "Euler a",
    "seed_resize_from_w": 0,
    "seed_resize_from_h": 0,
    "steps": 35,
    "ddim_eta": 0.0,
    "save_settings": true,
    "save_sample_per_step": false,
    "batch_name": "Deforum-Me",
    "seed_behavior": "fixed",
    "seed_iter_N": 1,
    "use_init": false,
    "strength_0_no_init": true,
    "strength": 0.95,
    "init_image": "C://Users//Illi//Pictures//Input//me.png",
    "use_mask": false,
    "use_alpha_as_mask": false,
    "invert_mask": false,
    "overlay_mask": false,
    "mask_file": "https://deforum.github.io/a1/M1.jpg",
    "mask_contrast_adjust": 1.0,
    "mask_brightness_adjust": 1.0,
    "mask_overlay_blur": 4,
    "fill": 1,
    "full_res_mask": true,
    "full_res_mask_padding": 4,
    "reroll_blank_frames": "reroll",
    "reroll_patience": 0.0,
    "precision": "autocast",
    "timestring": "",
    "prompts": {
        "0": "lovecraftian amorphous horror, moody atmospheric lighting, techno horror, dangerous, art by Yoshiyuki Sadamoto --neg easynegative, two heads, text, logo, watermark"
    },
    "animation_prompts_positive": "",
    "animation_prompts_negative": "easynegative, two heads, text, logo, watermark",
    "animation_mode": "3D",
    "max_frames": 450,
    "border": "wrap",
    "angle": "0:(0)",
    "zoom": "0: (1)",
    "translation_x": "0:(0)",
    "translation_y": "0: (25)",
    "translation_z": "0: (0)",
    "transform_center_x": "0: (0)",
    "transform_center_y": "0:(0)",
    "rotation_3d_x": "0:(0)",
    "rotation_3d_y": "0:(0)",
    "rotation_3d_z": "0:(0)",
    "enable_perspective_flip": false,
    "perspective_flip_theta": "0:(0)",
    "perspective_flip_phi": "0:(0)",
    "perspective_flip_gamma": "0:(0)",
    "perspective_flip_fv": "0:(53)",
    "noise_schedule": "0: (0.02)",
    "strength_schedule": "0: (0.25)",
    "contrast_schedule": "0: (1.0)",
    "cfg_scale_schedule": "0: (15)",
    "pix2pix_img_cfg_scale_schedule": "0:(20)",
    "enable_subseed_scheduling": false,
    "subseed_schedule": "0:(1)",
    "subseed_strength_schedule": "0:(0)",
    "enable_steps_scheduling": false,
    "steps_schedule": "0: (25)",
    "fov_schedule": "0: (70)",
    "aspect_ratio_schedule": "0: (1)",
    "aspect_ratio_use_old_formula": false,
    "near_schedule": "0: (200)",
    "far_schedule": "0: (10000)",
    "seed_schedule": "0:(5), 1:(-1), 219:(-1), 220:(5)",
    "enable_sampler_scheduling": false,
    "sampler_schedule": "0: (\"Euler a\")",
    "mask_schedule": "0: (\"!({everywhere}^({init_mask}|{video_mask}) ) \")",
    "use_noise_mask": false,
    "noise_mask_schedule": "0: (\"!({everywhere}^({init_mask}|{video_mask}) ) \")",
    "enable_checkpoint_scheduling": false,
    "checkpoint_schedule": "0: (\"model1.ckpt\"), 100: (\"model2.ckpt\")",
    "enable_clipskip_scheduling": false,
    "clipskip_schedule": "0: (2)",
    "enable_noise_multiplier_scheduling": false,
    "noise_multiplier_schedule": "0: (1.05)",
    "kernel_schedule": "0: (5)",
    "sigma_schedule": "0: (1.0)",
    "amount_schedule": "0: (0.35)",
    "threshold_schedule": "0: (0.0)",
    "color_coherence": "None",
    "color_coherence_image_path": "",
    "color_coherence_video_every_N_frames": 1.0,
    "color_force_grayscale": false,
    "diffusion_cadence": 1,
    "optical_flow_cadence": "RAFT",
    "cadence_flow_factor_schedule": "0: (1)",
    "optical_flow_redo_generation": "None",
    "redo_flow_factor_schedule": "0: (1)",
    "diffusion_redo": 0,
    "noise_type": "perlin",
    "perlin_octaves": 2,
    "perlin_persistence": 0.36,
    "use_depth_warping": true,
    "use_zoe_depth": false,
    "midas_weight": 0.2,
    "padding_mode": "border",
    "sampling_mode": "bicubic",
    "save_depth_maps": false,
    "video_init_path": "C:\\Users\\Illi\\Pictures\\Input\\wheel.mp4",
    "extract_nth_frame": 1,
    "extract_from_frame": 0,
    "extract_to_frame": -1,
    "overwrite_extracted_frames": false,
    "use_mask_video": false,
    "video_mask_path": "",
    "resume_from_timestring": false,
    "resume_timestring": null,
    "hybrid_generate_inputframes": false,
    "hybrid_generate_human_masks": "None",
    "hybrid_use_first_frame_as_init_image": false,
    "hybrid_motion": "None",
    "hybrid_motion_use_prev_img": true,
    "hybrid_flow_method": "RAFT",
    "hybrid_composite": "None",
    "hybrid_use_init_image": false,
    "hybrid_comp_mask_type": "None",
    "hybrid_comp_mask_inverse": false,
    "hybrid_comp_mask_equalize": "None",
    "hybrid_comp_mask_auto_contrast": false,
    "hybrid_comp_save_extra_frames": false,
    "hybrid_comp_alpha_schedule": "0:(0.2)",
    "hybrid_flow_factor_schedule": "0:(0.4)",
    "hybrid_comp_mask_blend_alpha_schedule": "0:(0.5)",
    "hybrid_comp_mask_contrast_schedule": "0:(1)",
    "hybrid_comp_mask_auto_contrast_cutoff_high_schedule": "0:(100)",
    "hybrid_comp_mask_auto_contrast_cutoff_low_schedule": "0:(0)",
    "parseq_manifest": "",
    "parseq_use_deltas": true,
    "use_looper": false,
    "init_images": "{\n    \"0\": \"https://user-images.githubusercontent.com/121192995/215279228-1673df8a-f919-4380-b04c-19379b2041ff.png\",\n    \"50\": \"https://user-images.githubusercontent.com/121192995/215279281-7989fd6f-4b9b-4d90-9887-b7960edd59f8.png\",\n    \"100\": \"https://user-images.githubusercontent.com/121192995/215279284-afc14543-d220-4142-bbf4-503776ca2b8b.png\",\n    \"150\": \"https://user-images.githubusercontent.com/121192995/215279286-23378635-85b3-4457-b248-23e62c048049.jpg\",\n    \"200\": \"https://user-images.githubusercontent.com/121192995/215279228-1673df8a-f919-4380-b04c-19379b2041ff.png\"\n}",
    "image_strength_schedule": "0:(0.75)",
    "blendFactorMax": "0:(0.35)",
    "blendFactorSlope": "0:(0.25)",
    "tweening_frames_schedule": "0:(20)",
    "color_correction_factor": "0:(0.075)",
    "cn_1_overwrite_frames": true,
    "cn_1_vid_path": "C://Users//Illi//Pictures//Input//me.png",
    "cn_1_mask_vid_path": "",
    "cn_1_enabled": true,
    "cn_1_low_vram": true,
    "cn_1_pixel_perfect": true,
    "cn_1_module": "hed",
    "cn_1_model": "control_v11p_sd15_softedge [a8575a2a]",
    "cn_1_weight": 0.75,
    "cn_1_guidance_start": 0,
    "cn_1_guidance_end": 0.83,
    "cn_1_processor_res": 512,
    "cn_1_threshold_a": 100,
    "cn_1_threshold_b": 200,
    "cn_1_resize_mode": "Inner Fit (Scale to Fit)",
    "cn_1_control_mode": "Balanced",
    "cn_2_overwrite_frames": true,
    "cn_2_vid_path": "C://Users//Illi//Pictures//Input//me.png",
    "cn_2_mask_vid_path": "",
    "cn_2_enabled": false,
    "cn_2_low_vram": true,
    "cn_2_pixel_perfect": true,
    "cn_2_module": "depth",
    "cn_2_model": "control_v11f1p_sd15_depth [cfd03158]",
    "cn_2_weight": 0.8,
    "cn_2_guidance_start": 0,
    "cn_2_guidance_end": 1,
    "cn_2_processor_res": 1280,
    "cn_2_threshold_a": 64,
    "cn_2_threshold_b": 64,
    "cn_2_resize_mode": "Inner Fit (Scale to Fit)",
    "cn_2_control_mode": "Balanced",
    "cn_3_overwrite_frames": true,
    "cn_3_vid_path": "",
    "cn_3_mask_vid_path": "",
    "cn_3_enabled": false,
    "cn_3_low_vram": false,
    "cn_3_pixel_perfect": false,
    "cn_3_module": "none",
    "cn_3_model": "None",
    "cn_3_weight": 1,
    "cn_3_guidance_start": 0,
    "cn_3_guidance_end": 1,
    "cn_3_processor_res": 64,
    "cn_3_threshold_a": 64,
    "cn_3_threshold_b": 64,
    "cn_3_resize_mode": "Inner Fit (Scale to Fit)",
    "cn_3_control_mode": "Balanced",
    "cn_4_overwrite_frames": true,
    "cn_4_vid_path": "",
    "cn_4_mask_vid_path": "",
    "cn_4_enabled": false,
    "cn_4_low_vram": false,
    "cn_4_pixel_perfect": false,
    "cn_4_module": "none",
    "cn_4_model": "None",
    "cn_4_weight": 1,
    "cn_4_guidance_start": 0,
    "cn_4_guidance_end": 1,
    "cn_4_processor_res": 64,
    "cn_4_threshold_a": 64,
    "cn_4_threshold_b": 64,
    "cn_4_resize_mode": "Inner Fit (Scale to Fit)",
    "cn_4_control_mode": "Balanced",
    "cn_5_overwrite_frames": true,
    "cn_5_vid_path": "",
    "cn_5_mask_vid_path": "",
    "cn_5_enabled": false,
    "cn_5_low_vram": false,
    "cn_5_pixel_perfect": false,
    "cn_5_module": "none",
    "cn_5_model": "None",
    "cn_5_weight": 1,
    "cn_5_guidance_start": 0,
    "cn_5_guidance_end": 1,
    "cn_5_processor_res": 64,
    "cn_5_threshold_a": 64,
    "cn_5_threshold_b": 64,
    "cn_5_resize_mode": "Inner Fit (Scale to Fit)",
    "cn_5_control_mode": "Balanced",
    "skip_video_creation": false,
    "fps": 30,
    "make_gif": false,
    "delete_imgs": false,
    "add_soundtrack": "None",
    "soundtrack_path": "https://deforum.github.io/a1/A1.mp3",
    "r_upscale_video": false,
    "r_upscale_model": "realesrgan-x4plus",
    "r_upscale_factor": "x4",
    "r_upscale_keep_imgs": false,
    "store_frames_in_ram": false,
    "frame_interpolation_engine": "None",
    "frame_interpolation_x_amount": 2,
    "frame_interpolation_slow_mo_enabled": true,
    "frame_interpolation_slow_mo_amount": 2,
    "frame_interpolation_keep_imgs": false,
    "sd_model_name": "revAnimated_v11.safetensors",
    "sd_model_hash": "07aebeb9",
    "deforum_git_commit_id": "59b8f0da (Mon May  1 00:12:44 2023)"
}

-V

Kashyap1237 commented 1 year ago

Facing a similar issue today! @Vendaciousness i feel your pain. Deforum is my favorite extension on Automatic 1111 and i respect the work of @huemin-art and the team But now facing this issue of "maximum recursion depth exceeded" is so sad - I'm using A1111, and in Deforum, when i'm generating images, it stops at 1905/2000 frame. - Though i can resume the animation from there (1905 frame), but this wasn't happening earlier. - i'm sharing the log from before the point it stopped generating images.- the most crucial thing is that even at Steps = 1 , the same thing happens. . . . Animation frame: 1904/2001 Creating in-between cadence frame: 1902; tween:0.50; Creating in-between cadence frame: 1903; tween:1.00; Seed: 1905 Prompt: ((high quality)), ((centered)) , ((detail)) abstract artwork, lines and shapes Neg Prompt: ((low-res)), ((((text)))), error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature, children, child, girl, boy, ((human)), ((people)), (((man))), (((woman))), ((girl)), (((high contrast))), ((highly saturated colors)), cropped, worst quality, ((low quality)), ((low res)), (((text, watermark))), (((logo))), (((words))), (((city))), (((houses))), ((fairy)), (((Characters))), (((cars))), ((vehicles)), (girl), (((face))), (((person))), ((anime)), ((anime boy)), (((anime girl))), (((doll)) Applying xformers cross attention optimization. ╭─────┬───┬───────┬─────────────────────────────────┬────┬────┬────┬────┬────┬────╮ │Steps│CFG│Denoise│ Checkpoint │Tr X│Tr Y│Tr Z│Ro X│Ro Y│Ro Z│ ├─────┼───┼───────┼─────────────────────────────────┼────┼────┼────┼────┼────┼────┤ │ 0 │7.0│ 0.2 │dreamshaper_5BakedVae.safetensors│0.5 │0.5 │ 0 │ 0 │ 0 │ 0 │ ╰─────┴───┴───────┴─────────────────────────────────┴────┴────┴────┴────┴────┴────╯ 0it [00:00, ?it/s] Animation frame: 1906/2001 Creating in-between cadence frame: 1904; tween:0.50; Creating in-between cadence frame: 1905; tween:1.00; Seed: 1907 Prompt: ((high quality)), ((centered)) , ((detail)) abstract artwork, lines and shapes Neg Prompt: ((low-res)), ((((text)))), error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature, children, child, girl, boy, ((human)), ((people)), (((man))), (((woman))), ((girl)), (((high contrast))), ((highly saturated colors)), cropped, worst quality, ((low quality)), ((low res)), (((text, watermark))), (((logo))), (((words))), (((city))), (((houses))), ((fairy)), (((Characters))), (((cars))), ((vehicles)), (girl), (((face))), (((person))), ((anime)), ((anime boy)), (((anime girl))), (((doll)) Applying xformers cross attention optimization. ╭─────┬───┬───────┬─────────────────────────────────┬────┬────┬────┬────┬────┬────╮ │Steps│CFG│Denoise│ Checkpoint │Tr X│Tr Y│Tr Z│Ro X│Ro Y│Ro Z│ ├─────┼───┼───────┼─────────────────────────────────┼────┼────┼────┼────┼────┼────┤ │ 0 │7.0│ 0.3 │dreamshaper_5BakedVae.safetensors│0.5 │0.5 │ 4 │ 0 │ 0 │ 0 │ ╰─────┴───┴───────┴─────────────────────────────────┴────┴────┴────┴────┴────┴────╯ 0it [00:00, ?it/s]

START OF TRACEBACK Traceback (most recent call last): File "C:\NEW SD\stable-diffusion-webui\extensions\deforum\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 "C:\NEW SD\stable-diffusion-webui/extensions/deforum/scripts\deforum_helpers\render.py", line 550, in render_animation image = generate(args, keys, anim_args, loop_args, controlnet_args, root, frame_idx, sampler_name=scheduled_sampler_name) File "C:\NEW SD\stable-diffusion-webui/extensions/deforum/scripts\deforum_helpers\generate.py", line 64, in generate image, caught_vae_exception = generate_with_nans_check(args, keys, anim_args, loop_args, controlnet_args, root, frame, return_sample, sampler_name) File "C:\NEW SD\stable-diffusion-webui/extensions/deforum/scripts\deforum_helpers\generate.py", line 98, in generate_with_nans_check raise e File "C:\NEW SD\stable-diffusion-webui/extensions/deforum/scripts\deforum_helpers\generate.py", line 92, in generate_with_nans_check image = generate_inner(args, keys, anim_args, loop_args, controlnet_args, root, frame, return_sample, sampler_name) File "C:\NEW SD\stable-diffusion-webui/extensions/deforum/scripts\deforum_helpers\generate.py", line 267, in generate_inner processed = processing.process_images(p) File "C:\NEW SD\stable-diffusion-webui\modules\processing.py", line 515, in process_images res = process_images_inner(p) File "C:\NEW SD\stable-diffusion-webui\modules\processing.py", line 671, in process_images_inner x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))] File "C:\NEW SD\stable-diffusion-webui\modules\processing.py", line 671, in x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))] File "C:\NEW SD\stable-diffusion-webui\modules\processing.py", line 444, in decode_first_stage x = model.decode_first_stage(x) File "C:\NEW SD\stable-diffusion-webui\modules\sd_hijack_utils.py", line 17, in setattr(resolved_obj, func_path[-1], lambda *args, kwargs: self(*args, *kwargs)) File "C:\NEW SD\stable-diffusion-webui\modules\sd_hijack_utils.py", line 28, in call return self.__orig_func(args, kwargs) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "C:\NEW SD\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 826, in decode_first_stage return self.first_stage_model.decode(z) File "C:\NEW SD\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap return first_stage_model_decode(z) File "C:\NEW SD\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap return first_stage_model_decode(z) File "C:\NEW SD\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap return first_stage_model_decode(z) [Previous line repeated 959 more times] File "C:\NEW SD\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\autoencoder.py", line 90, in decode dec = self.decoder(z) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "C:\NEW SD\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 631, in forward h = self.mid.attn_1(h) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "C:\NEW SD\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 258, in forward out = xformers.ops.memory_efficient_attention(q, k, v, attn_bias=None, op=self.attention_op) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha__init.py", line 196, in memory_efficient_attention return _memory_efficient_attention( File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha__init.py", line 294, in _memory_efficient_attention return _memory_efficient_attention_forward( File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha__init__.py", line 310, in _memory_efficient_attention_forward op = _dispatch_fw(inp) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha\dispatch.py", line 98, in _dispatch_fw return _run_priority_list( File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha\dispatch.py", line 63, in _run_priority_list not_supported = op.not_supported_reasons(inp) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha\cutlass.py", line 213, in not_supported_reasons matmul_alignment_mn = _minimum_gemm_alignment(d) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\xformers\ops\fmha\cutlass.py", line 42, in _minimum_gemm_alignment cap = torch.cuda.get_device_capability(inp.device) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\cuda__init.py", line 381, in get_device_capability prop = get_device_properties(device) File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\init__.py", line 395, in get_device_properties _lazy_init() # will define _get_device_properties File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\init__.py", line 221, in _lazy_init if is_initialized() or hasattr(_tls, 'is_initializing'): File "C:\NEW SD\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\init__.py", line 178, in is_initialized return _initialized and not _is_in_bad_fork() RecursionError: maximum recursion depth exceeded while calling a Python object END OF TRACEBACK

User friendly error message: Error: maximum recursion depth exceeded while calling a Python object. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of .

Kashyap1237 commented 1 year ago

I also tried increasing the maximum recursion depth on CMD, by using " sys.setrecursionlimit(1500) " . but it keeps resetting back to 1000.

aleatorydialogue commented 1 year ago

I got an egpu with more vram and no longer used medvram parameter and haven't had this error ever since. I had been having it almost every run. So clearly something to do with trying to optimize for low vram.

On Wed, May 3, 2023, 5:17 PM Kashyap1237 @.***> wrote:

I also tried increasing the maximum recursion depth on CMD, by using " sys.setrecursionlimit(1500) " . but it keeps resetting back to 1000.

— Reply to this email directly, view it on GitHub https://github.com/deforum-art/deforum-stable-diffusion/issues/173#issuecomment-1533763053, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6R6CRZPPYBS37RD5HPGONDXELDQFANCNFSM6AAAAAAWUTG3F4 . You are receiving this because you commented.Message ID: @.***>

Vendaciousness commented 1 year ago

I'm sure sure what I've changed, but I no longer get this, usually. I'm guessing it was either upgrading my torch to 2.01, or adding '--opt-sdp-attention' to my commandline args.

You can upgrade your torch with this command: pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118

Then you can add this to your webui-user.bat: set TORCH_COMMAND=pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118