Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't convert from controlNet model to diffusers #2550

Closed
brurpo opened this issue Mar 4, 2023 · 3 comments
Closed

Can't convert from controlNet model to diffusers #2550

brurpo opened this issue Mar 4, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@brurpo
Copy link

brurpo commented Mar 4, 2023

Describe the bug

I was able to do so before the PR merge, when it was being developed.

now it throws the following error:

Traceback (most recent call last):
  File "E:\BRP_STABLE_DIFFUSION\bin\convert_original_stable_diffusion_to_diffusers.py", line 129, in <module>
    pipe = load_pipeline_from_original_stable_diffusion_ckpt(
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 1251, in load_pipeline_from_original_stable_diffusion_ckpt
    ctrlnet_config = create_unet_diffusers_config(original_config, image_size=image_size, controlnet=True)
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 234, in create_unet_diffusers_config
    unet_params = original_config.model.params.control_stage_config.params
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\base.py", line 231, in _format_and_raise
    format_and_raise(
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\_utils.py", line 899, in format_and_raise
    _raise(ex, cause)
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\_utils.py", line 797, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "E:\BRP_STABLE_DIFFUSION\bin\lib\site-packages\omegaconf\dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key control_stage_config
    full_key: model.params.control_stage_config
    object_type=dict

Reproduction

Just try to convert an existing controlNet pth

Logs

No response

System Info

2990wx
2080ti

@brurpo brurpo added the bug Something isn't working label Mar 4, 2023
@Pirog17000
Copy link

Any hint how to convert pth with diffusers at all? I mean, without conversion will be great.. To make it run locally with '.from_pretrained()'

@takuma104
Copy link
Contributor

takuma104 commented Mar 5, 2023

Hi @brurpo @Pirog17000 ,In the latest version of the main branch, you can do the conversion like this:

python scripts/convert_original_stable_diffusion_to_diffusers.py --checkpoint_path .../control_sd15_canny.pth --original_config_file .../cldm_v15.yaml --to_safetensor --controlnet --dump_path .../control_wd15_canny/

The arguments can be specified like this:

@Pirog17000
Copy link

@takuma104 what does the script trying to download? 🤔
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants