quick bandaid to let new installs work at least

should probably be fixed better
This commit is contained in:
tim h 2023-01-28 14:34:04 -06:00
parent c7a68f3e37
commit abde86d6b6
2 changed files with 19 additions and 5 deletions

View file

@ -402,7 +402,7 @@
<script src="js/lib/util.js?v=e82dd04" type="text/javascript"></script> <script src="js/lib/util.js?v=e82dd04" type="text/javascript"></script>
<script src="js/lib/events.js?v=2ab7933" type="text/javascript"></script> <script src="js/lib/events.js?v=2ab7933" type="text/javascript"></script>
<script <script
src="js/lib/workspaces.js?v=4fbd55b" src="js/lib/workspaces.js?v=75777c5"
type="text/javascript"></script> type="text/javascript"></script>
<script src="js/lib/db.js?v=434363b" type="text/javascript"></script> <script src="js/lib/db.js?v=434363b" type="text/javascript"></script>
<script src="js/lib/input.js?v=aa14afc" type="text/javascript"></script> <script src="js/lib/input.js?v=aa14afc" type="text/javascript"></script>

View file

@ -29,14 +29,14 @@ class Workspace {
settings = new Proxy( settings = new Proxy(
{}, {},
{ {
get(t, name) { get: (t, name) => {
if (t[name] === undefined) if (t[name] === undefined)
t[name] = t[name] =
JSON.parse(localStorage.getItem(`openoutpaint/${name}`)) ?? JSON.parse(localStorage.getItem(`openoutpaint/${name}`)) ??
defaults[name]; this.defaults[name];
return t[name]; return t[name];
}, },
set(t, name, value) { set: (t, name, value) => {
localStorage.setItem(`openoutpaint/${name}`, JSON.stringify(value)); localStorage.setItem(`openoutpaint/${name}`, JSON.stringify(value));
t[name] = value; t[name] = value;
}, },
@ -77,7 +77,21 @@ class Workspace {
*/ */
constructor(name, options = {}) { constructor(name, options = {}) {
defaultOpt(options, { defaultOpt(options, {
defaults: {}, defaults: {
/** Default Prompt - REQ */
prompt: "ocean floor scientific expedition, underwater wildlife",
/** Default Negative Prompt - REQ */
neg_prompt:
"people, person, humans, human, divers, diver, glitch, error, text, watermark, bad quality, blurry",
/** Default Stable Diffusion Seed - REQ */
seed: -1,
/** Default CFG Scale - REQ */
cfg_scale: 7.0,
/** Default steps - REQ */
steps: 30,
/** Default Resolution */
resolution: 512,
},
}); });
this.name = name; this.name = name;