ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

TypeError: LatentDiffusion.__init__() missing 3 required positional arguments

Open Blu-Tiger opened this issue 2 years ago • 2 comments

I get this error when trying to queue the prompt:

got prompt
   | Making attention of type 'vanilla' with 512 in_channels
   | Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
   | Making attention of type 'vanilla' with 512 in_channels
Traceback (most recent call last):
  File "/home/blutiger/AI/ComfyUI/execution.py", line 174, in execute
    executed += recursive_execute(self.server, prompt, self.outputs, x, extra_data)
  File "/home/blutiger/AI/ComfyUI/execution.py", line 54, in recursive_execute
    executed += recursive_execute(server, prompt, outputs, input_unique_id, extra_data)
  File "/home/blutiger/AI/ComfyUI/execution.py", line 54, in recursive_execute
    executed += recursive_execute(server, prompt, outputs, input_unique_id, extra_data)
  File "/home/blutiger/AI/ComfyUI/execution.py", line 54, in recursive_execute
    executed += recursive_execute(server, prompt, outputs, input_unique_id, extra_data)
  File "/home/blutiger/AI/ComfyUI/execution.py", line 63, in recursive_execute
    outputs[unique_id] = getattr(obj, obj.FUNCTION)(**input_data_all)
  File "/home/blutiger/AI/ComfyUI/nodes.py", line 217, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
  File "/home/blutiger/AI/ComfyUI/comfy/sd.py", line 870, in load_checkpoint_guess_config
    model = instantiate_from_config(model_config)
  File "/home/blutiger/AI/ComfyUI/comfy/ldm/util.py", line 79, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
TypeError: LatentDiffusion.__init__() missing 3 required positional arguments: 'first_stage_config', 'cond_stage_config', and 'personalization_config'

Blu-Tiger avatar Mar 20 '23 11:03 Blu-Tiger

You probably have ldm installed in your python packages and it's picking up that one instead of the one in the comfy folder.

I'm not sure why your install is completely ignoring my sys.path.insert: https://github.com/comfyanonymous/ComfyUI/blob/master/nodes.py#L14

comfyanonymous avatar Mar 20 '23 20:03 comfyanonymous

I deleted the venv and recreated it reinstalling the dependences, I think that it fixed the problem but now it gives me this other error:

:0:rocdevice.cpp            :2673: 3387139699 us: 6029 : [tid:0x7fee621ff640] Device::callbackQueue aborting with error : HSA_STATUS_ERROR_MEMORY_APERTURE_VIOLATION: The agent attempted to access memory beyond the largest legal address. code: 0x29

I have an AMD RX5700XT, i've tried using HSA_OVERRIDE_GFX_VERSION=10.3.0 and HSA_OVERRIDE_GFX_VERSION=8.3.0.

I even updated to rocm 5.4.3 and installed the latest torch version.

Blu-Tiger avatar Mar 21 '23 07:03 Blu-Tiger