diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

refactor(scripts): `params` and `conv_shortcut`

Open ryanrussell opened this issue 3 years ago • 5 comments

Signed-off-by: Ryan Russell [email protected]

This one has functional implications.

@pcuenca -- I don't believe either of these scripts were doing what they were intended to do.

  • create_ldm_bert_config() -- Was calling a bad object path...
  • Please let me know if the replace was intentionally mis-spelled and I'm missing context.

Best, Ryan

ryanrussell avatar Sep 24 '22 15:09 ryanrussell

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Also, should

        new_item = new_item.replace("conv_shortcut", "conv1")
        new_item = new_item.replace("in_shortcut", "conv_shortcut")

be

        new_item = new_item.replace("in_shortcut", "conv_shortcut")
        new_item = new_item.replace("conv_shortcut", "conv1")

instead? (Should in_shortcut end up as conv_shortcut or conv1)?

ryanrussell avatar Sep 24 '22 15:09 ryanrussell

Hi @anton-l could you please take a look here? :)

pcuenca avatar Sep 24 '22 15:09 pcuenca

Hi @ryanrussell! The naming here really depends on the structure of the original checkpoints. I'm off this week, but would you like to investigate and try to convert the original DDPM and SD checkpoints with and without your changes? :)

anton-l avatar Sep 24 '22 16:09 anton-l

Hey @patil-suraj .. Sorry for being a bit slow on this. I'm on the road this week, it is on my todo list.

One question -- do you know where I could locate a sample config?

python scripts/convert_ddpm_original_checkpoint_to_diffusers.py  --checkpoint_path models/diffusion_cifar10_model/model-790000.ckpt 
usage: convert_ddpm_original_checkpoint_to_diffusers.py [-h] --checkpoint_path CHECKPOINT_PATH --config_file CONFIG_FILE --dump_path DUMP_PATH
convert_ddpm_original_checkpoint_to_diffusers.py: error: the following arguments are required: --config_file, --dump_path

There are some references to a config.json that I'm unable to find.

src/diffusers/utils/__init__.py:CONFIG_NAME = "config.json"

It looks like this config has number of variables if you check the codebase for grep -r ' config.get'

Tangentially related -- I did find a link to an ldm-bert config.json in the source, but it 404's. Found another, opened #675 for guidance as I'm not sure the one I found is the canonical/correct config.json .. I am also skeptical this config is correct for ddpm

I'm likely missing something simple as to where to get this, thanks for the guidance!

ryanrussell avatar Sep 29 '22 13:09 ryanrussell

Here is a sample config if you still need one :-) https://huggingface.co/google/ddpm-bedroom-256/blob/main/config.json

patrickvonplaten avatar Oct 26 '22 13:10 patrickvonplaten

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Nov 19 '22 15:11 github-actions[bot]