ewrfcas / LeftRefill

LeftRefill: Filling Right Canvas based on Left Reference through Generalized Text-to-Image Diffusion Model (CVPR2024)
Apache License 2.0
56 stars 2 forks source link

Gradio demo and model loading broken - missing keys #5

Closed JohnMe closed 5 months ago

JohnMe commented 5 months ago

Hi, I'm trying to reproduce your results.

I put the 512-inpainting-ema.ckpt

(from https://huggingface.co/stabilityai/stable-diffusion-2-inpainting/blob/main/512-inpainting-ema.ckpt)

into pretrained_models as suggested in the Readme. But it seems the version is not correct since ref_inpainting_gradio.py showing the following error message:

unexpected keys:[]
error msgs:[]
Loaded state_dict from [pretrained_models/512-inpainting-ema.ckpt]
missing keys:['logvar', 'cond_stage_model.special_embeddings.weight']
unexpected keys:['model_ema.decay', 'model_ema.num_updates']
error msgs:[]
Running on local URL:  http://0.0.0.0:6007

To create a public link, set `share=True` in `launch()`.

Besides run on the gradio app is never terminating. Console does not show any more errors...

Please let me know what I need to change.

Thanks a lot

ewrfcas commented 5 months ago

Hi, it is natural for these logs. Because our model should load 2 separate weights. Formally, it will load "special_embeddings" at first, then it will load the whole SD2-inpainting without "special_embeddings". Since the first loading would not show any logs, you only see the missing keys of "cond_stage_model.special_embeddings.weight" during the second loading, but they have been already loaded at the first time.

JohnMe commented 5 months ago

Thanks for the prompt answer. Good to know I can safely ignore the errors.

I got it working now it is a gradio version problem since some of the used features are not working in lower and others not working in higher versions.

gradio==3.36.1 works fine for me.

Inpainting looks good. Thanks a lot!