imaginAIry icon indicating copy to clipboard operation
imaginAIry copied to clipboard

Merged model artifacts

Open Astropulse opened this issue 2 years ago • 8 comments

Some merged models are giving strange results:

Expected result (via Automatic1111): prompt "detailed photo of a bowl of fruit" negative prompt "blurry" steps 20 seed 812980511 cfg 7 sampler ddim 00875-812980511-detailed photo of a bowl of fruit

Result from ImaginAIry: prompt "detailed photo of a bowl of fruit" negative prompt "blurry" steps 20 seed 812980511 cfg 7 sampler ddim my_image

Model was a merge of a dreambooth model based on 1.5 and https://huggingface.co/Corruptlake/Sci-Fi-Diffusion

No errors, other models work fine, including other merges. This may just be an issue with Sci-Fi-Diffusion, but as it doesn't cause the same issues in base stable diffusion environment, or automatic1111's webui, I thought it may have something to do with how models are being loaded.

Astropulse avatar Jan 22 '23 18:01 Astropulse

I'd guess it's using the wrong config somehow. Does scifi diffusion work by itself?

brycedrennan avatar Jan 22 '23 19:01 brycedrennan

Yep, both models work on their own, it only causes this issue when merged.

Same when using other models + scifi diffusion.

Astropulse avatar Jan 22 '23 19:01 Astropulse

What format is the dreambooth model in? How many GB is it? What software created it? How big is the merged model? What format is it in?

brycedrennan avatar Jan 23 '23 13:01 brycedrennan

I'd probably need to see the merged weights to figure out what was going on

brycedrennan avatar Jan 23 '23 14:01 brycedrennan

Both models are pickled, the base model is 5.57 GB, and the merged model created in Automatic1111 is a few KB larger. Here's a google drive link to the model causing issues: https://drive.google.com/file/d/1LLQhYQgeF5CqlO2mn8ELQDiKaV32pyvz/view?usp=share_link

Astropulse avatar Jan 23 '23 19:01 Astropulse

Thanks for providing everything asked. I can't "trust" the pickle so I need to find some sort of pickle scanner first before I try it out.

brycedrennan avatar Jan 24 '23 02:01 brycedrennan

Completely understandable, thank you for looking into this.

Astropulse avatar Jan 24 '23 02:01 Astropulse

Looks like the weights contain some data in float16 and some float32. Just guessing that's the issue

brycedrennan avatar Jan 24 '23 09:01 brycedrennan

Are you manually loading VAE's at all? This kind of artifact can be caused by the wrong VAE being loaded.

Astropulse avatar Jan 26 '23 01:01 Astropulse

I'm talking about the weights in the file you linked to. I have not opened it but I did use a pickle inspector to look at the datatypes. It has mixed types.

brycedrennan avatar Jan 26 '23 02:01 brycedrennan

Other merges with fp16 and fp32 were working, here's some confirmation that it's the VAE.

Default VAE: 0-a dog-no-vae

VAE from https://huggingface.co/stabilityai/sd-vae-ft-mse: 0-a dog-correct-vae

Is there a way to manually specify the VAE file to load from?

Astropulse avatar Jan 26 '23 14:01 Astropulse

I've fixed the issue by replacing the VAE contained in the model, but a way to do this on the fly would be quite helpful.

Astropulse avatar Jan 26 '23 15:01 Astropulse