chaojie / ComfyUI-DynamiCrafter

Other
126 stars 6 forks source link

Get error: object has no attribute 'input_patchnorm' #4

Open ShmuelRonen opened 9 months ago

ShmuelRonen commented 9 months ago

Hello and thank you for the project

I have RTX 3090. when I execute the demo workflow I got this error:

Dynamic craft

Error occurred when executing DynamiCrafter Simple:

'VisionTransformer' object has no attribute 'input_patchnorm'

File "W:\ComfyUI_4ALL\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "W:\ComfyUI_4ALL\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "W:\ComfyUI_4ALL\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "W:\ComfyUI_4ALL\ComfyUI\custom_nodes\ComfyUI-DynamiCrafter\nodes.py", line 52, in run_inference imgs= model.get_image(image, prompt, steps, cfg_scale, eta, motion, seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "W:\ComfyUI_4ALL\ComfyUI\custom_nodes\ComfyUI-DynamiCrafter\scripts\gradio\i2v_test.py", line 76, in get_image cond_images = model.embedder(img_tensor.unsqueeze(0)) ## blc ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\derec\miniconda3\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\derec\miniconda3\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "W:\ComfyUI_4ALL\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts....\custom_nodes\ComfyUI-DynamiCrafter\lvdm\modules\encoders\condition.py", line 339, in forward z = self.encode_with_vision_transformer(image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "W:\ComfyUI_4ALL\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts....\custom_nodes\ComfyUI-DynamiCrafter\lvdm\modules\encoders\condition.py", line 346, in encode_with_vision_transformer if self.model.visual.input_patchnorm: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\derec\miniconda3\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1688, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

chaojie commented 9 months ago

pip install open_clip_torch==2.22.0

ShmuelRonen commented 9 months ago

Thanks

joachim508 commented 9 months ago

as a windows user,I downgraded the open_clip_torch version of comfyui's python embedded library to 2.12.0 following this guide https://github.com/AILab-CVC/VideoCrafter/issues/39#issuecomment-179183824 this is the downgrade method https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker-ZHO/issues/15#issuecomment-1898701609 run cmd in python_embeded folder: python.exe -m pip install open_clip_torch==2.12.0