Kosinkadink / ComfyUI-AnimateDiff-Evolved

Improved AnimateDiff for ComfyUI and Advanced Sampling Support
Apache License 2.0
2.75k stars 209 forks source link

Ksampler module,help #348

Closed vincewang888 closed 6 months ago

vincewang888 commented 6 months ago

using animatediff

Error occurred when executing KSamplerAdvanced:

module 'comfy.sample' has no attribute 'prepare_mask'

File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1378, in sample return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise) File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1314, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample return original_sample(args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations. File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 292, in motion_sample

reset global state

File "E:\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 217, in inject_functions self.orig_forward_timestep_embed = openaimodel.forward_timestep_embed # needed to account for VanillaTemporalModule

Kosinkadink commented 6 months ago

You need to update AnimateDiff-Evolved and then your issue will go away.

anxvisuals commented 6 months ago

I've updated animate diff but still getting the same error as mentioned above:

[2024-04-20 16:46] FETCH DATA from: H:\COMFYUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [2024-04-20 16:46] Error: OpenAI API key is invalid OpenAI features wont work for you [2024-04-20 16:46] QualityOfLifeSuit_Omar92::NSP ready [2024-04-20 16:46] got prompt [2024-04-20 16:46] model_type EPS [2024-04-20 16:46] Using pytorch attention in VAE [2024-04-20 16:46] Using pytorch attention in VAE [2024-04-20 16:46] clip missing: ['clip_l.logit_scale', 'clip_l.transformer.text_projection.weight'] [2024-04-20 16:46] Requested to load SDXLClipModel [2024-04-20 16:46] Loading 1 new model [2024-04-20 16:46] H:\COMFYUI\ComfyUI_windows_portable\ComfyUI\comfy\ldm\modules\attention.py:345: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:263.) out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False) [2024-04-20 16:46] [AnimateDiffEvo] - INFO - Loading motion module hsxl_temporal_layers.f16.safetensors via Gen2 [2024-04-20 16:46] [AnimateDiffEvo] - INFO - [Autoselect]: 'linear (HotshotXL/default)' beta_schedule for hsxl_temporal_layers.f16.safetensors:v1:HotshotXL:SDXL [2024-04-20 16:46] [AnimateDiffEvo] - INFO - Regular AnimateDiff activated - latents passed in (1) less or equal to context_length 8. [2024-04-20 16:46] [AnimateDiffEvo] - INFO - Using motion module hsxl_temporal_layers.f16.safetensors:v1. [2024-04-20 16:46] Requested to load SDXL [2024-04-20 16:46] Requested to load AnimateDiffModel [2024-04-20 16:46] Loading 2 new models [2024-04-20 16:46] [2024-04-20 16:46] !!! Exception during processing!!! An xformers bug was encountered in AnimateDiff - this is unexpected, report this to Kosinkadink/ComfyUI-AnimateDiff-Evolved repo as an issue, and a workaround for now is to run ComfyUI with the --disable-xformers argument.

Kosinkadink commented 6 months ago

This is an entirely different error. You likely ran into the attention CUDA size limit compiled into into pytorch's scaled_dot_product attention (the error messages mentions xformers as I wasn't aware 9 months ago that pytorch also has a limit, albeit bigger, like xformers). I will work soon to automatically switch to a less memory efficient and slower attention method when the issue is encountered, but for now you can avoid it by decreasing resolution.

anxvisuals commented 6 months ago

Its working now, thank you for your swift answer!