lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.36k stars 812 forks source link

[Bug]: SD1.5 v-pred checkpoints don't work properly after the latest update #1109

Closed zxlostsoul closed 1 week ago

zxlostsoul commented 2 months ago

Some of the latest changes are broken 1.5 v-pred models.

Model example: https://civitai.com/models/199059/9th-tail

It has .yaml config with

model:
  params:
    parameterization: "v"

But for some reason it doesn't work like before.

Tested on clean webui-forge setup.

It creates mess instead of images: 00017-771476832

rabidcopy commented 2 months ago

It seems things relating to custom configurations for checkpoints got thrown out. Don't see any apparent way to set prediction types in the current repo state. https://github.com/lllyasviel/stable-diffusion-webui-forge/commit/bccf9fb23a2cbc9d42091a856b3d35b2c4414d51#diff-b710a9b8e9fbcc5bc5a014f938c9c74564c1dcfc86929f0dc9ff643ba3fe7873

zxlostsoul commented 2 months ago

For those who need v-pred models right now:

Switch git repo to commit e3522c89191a01e0dd5855abbfd15cb685be3634 , it's the last commit where checkpoint configs works (02.08.2024).

Commit bc9977a305391ec389e327f17df0bc33dd0ad472 is breaking it.

Hope there will be other way to set prediction type soon...

alesimula commented 2 months ago

@lllyasviel Any update on this? A lot of models just stopped working alltogether

geriberton commented 1 month ago

I also could not load a v-prediction model correctly, it seems to be ignoring the lines in the yaml and produces burnt images because of it.

rabidcopy commented 4 weeks ago

I've made a patch that allows you to override the prediction type used for sampling under Sampler parameters. image Needs to be applied prior to the model being loaded for inference. (Restart or load another model if it's still stuck in eps.) Save the following txt file in the root of your Forge folder and run git apply prediction.txt. prediction.txt

DenOfEquity commented 3 weeks ago

Nice work, rabidcopy. If the prediction_type is set at the start of sampling instead, there's no issue with needing to apply before model is loaded. branch. Settings > User interface > Quicksettings list can be used to add your new setting to the UI. I'm unsure about merging though, it feels just a bit too much like a hack. Then I realised it could be done entirely with an extension, so added it to this.

rabidcopy commented 3 weeks ago

Then I realised it could be done entirely with an extension, so added it to this.

Nice, I will admit the former is indeed hacky.

somelinuxguy commented 3 weeks ago

I would love to see this repaired, but getting the feeling this is a low priority and we should just stick with SDXL and Flux models.

alesimula commented 2 weeks ago

@catboxanon

I don't get it, tried the latest version with the model EasyFluff_v10-Prerelease with the yaml file in the same directory as the model, it's still not generating properly, am I missing something? (it works if i checkout e3522c8)

image

catboxanon commented 2 weeks ago

Re-opening so the previous .yaml file loading support can be looked into. Or perhaps another method to fix it.

rabidcopy commented 2 weeks ago

I can only suggest my patch from several comments above to set the prediction for 1.5 models. I don't plan to make a PR but anyone else is free to adapt it while not causing unforeseen bugs or conflicts with other related code. (The latter is out of scope for me.) As is, it probably shouldn't conflict with current auto-detect behavior as it defaults to "Leave Unchanged" and doesn't touch anything unless an option that isn't that one is applied.

catboxanon commented 1 week ago

Should be fixed now. https://github.com/lllyasviel/stable-diffusion-webui-forge/pull/2224

alesimula commented 1 week ago

Should be fixed now. #2224

@catboxanon

I have tried the same model I have linked in my previous comment, nothing seems to have changed, have you tested it and is it working for you?

image

catboxanon commented 1 week ago

Sorry, that's my bad, missed a pretty obvious typo. I tested with that model and config to be sure and it works for me now. (https://github.com/lllyasviel/stable-diffusion-webui-forge/pull/2228)

alesimula commented 1 week ago

Sorry, that's my bad, missed a pretty obvious typo. I tested with that model and config to be sure and it works for me now. (#2228)

Thanks, I can confirm it's working now