Is this working with diffusers?

#1
by crapthings - opened

0.27.2

Traceback (most recent call last):
  File "/home/zznet/workspace/ai-pipe/prod-ai-pipe-replace-model/runpod_app.py", line 14, in <module>
    from pipe import text2img, getText2imgPipe, set_sampler, compel
  File "/home/zznet/workspace/ai-pipe/prod-ai-pipe-replace-model/pipe.py", line 17, in <module>
    canny_control = ControlNetModel.from_single_file('/home/zznet/workspace/ControlNet/models/controlnet_canny_tudaqian.pth', torch_dtype = torch.float16)
  File "/home/zznet/.local/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/zznet/.local/lib/python3.10/site-packages/diffusers/loaders/controlnet.py", line 124, in from_single_file
    component = create_diffusers_controlnet_model_from_ldm(
  File "/home/zznet/.local/lib/python3.10/site-packages/diffusers/loaders/single_file_utils.py", line 973, in create_diffusers_controlnet_model_from_ldm
    diffusers_format_controlnet_checkpoint = convert_controlnet_checkpoint(checkpoint, diffusers_config)
  File "/home/zznet/.local/lib/python3.10/site-packages/diffusers/loaders/single_file_utils.py", line 937, in convert_controlnet_checkpoint
    new_checkpoint["controlnet_mid_block.weight"] = controlnet_state_dict.pop("middle_block_out.0.weight")
KeyError: 'middle_block_out.0.weight'

You need to convert keys to diffusers format before loading the state_dict to diffusers.

You need to convert keys to diffusers format before loading the state_dict to diffusers.

thanks. how do i know the keys from diffusers?

Sign up or log in to comment