pythongosssss / ComfyUI

A powerful and modular stable diffusion GUI with a graph/nodes interface.
GNU General Public License v3.0
7 stars 1 forks source link

TypeError: presets.find(...) is undefined #1

Closed wyrde closed 9 months ago

wyrde commented 1 year ago

When presetText nodes are present, nothing happens when queuing the workflow.

From console (firefox)

Uncaught (in promise) TypeError: presets.find(...) is undefined
    applyToGraph http://127.0.0.1:9288/extensions/pythongosssss/presetText.js:126
    graphToPrompt http://127.0.0.1:9288/scripts/app.js:1114
    queuePrompt http://127.0.0.1:9288/scripts/app.js:1193
    onclick http://127.0.0.1:9288/scripts/ui.js:485
    $el http://127.0.0.1:9288/scripts/ui.js:25
    ComfyUI http://127.0.0.1:9288/scripts/ui.js:482
    ComfyApp http://127.0.0.1:9288/scripts/app.js:31
    <anonymous> http://127.0.0.1:9288/scripts/app.js:1296

presettext error — Mozilla Firefox

workflow: latent-hrf-x20-v03.zip

(venv) (base) PS D:\sd\comfyui\git\pgs\comfy-groups> git pull
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (20/20), done.
Unpacking objects:  69% (39/56)used 33 (delta 27), pack-reused 9
Unpacking objects: 100% (56/56), 24.12 KiB | 588.00 KiB/s, done.
From https://github.com/pythongosssss/ComfyUI
   03157d1..ce88bec  group-node          -> origin/group-node
   7520f50..1ed75c8  prompt-permutations -> origin/prompt-permutations
Updating 03157d1..ce88bec
Fast-forward
 web/scripts/widgets.js | 4 ++++
 1 file changed, 4 insertions(+)
(venv) (base) PS D:\sd\comfyui\git\pgs\comfy-groups> python .\main.py --port 9288
wyrde commented 1 year ago

I use them for setting folder and prefix name for saves

preset text 2023-04-28 08_37_20-ComfyUI — Mozilla Firefox

wyrde commented 1 year ago

pythongosssss ok think i've tracked down the preset text error - did you have a preset selected, then delete/rename it? that'll cause it

Ah, I see now.

preset text 2023-04-28 08_55_29-ComfyUI — Mozilla Firefox

The presets are missing. Are they stored externally?

Once I restored the values, the workflow functioned again.

pythongosssss commented 1 year ago

Presets are stored in localStorage, not sure why yours arent there unless you cleared it?

pythongosssss commented 1 year ago

Are you running this fork on a different port? Browser will probably treat that as a new website and not have any of your existing storage

wyrde commented 1 year ago

Are you running this fork on a different port? Browser will probably treat that as a new website and not have any of your existing storage

ah, yes. I am on a different port.

pythongosssss commented 1 year ago

image I've added this prompt when it crashes

wyrde commented 1 year ago

An issue I see is using local storage makes sharing workflows with the presetText nodes problematic. Is that changed with the newer version?

pythongosssss commented 1 year ago

Hmm, no, this just prevents the silent crash. I'll have a think.

wyrde commented 1 year ago

For my usecase, I'm using the presetTexts for storing folder and prefix names to include in Save Image nodes for the filename_prefix widget.

What I'm find out now (and it makes perfect sense since they're using local storage) is the values in the presetText widgets are being saved according to the last workflow opened--which means the current one may not have the values I wanted for it. Not a big deal now that I know why--it's a matter of keeping the presets unique for each workflow or using a different method to pass the values to the text nodes.

by the way, should this be moved to your custom nodes repo since it isn't an issue with the group nodes?

pythongosssss commented 1 year ago

I don't mind it staying here I think I might add a property to the preset text that stores actual preset text value, then when sharing workflows it can use that value if the preset with the name is missing