Amblyopius/Stable-Diffusion-ONNX-FP16

Model conversion fails for fking_scifi_v2

samsismas opened this issue ยท 5 comments

Might be an issue with SD 2.1 768x768 models? Shark apparently has an issue with those too.

https://civitai.com/models/2107/fkingscifiv2

Traceback (most recent call last):
File "O:\onnx\conv_sd_to_onnx.py", line 351, in
pl = load_pipeline_from_original_stable_diffusion_ckpt(
File "O:\onnx\sd_env_conv\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 963, in load_pipeline_from_original_stable_diffusion_ckpt
text_model = convert_open_clip_checkpoint(checkpoint)
File "O:\onnx\sd_env_conv\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 745, in convert_open_clip_checkpoint
d_model = int(checkpoint["cond_stage_model.model.text_projection"].shape[0])
KeyError: 'cond_stage_model.model.text_projection'

It's indeed a 768x768 model and I can't convince it to convert either. I'll put in on the backlog and see if I can figure out what is causing it. My conversion is likely facing the same issue as SHARK so if either gets fixed we can probably fix the other one.

This comment has a fix that makes it work for me.

Looks like there's some effort on trying to get this fixed in diffusers which is probably better than trying to work around it (which would likely force me to drag even more code from diffusers into the repo). With some luck the next version of diffusers fixes this officially.

Seems like this was fixed in diffusers 0.14.0 (enable your env and do pip install -r requirements.txt --upgrade if you haven't done so for a while)