zero01101 / openOutpaint

local offline javascript and html canvas outpainting gizmo for stable diffusion webUI API 🐠
MIT License
499 stars 43 forks source link

[Bug]: workspace.defaults doesn't populate and breaks new installs #186

Closed zero01101 closed 1 year ago

zero01101 commented 1 year ago

What happened?

running openOutpaint in a private firefox window with no existing localstorage values for certain parameters results in a completely unusable UI and several console errors

Uncaught ReferenceError: defaults is not defined
    get http://127.0.0.1:3456/js/lib/workspaces.js?v=4fbd55b:36
    makeSlider http://127.0.0.1:3456/js/index.js?v=b1402ee:590
    <anonymous> http://127.0.0.1:3456/js/index.js?v=b1402ee:650
Uncaught ReferenceError: can't access lexical declaration 'resSlider' before initialization
    populateContextMenu http://127.0.0.1:3456/js/ui/tool/dream.js?v=d1ba895:1634
    enable http://127.0.0.1:3456/js/lib/toolbar.js?v=306d637:115
    <anonymous> http://127.0.0.1:3456/js/initalize/toolbar.populate.js?v=c1ca438:33
Uncaught ReferenceError: defaults is not defined
    get http://127.0.0.1:3456/js/lib/workspaces.js?v=4fbd55b:36
    loadSettings http://127.0.0.1:3456/js/index.js?v=b1402ee:1317
    startup http://127.0.0.1:3456/js/index.js?v=b1402ee:163
    EventHandlerNonNull* http://127.0.0.1:3456/js/index.js?v=b1402ee:87

Steps to reproduce the problem

  1. open a private tab in firefox
  2. load up openOutpaint
  3. enter host IP
  4. check console errors

What should have happened?

workspace.current.defaults should populate with the default values from defaults.js (https://github.com/zero01101/openOutpaint/commit/ba8abdb8d32d87cdcaa835c06e8b2c689af56003#diff-fa4dbebdeb07bc359c0e54b8e194e00c783abf62fb5d7f8a54d2e70e620932e4R12) as it's pretty obviously supposed to, but setting a breakpoint on index.js:590 shows that workspace.current gets the "Default" name as expected and defined on workspaces.js:125 , yet the defaults object is undefined even though it's supposedly given defaults on workspaces.js:126 (https://github.com/zero01101/openOutpaint/commit/ba8abdb8d32d87cdcaa835c06e8b2c689af56003#diff-d4511c9aa5b0cb83135b7e37c7c3fec4cd750321158192ac050e6de92f94d0dfR124-R126)

i've tried many stupid things to get them to recognize including duplicating the default object values directly in the defaults object in workspaces.js:22 AND :81 with no dice and i'm just dumb

Commit where the problem happens

https://github.com/zero01101/openOutpaint/commit/ba8abdb8d32d87cdcaa835c06e8b2c689af56003

What platforms do you use to access openOutpaint?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Browser Extensions/Addons

lots

AUTOMATIC1111 webUI Commandline Arguments

a whole bunch

Additional information

No response

zero01101 commented 1 year ago

band-aid applied in https://github.com/zero01101/openOutpaint/commit/abde86d6b64af94eabaf3412124ed1dc90ce0213 but it grossly duplicates the default options into the ctor for the workspace :/

seijihariki commented 1 year ago

We can actually just drop the workspace.js and anything related to it... I ended up using a completely different approach from what I initially planned.

The workspace.js is now just an overcomplicated way of accessing settings. Will revert these for now.

seijihariki commented 1 year ago

Should be fixed on 462b1d67133403e0a637f37345e292d32e16dc7d, sorry for the problems.

zero01101 commented 1 year ago

We can actually just drop the workspace.js and anything related to it...

legit irl lmao that was the least expected response

sorry for the problems.

YOU STOPPIT you've made this app literally leagues beyond what i could have ever dreamed of <3