painebenjamin / app.enfugue.ai

ENFUGUE is an open-source web app for making studio-grade images and video using generative AI.
GNU General Public License v3.0
686 stars 65 forks source link

Invocation failed - Missing key model full_key: model object_type=dict #137

Open MBRGA opened 9 months ago

MBRGA commented 9 months ago

I'm having an issue where I can't run the tool against certain checkpoints. I have pointed Enfugue to my existing Automatic1111 install directory, and the models are being picked up correctly. The error is occurring while loading the checkpoint.

That said, I can only run some of them. I can use v1-5-pruned-emaonly.ckpt and sd_xl_base_1.0_fp16_vae.safetensors, but I can't use sd_xl_base_1.0.safetensors or juggernautXL_v7Rundiffusion.safetensors, for example. All of these checkpoints were downloaded before installing Enfugue, and they run fine using Automatic1111.

I haven't been able to find any references online at all to the error message.

The stack trace is as follows:

Traceback (most recent call last):
  File "enfugue\diffusion\process.py", line 199, in run

    response["result"] = self.handle(instruction_id, instruction_action, instruction_payload)

  File "enfugue\diffusion\process.py", line 260, in handle

    return self.execute_diffusion_plan(

  File "enfugue\diffusion\process.py", line 304, in execute_diffusion_plan

    return plan.execute(

  File "enfugue\diffusion\invocation\layers.py", line 1496, in execute

    images, nsfw = self.execute_inference(

  File "enfugue\diffusion\invocation\layers.py", line 1726, in execute_inference

    result = pipeline(

  File "enfugue\diffusion\manager.py", line 5400, in __call__

    pipe = self.pipeline # type: ignore

  File "enfugue\diffusion\manager.py", line 3414, in pipeline

    pipeline = self.pipeline_class.from_ckpt(self.model, **kwargs)

  File "enfugue\diffusion\pipeline.py", line 427, in from_ckpt

    if "unet_config" in original_config["model"]["params"]:  # type: ignore

  File "omegaconf\dictconfig.py", line 373, in __getitem__

  File "omegaconf\base.py", line 190, in _format_and_raise

  File "omegaconf\_utils.py", line 818, in format_and_raise

  File "omegaconf\_utils.py", line 716, in _raise

  File "omegaconf\dictconfig.py", line 367, in __getitem__

  File "omegaconf\dictconfig.py", line 438, in _get_impl

  File "omegaconf\dictconfig.py", line 470, in _get_node

omegaconf.errors.ConfigKeyError: Missing key model

    full_key: model

    object_type=dict
painebenjamin commented 9 months ago

Hello @MBRGA, thank you for the report!

Is there a configuration file with the same name as those checkpoints? For example, is there a juggernautXL_v7Rundiffusion.yaml, juggernautXL_v7Rundiffusion.yml or juggernautXL_v7Rundiffusion.json alongside those checkpoints in your Automatic installation? If so, could you please let me see one of them?

idoganel commented 9 months ago

I had this exact problem! I didn't understand why it was happening till now, but I think I finally understood what was causing it, inside the main models folder I had several subfolders to sort the different models (1.5, XL, my training) and the software doesn't know how to search within these subfolders, models that I placed under The main folder works fine. So if the models are not in the folder you specified during the installation, this may be what causes it.

MBRGA commented 9 months ago

@painebenjamin thanks for the response. See attached for Juggernaut and SDXL config files. juggernautXL_v7Rundiffusion.json sd_xl_base_1.0.json Looks like actually the ones that are working are the ones without config files.

@idoganel Definitely not the problem in my case - I don't have any subfolders!