!!! Exception during processing !!! 'AutoencoderKLCogVideoX' object has no attribute '_clear_fake_context_parallel_cache'
System Info / 系統信息
cuda:12.6 torch: 2.5.0+cu124 Python: 3.12.5
Information / 问题信息
- [X] The official example scripts / 官方的示例脚本
- [ ] My own modified scripts / 我自己修改的脚本和任务
Reproduction / 复现过程
when i run cogvideox-i2v, i will get the error in this node: CogVideo ImageEncode here is the log :
!!! Exception during processing !!! 'AutoencoderKLCogVideoX' object has no attribute '_clear_fake_context_parallel_cache' Traceback (most recent call last): File "E:\comfyui-aki\ComfyUI-aki-v1.4\execution.py", line 323, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "E:\comfyui-aki\ComfyUI-aki-v1.4\execution.py", line 198, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "E:\comfyui-aki\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "E:\comfyui-aki\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "E:\comfyui-aki\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-CogVideoXWrapper\nodes.py", line 986, in encode latents = vae.encode(image_chunk) File "E:\comfyui-aki\ComfyUI-aki-v1.4\python\lib\site-packages\diffusers\utils\accelerate_utils.py", line 46, in wrapper return method(self, *args, **kwargs) File "E:\comfyui-aki\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-CogVideoXWrapper\mz_enable_vae_encode_tiling.py", line 27, in encode h = self._encode(x) File "E:\comfyui-aki\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-CogVideoXWrapper\mz_enable_vae_encode_tiling.py", line 113, in _encode return self.tiled_encode(x) File "E:\comfyui-aki\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-CogVideoXWrapper\mz_enable_vae_encode_tiling.py", line 86, in tiled_encode self._clear_fake_context_parallel_cache() File "E:\comfyui-aki\ComfyUI-aki-v1.4\python\lib\site-packages\diffusers\models\modeling_utils.py", line 155, in getattr return super().getattr(name) File "E:\comfyui-aki\ComfyUI-aki-v1.4\python\lib\site-packages\torch\nn\modules\module.py", line 1709, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'AutoencoderKLCogVideoX' object has no attribute '_clear_fake_context_parallel_cache'
Expected behavior / 期待表现
no error
I noticed that in nodes.py, the vae._clear_fake_context_parallel_cache() are all wrapped with a try except.
mz_enable_var_encode_tiling.py, vae._clear_fake_context_parallel_cache() doesn't have the same, I added the try, except around the vae._clear_fake_context_parallel_cache() instances and all is working fine now!
I'm also having this same issue.
I tried the fix that @s2n-Gribbly mentioned, but I don't have the vae._clear_fake_context_parallel_cache() in my mz_enable_vae_encode_tiling.py file.
There is a self._clear_fake_context_parallel_cache(). I tried to wrap this in the same try/except and it caused more errors. I possibly did it incorrectly.
Do you mind posting exactly how you modified the file?
Ok, I've successfully fixed the error on two separate machines.... These are steps I came across accidentally:
I dropped a new CogVideo ImageEncode node, I restarted comfyUI and reloaded the workflow, disabled "enable_tlling" and it works fine now, no error.
Edit: I reconnected the original node, disabled tiling and this also works, so it's not the new node, it's the "enable_tiling" What's weird is that I tried to disable that initially and still got the error.
Edit 2: More detective work... Once the error occurs once, you will need to restart comfyUI or it will continue to error even though "enable_tiling" is disabled.
好的,我已经成功修复了不同机器上的错误……这些是我偶然遇到的步骤:
我删除了一个新的 CogVideo ImageEncode 节点,重新启动了 comfyUI 并重新加载了工作流程,取消了“enable_tlling”,现在运行良好,没有错误。
编辑:我重新连接了原始节点,取消了平铺,但是也有效,所以它不是新节点,然后“enable_tiling”奇怪的是,我最初尝试取消它,但仍然出现错误。
编辑2:更多的侦探工作...一旦错误发生一次,您将需要重新启动comfyUI,否则即使“enable_tiling”被取消,它仍然会继续出错。
oh! crazy! it works! but when i disabled "enable_tiling", i will get an OOM, hahaha~
its indeed a bug,and i saw it has been fixed.
Has this issue been resolved?