continue-revolution / sd-forge-animatediff

AnimateDiff for Stable Diffusion WebUI Forge, mirror for https://github.com/continue-revolution/sd-webui-animatediff/tree/forge/master
116 stars 9 forks source link

[Feature]: 佬,有空更新下呗qwq #23

Open s4130 opened 2 months ago

s4130 commented 2 months ago

Expected behavior

forge新版已经出一个多月了,佬有时间的话可以更新一下吗

s4130 commented 2 months ago

我尝试将缺失的模块从旧版forge复制到了本地,

2024-09-25 00:18:39,837 - AnimateDiff - INFO - AnimateDiff Hooking i2i_batch
*** Error calling: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py/ui
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 545, in wrap_call
        return func(*args, **kwargs)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 43, in ui
        unit = AnimateDiffUiGroup().render(
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 268, in render
        model_list = self.get_model_list()
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 247, in get_model_list
        return [f for f in os.listdir(model_dir) if f != ".gitkeep" and not any(tag in f for tag in get_sd_rm_tag())]
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 247, in <listcomp>
        return [f for f in os.listdir(model_dir) if f != ".gitkeep" and not any(tag in f for tag in get_sd_rm_tag())]
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 239, in get_sd_rm_tag
        if shared.sd_model.is_sdxl:
    AttributeError: 'FakeInitialModel' object has no attribute 'is_sdxl'

---
*** Error calling: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py/ui
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 545, in wrap_call
        return func(*args, **kwargs)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 43, in ui
        unit = AnimateDiffUiGroup().render(
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 268, in render
        model_list = self.get_model_list()
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 247, in get_model_list
        return [f for f in os.listdir(model_dir) if f != ".gitkeep" and not any(tag in f for tag in get_sd_rm_tag())]
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 247, in <listcomp>
        return [f for f in os.listdir(model_dir) if f != ".gitkeep" and not any(tag in f for tag in get_sd_rm_tag())]
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_ui.py", line 239, in get_sd_rm_tag
        if shared.sd_model.is_sdxl:
    AttributeError: 'FakeInitialModel' object has no attribute 'is_sdxl'

---

展开后不会正常显示内容: image 加载一个模型生图:

Loading Model: {'checkpoint_info': {'filename': 'D:\\sd-webui-aki-v4.5\\models\\Stable-diffusion\\awportrait_v14.safetensors', 'hash': 'fbe394b6'}, 'additional_modules': [], 'unet_storage_dtype': None}
[Unload] Trying to free all memory for cuda:0 with 0 models keep loaded ... Done.
StateDict Keys: {'unet': 686, 'vae': 248, 'text_encoder': 197, 'ignore': 0}
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
K-Model Created: {'storage_dtype': torch.bfloat16, 'computation_dtype': torch.float32}
tag_autocomplete_helper: Old webui version or unrecognized model shape, using fallback for embedding completion.
Model loaded in 5.5s (unload existing model: 0.5s, forge model load: 5.0s).
*** Error running before_process: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 836, in before_process
        script.before_process(p, *script_args)
    TypeError: AnimateDiffScript.before_process() missing 1 required positional argument: 'params'

---
*** Error running before_process_batch: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 860, in before_process_batch
        script.before_process_batch(p, *script_args, **kwargs)
    TypeError: AnimateDiffScript.before_process_batch() missing 1 required positional argument: 'params'

---
*** Error running process_batch: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 884, in process_batch
        script.process_batch(p, *script_args, **kwargs)
    TypeError: AnimateDiffScript.process_batch() missing 1 required positional argument: 'params'

---
All loaded to GPU.
Moving model(s) has taken 0.00 seconds
token_merging_ratio = 0.3
*** Error running process_before_every_sampling: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 892, in process_before_every_sampling
        script.process_before_every_sampling(p, *script_args, **kwargs)
    TypeError: AnimateDiffScript.process_before_every_sampling() missing 1 required positional argument: 'params'

---
[Unload] Trying to free 3667.23 MB for cuda:0 with 0 models keep loaded ... Current free memory is 3271.72 MB ... Done.
[Memory Management] Target: KModel, Free GPU: 3271.72 MB, Model Require: 1639.41 MB, Previously Loaded: 0.00 MB, Inference Require: 1536.00 MB, Remaining: 96.32 MB, All loaded to GPU.
Moving model(s) has taken 0.58 seconds
[Unload] Trying to free 2592.85 MB for cuda:0 with 0 models keep loaded ... Current free memory is 1597.37 MB ... Current free memory is 1597.37 MB ... Unload model KModel Done.
[Memory Management] Target: IntegratedAutoencoderKL, Free GPU: 3249.34 MB, Model Require: 319.11 MB, Previously Loaded: 0.00 MB, Inference Require: 1536.00 MB, Remaining: 1394.23 MB, All loaded to GPU.
Moving model(s) has taken 0.90 seconds
*** Error running postprocess_batch_list: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 916, in postprocess_batch_list
        script.postprocess_batch_list(p, pp, *script_args, **kwargs)
    TypeError: AnimateDiffScript.postprocess_batch_list() missing 1 required positional argument: 'params'

---
*** Error running postprocess: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 900, in postprocess
        script.postprocess(p, processed, *script_args)
    TypeError: AnimateDiffScript.postprocess() missing 1 required positional argument: 'params'

---

然后重载ui,能显示内容了: image 启用animatediff生成图片:

2024-09-25 00:32:36,278 - AnimateDiff - INFO - AnimateDiff process start.
2024-09-25 00:32:36,278 - AnimateDiff - INFO - Loading motion module mm_sd15_v3.safetensors from D:\sd-webui-aki-v4.5\extensions\sd-webui-animatediff\model\mm_sd15_v3.safetensors
*** Error running before_process: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 836, in before_process
        script.before_process(p, *script_args)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 62, in before_process
        motion_module.load(params.model)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_mm.py", line 44, in load
        model_type = MotionModuleType.get_mm_type(mm_state_dict)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\motion_module.py", line 24, in get_mm_type
        keys = list(state_dict.keys())
    AttributeError: 'NoneType' object has no attribute 'keys'

---
2024-09-25 00:32:36,290 - AnimateDiff - INFO - Setting DDIM alpha.
*** Error running process_batch: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 884, in process_batch
        script.process_batch(p, *script_args, **kwargs)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 75, in process_batch
        motion_module.set_ddim_alpha(p.sd_model)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_mm.py", line 137, in set_ddim_alpha
        beta_end = 0.020 if self.mm.is_adxl else 0.012
    AttributeError: 'NoneType' object has no attribute 'is_adxl'

---
token_merging_ratio = 0.3
*** Error running process_before_every_sampling: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 892, in process_before_every_sampling
        script.process_before_every_sampling(p, *script_args, **kwargs)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 80, in process_before_every_sampling
        motion_module.inject(p.sd_model, params.model)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_mm.py", line 57, in inject
        assert sd_model.is_sdxl == self.mm.is_xl, f"Motion module incompatible with SD. You are using {sd_ver} with {self.mm.mm_type}."
    AttributeError: 'NoneType' object has no attribute 'is_xl'

---
[Unload] Trying to free 3667.23 MB for cuda:0 with 0 models keep loaded ... Current free memory is 2929.35 MB ... Unload model IntegratedAutoencoderKL Current free memory is 3249.09 MB ... Done.
[Memory Management] Target: KModel, Free GPU: 3249.09 MB, Model Require: 1639.41 MB, Previously Loaded: 0.00 MB, Inference Require: 1536.00 MB, Remaining: 73.69 MB, All loaded to GPU.
Moving model(s) has taken 0.74 seconds
*** Error executing callback cfg_denoiser_callback for D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\script_callbacks.py", line 333, in cfg_denoiser_callback
        c.callback(params)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_infv2v.py", line 89, in animatediff_on_cfg_denoiser
        ad_params.text_cond = ad_params.prompt_scheduler.multi_cond(cfg_params.text_cond, prompt_closed_loop)
    AttributeError: 'NoneType' object has no attribute 'multi_cond'

---
*** Error executing callback cfg_denoiser_callback for D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\script_callbacks.py", line 333, in cfg_denoiser_callback
        c.callback(params)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_infv2v.py", line 100, in animatediff_on_cfg_denoiser
        cfg_params.text_cond, cfg_params.text_uncond = pad_cond_uncond(ad_params.text_cond, cfg_params.text_uncond)
    AttributeError: 'AnimateDiffProcess' object has no attribute 'text_cond'

---
[Unload] Trying to free 2592.85 MB for cuda:0 with 0 models keep loaded ... Current free memory is 1597.24 MB ... Current free memory is 1597.24 MB ... Unload model KModel Done.
[Memory Management] Target: IntegratedAutoencoderKL, Free GPU: 3248.59 MB, Model Require: 319.11 MB, Previously Loaded: 0.00 MB, Inference Require: 1536.00 MB, Remaining: 1393.48 MB, All loaded to GPU.
Moving model(s) has taken 1.07 seconds
*** Error running postprocess_batch_list: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 916, in postprocess_batch_list
        script.postprocess_batch_list(p, pp, *script_args, **kwargs)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 85, in postprocess_batch_list
        params.prompt_scheduler.save_infotext_img(p)
    AttributeError: 'NoneType' object has no attribute 'save_infotext_img'

---
*** Error running postprocess: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 900, in postprocess
        script.postprocess(p, processed, *script_args)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 90, in postprocess
        params.prompt_scheduler.save_infotext_txt(res)
    AttributeError: 'NoneType' object has no attribute 'save_infotext_txt'

---

其中AttributeError: 'AnimateDiffProcess' object has no attribute 'text_cond'与迭代步数有关(会出现n-1次),所以上面设置的是迭代步数2.

s4130 commented 2 weeks ago

求更新啊, @continue-revolution 佬. 今天发现将animatediff版本回退到1.13.0,减少了大部分报错,只剩下了这些,可以生成设置帧数数量的图片了,但还是不连贯:

*** Error running before_process: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 836, in before_process
        script.before_process(p, *script_args)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 51, in before_process
        motion_module.inject(p.sd_model, params.model)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff_mm.py", line 61, in inject
        unet = sd_model.model.diffusion_model
    AttributeError: 'StableDiffusion' object has no attribute 'model'

---
*** Error running postprocess_batch_list: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 916, in postprocess_batch_list
        script.postprocess_batch_list(p, pp, *script_args, **kwargs)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 79, in postprocess_batch_list
        params.prompt_scheduler.save_infotext_img(p)
    AttributeError: 'NoneType' object has no attribute 'save_infotext_img'

---
*** Error running postprocess: D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\sd-webui-aki-v4.5\modules\scripts.py", line 900, in postprocess
        script.postprocess(p, processed, *script_args)
      File "D:\sd-webui-aki-v4.5\extensions\sd-forge-animatediff\scripts\animatediff.py", line 84, in postprocess
        params.prompt_scheduler.save_infotext_txt(res)
    AttributeError: 'NoneType' object has no attribute 'save_infotext_txt'

---