model selector update for upcoming webUI 1.5

This commit is contained in:
tim h 2023-07-22 10:43:31 -05:00
parent e853b9f685
commit ba4893d821
3 changed files with 17 additions and 10 deletions

View file

@ -316,7 +316,7 @@
<span id="version">
<a href="https://github.com/zero01101/openOutpaint" target="_blank">
<s>Alpha release v0.0.16.4</s>
v20230722.001
v20230722.002
</a>
<br />
<a
@ -539,7 +539,7 @@
<!-- Content -->
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
<script src="js/index.js?v=c6b95a9" type="text/javascript"></script>
<script src="js/index.js?v=d4006e8" type="text/javascript"></script>
<script
src="js/ui/floating/history.js?v=4f29db4"
@ -553,7 +553,7 @@
src="js/ui/tool/generic.js?v=3e678e0"
type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=1bbd3fe" type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=06e0164" type="text/javascript"></script>
<script
src="js/ui/tool/maskbrush.js?v=e9bd0eb"
type="text/javascript"></script>

View file

@ -1172,7 +1172,17 @@ async function getModels(refresh = false) {
);
const optData = await optResponse.json();
const model = optData.sd_model_checkpoint;
var model = optData.sd_model_checkpoint;
// 20230722 - sigh so this key is now removed https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/66c5f1bb1556a2d86d9f11aeb92f83d4a09832cc
// no idea why but time to deal with it
if (model === undefined) {
const modelHash = optData.sd_checkpoint_hash;
const hashMap = data.map((option) => ({
hash: option.sha256,
title: option.title,
}));
model = hashMap.find((option) => option.hash === modelHash).title;
}
console.log("Current model: " + model);
if (modelAutoComplete.value !== model) modelAutoComplete.value = model;
} catch (e) {

View file

@ -62,12 +62,9 @@ const _monitorProgress = (bb, oncheck = null) => {
}
const timeSpent = performance.now() - init;
setTimeout(
() => {
if (running) _checkProgress();
},
Math.max(0, minDelay - timeSpent)
);
setTimeout(() => {
if (running) _checkProgress();
}, Math.max(0, minDelay - timeSpent));
};
_checkProgress();