comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
57.82k stars 6.13k forks source link

DownloadAndLoadCogVideoModel 'CogVideoXTransformer3DModel' object has no attribute 'encoder' #5684

Closed ABIA2024 closed 5 days ago

ABIA2024 commented 5 days ago

Your question

What can I do to be able to execute this json correctly (which works perfectly on the video of its creator: Galaxy S24 Ultra: zoom in for more details, quite simply
ComfyUI CogVideoX 5B With Dimension X An Image To Video Generation - 3D/4D Video With 1 Image ) here's the json : { “last_node_id: 59, “last_link_id": 128, “nodes": [ { “id": 37, “type": ‘ImageResizeKJ’, “pos": { “0": 618.209228515625, “1": 1097.7996826171875 }, “size": { “0": 315, “1": 266 }, “flags": {}, “order": 6, “mode": 0, “inputs": [ { “name": ‘image’, “type": ‘IMAGE’, “link": 124, “label": ”image” }, { “name": ‘get_image_size’, “type": ‘IMAGE’, “link": null, “shape": 7, “label": ”get_image_size” }, { “name": ‘width_input’, “type": ‘INT’, “link": null, “widget": { “name": ”width_input” }, “label": ”width_input” }, { “name": ‘height_input’, “type": ‘INT’, “link": null, “widget": { “name": ”height_input” }, “label": ”height_input” } ], “outputs": [ { “name": ‘IMAGE’, “type": ‘IMAGE’, “links": [ 119 ], “slot

Translated with DeepL.com (free version)

Logs

RuntimeError: Given groups=1, weight of size [3072, 16, 2, 2], expected input[26, 32, 60, 90] to have 16 channels, but got 32 channels instead

Prompt executed in 65.68 seconds
got prompt
WARNING: [Errno 2] No such file or directory: 'C:\\Users\\Ben\\Desktop\\CogVideoX5B + DimensionX\\images\\wukong_222.webp'
!!! Exception during processing !!! 'CogVideoXTransformer3DModel' object has no attribute 'encoder'
Traceback (most recent call last):
  File "D:\PINOKIO2\ComfyUI_windows_portable\ComfyUI\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 "D:\PINOKIO2\ComfyUI_windows_portable\ComfyUI\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 "D:\PINOKIO2\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\PINOKIO2\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PINOKIO2\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-CogVideoXWrapper\model_loading.py", line 179, in loadmodel
    transformer = CogVideoXTransformer3DModel.from_pretrained(base_path, subfolder="transformer")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\modeling_utils.py", line 929, in from_pretrained
    raise e
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\modeling_utils.py", line 886, in from_pretrained
    accelerate.load_checkpoint_and_dispatch(
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\accelerate\big_modeling.py", line 613, in load_checkpoint_and_dispatch
    load_checkpoint_in_model(
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\accelerate\utils\modeling.py", line 1821, in load_checkpoint_in_model
    set_module_tensor_to_device(
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\accelerate\utils\modeling.py", line 334, in set_module_tensor_to_device
    new_module = getattr(module, split)
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\modeling_utils.py", line 155, in __getattr__
    return super().__getattr__(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PINOKIO2\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1931, in __getattr__
    raise AttributeError(
AttributeError: 'CogVideoXTransformer3DModel' object has no attribute 'encoder'

Other

No response

ltdrdata commented 5 days ago

Please move this issue to ComfyUI-CogVideoXWrapper repo. https://github.com/kijai/ComfyUI-CogVideoXWrapper