chrisgoringe / cg-image-picker

227 stars 15 forks source link

right-click option not available #33

Closed halr9000 closed 11 months ago

halr9000 commented 11 months ago

When not paused, here's what I see image

When paused, right-click does nothing at all. Here's my js console, which seems could be relevant:

logging.js:315 Error calling extension 'cg.custom.core.DisplayText' method 'beforeRegisterNodeDef' Object Object Object
console.<computed> @ logging.js:315
logging.js:315 Error calling extension 'cg.custom.core.DisplayText' method 'beforeRegisterNodeDef' Object Object Object
console.<computed> @ logging.js:315
logging.js:315 Error calling extension 'cg.custom.core.DisplayText' method 'beforeRegisterNodeDef' Object Object Object
console.<computed> @ logging.js:315
logging.js:315 Error calling extension 'cg.custom.core.DisplayText' method 'beforeRegisterNodeDef' Object Object Object
console.<computed> @ logging.js:315
logging.js:315 Error calling extension 'cg.custom.core.DisplayText' method 'beforeRegisterNodeDef' Object Object Object
console.<computed> @ logging.js:315
logging.js:315 Error calling extension 'cg.custom.core.DisplayText' method 'beforeRegisterNodeDef' Object Object Object
console.<computed> @ logging.js:315
contextMenuFilter.js:28 Uncaught TypeError: Cannot read properties of undefined (reading 'filter')
    at contextMenuFilter.js:28:8
17workflows.js:317 Uncaught TypeError: Cannot read properties of null (reading 'content')
    at workflows.js:317:42
    at Array.findIndex (<anonymous>)
    at nodeType.getExtraMenuOptions (workflows.js:317:23)
    at node.getExtraMenuOptions (nodeMenu.js:224:32)
    at LGraphCanvas.getNodeMenuOptions (litegraph.core.js:13180:30)
    at LGraphCanvas.getNodeMenuOptions (images.js:33:42)
    at LGraphCanvas.getNodeMenuOptions (ttN.js:59:48)
    at LGraphCanvas.getNodeMenuOptions (ttNinterface.js:413:39)
    at LGraphCanvas.getNodeMenuOptions (reroutes.js:76:42)
    at LGraphCanvas.getNodeMenuOptions (ttNfullscreen.js:452:48)
halr9000 commented 11 months ago

Cancel throws this, which I suspect is on purpose, but just in case:

Traceback (most recent call last):
  File "D:\hal\stable-diffusion\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\hal\stable-diffusion\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\hal\stable-diffusion\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\hal\stable-diffusion\ComfyUI\custom_nodes\cg_custom_core\ui_decorator.py", line 35, in _ui_signal_decorated_function
    returns = getattr(self,internal_function_name)(**kwargs)
  File "D:\hal\stable-diffusion\ComfyUI\custom_nodes\cg-image-picker\image_chooser.py", line 168, in func
    MessageHolder.waitForMessage(id)
  File "D:\hal\stable-diffusion\ComfyUI\custom_nodes\cg-image-picker\image_chooser.py", line 58, in waitForMessage
    raise Cancelled()
cg-image-picker.image_chooser.Cancelled
halr9000 commented 11 months ago

Here's another which may be totally unrelated. I'm trying to use your fabric workflow, never used UE or image chooser before, and when I click go, it throws this:

Traceback (most recent call last):
  File "D:\hal\stable-diffusion\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\hal\stable-diffusion\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\hal\stable-diffusion\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\hal\stable-diffusion\ComfyUI\custom_nodes\cg_custom_core\ui_decorator.py", line 35, in _ui_signal_decorated_function
    returns = getattr(self,internal_function_name)(**kwargs)
  File "D:\hal\stable-diffusion\ComfyUI\custom_nodes\cg-image-picker\image_chooser.py", line 174, in func
    msg = MessageHolder.popMessage(id)
AttributeError: type object 'MessageHolder' has no attribute 'popMessage'
chrisgoringe commented 11 months ago

For the last one - pls update image picker, that was a stupid typo that I've now fixed.

chrisgoringe commented 11 months ago

the second one is, as you guessed, expected

chrisgoringe commented 11 months ago

the first one... looks like there is an issue with something called 'workflows.js' - possibly another custom node? I don't recognise it. The errors above (from my node!) almost certainly arise from the typo fixed above. So maybe LMK?

Erehr commented 11 months ago

Have similar problem where right click menu don't appear but narrowed it down to pythongosssss/ComfyUI-Custom-Scripts and disabling it fixed it. Console shows similar error too.

workflows.js:317 Uncaught TypeError: Cannot read properties of null (reading 'content')
    at workflows.js:317:42
    at Array.findIndex (<anonymous>)
    at nodeType.getExtraMenuOptions (workflows.js:317:23)
    at nodeType.getExtraMenuOptions (image-refiner.js:248:21)
    at LGraphCanvas.getNodeMenuOptions (litegraph.core.js:13180:30)
    at LGraphCanvas.processContextMenu (litegraph.core.js:13302:34)
    at LGraphCanvas.processMouseDown (litegraph.core.js:6269:10)
    at LGraphCanvas.processMouseDown (app.js:846:37)
halr9000 commented 11 months ago

Have similar problem where right click menu don't appear but narrowed it down to pythongosssss/ComfyUI-Custom-Scripts and disabling it fixed it. Console shows similar error too.

Oof -- can't disable that one. May as well quit using comfy altogether!

EricRollei commented 11 months ago

I still don't have right click function either. I don't understand why you took out the 'go' button from the image chooser node. I'm not going to disable other nodes obviously. Is there a way I can revert to a version that had the go button that worked?

chrisgoringe commented 11 months ago

There was an update of ComfyUI which broke a lot of custom nodes. Unfortunately, some bits of the node functionality were easier to fix than others...

I'm currently working on a much more stable, single-node solution (combining the preview and the choice), so rather than spend a lot of time fixing up nodes that I hope to make redundant anyway, I'm pushing the new version as quickly as I can.

I hope to have the new version out within the week, but anyone who would like to try it can...

cd [your comfy dir]/custom_nodes/cg-image-picker
git pull
git switch unify-chooser

then restart comfy and reload the webpage.

Errors found on that branch will get priority!

Erehr commented 11 months ago

Nice! Done a quick test, multichoice is working, #32 is fixed and no visible errors.

I agree with EricRollei that Go/Cancel button should be back instead of the HUD. Showing cancel when waiting and go when it's single image or selected from batch.

Ability to also select/unselect images with ctrl+left click would be nice (if possible) as combined with buttons it could reduce the amount of necessary clicks by half.

Erehr commented 11 months ago

Oh and right click is working now with pythongosssss/ComfyUI-Custom-Scripts on unify-chooser branch.

@Edit It's partial fix. It works with single image but breaks with multiple ones.

chrisgoringe commented 11 months ago

Added #35 and #36 for those two suggestions

Erehr commented 11 months ago

Suggestion: When there are multiple images and none are selected show on right click both 'Select' and 'Progress this'. That would save 2 clicks if someone want to progress only single one from entire batch.

trashie65 commented 11 months ago

I get this error when trying to git switch unify-chooser image error4

chrisgoringe commented 11 months ago

Try 'git pull' first (sorry, not a git expert!)

trashie65 commented 11 months ago

im no git expert either, but i do no you need a git repository to git pull from first. (and i can't find a git repository?) for unify-chooser?

chrisgoringe commented 11 months ago

the git repository is this one, https://github.com/chrisgoringe/cg-image-picker, unify-chooser is a branch.

Try this:

trashie65 commented 11 months ago

So after following your guide above now get these problems:

  1. ic error 1

  2. everything is installed no errors in console ic error 2

  3. when i did find the node and tried to use the process stops at the node (i cant find a image choose preview node anymore) as you can see no images no go button no cancel button, the floating button just say's Idle and i cant cancel the process from the queue i have to close Comfy? ic error 3

chrisgoringe commented 11 months ago

Ok, the images should appear in the preview node, that's obviously not working for you.

There should be a cancel option if you right click on the background as well.

But clearly it's not right - can you look in the JavaScript console for any errors? (F12)

trashie65 commented 11 months ago

This is the message from F12:

Unhandled message: {"type": "early-image-handler", "data": {"id": 2132462, "urls": [{"filename": "ComfyUI_temp_lsgqe00001.png", "subfolder": "", "type": "temp"}, {"filename": "ComfyUI_temp_lsgqe00002.png", "subfolder": "", "type": "temp"}]}} Error: Unknown message type early-image-handler createSocket http://127.0.0.1:8188/scripts/api.js:140

Can't see Cancel when right click background wall

ic error 4

chrisgoringe commented 11 months ago

Something very strange going on. Could you try this for me:

also, take a look in the server output for any messages that look like errors

it seems as if some part of the code isn't loading correctly, and I'd like to work out why,

trashie65 commented 11 months ago

Done what you ask...

Errors from F12

ic error 5

Can't see any error in server

trashie65 commented 11 months ago

Sorry i didn't see more in the image chooser error: here is the full error:

Error loading extension /extensions/image_chooser/image_chooser.js Error: Extension named 'cg.custom.image_chooser' already registered. registerExtension http://127.0.0.1:8188/scripts/app.js:1769

Choo [logging.js:315:10](http://127.0.0.1:8188/scripts/logging.js) type http://127.0.0.1:8188/scripts/logging.js:315 extensionPromises http://127.0.0.1:8188/scripts/app.js:1229
chrisgoringe commented 11 months ago

Aha!

That means that there is an old version of the javascript hanging around in your web folder. It's loading first, and stopping the new code from being loaded. The web folder doesn't get cleaned out even if you uninstall an extension (I've raised an issue with the ComfyUI core asking for that to be fixed).

So... can you look in

[comfy-path]/web/extensions (not under custom_nodes)

That is where all the javascript files get put when you start up comfy. Look for anything that looks like it might be related to the image_chooser - there's probably a folder, plus maybe stuff in cg-nodes, and let me know what you find (my extension is supposed to automatically remove the old versions, but clearly that isn't working, so I'd love to know what it missed).

Then delete the image_chooser related files. In fact, you can safely delete everything EXCEPT FOR the folder called 'core'. Don't touch core, it's comfyUI stuff. Everything else will be automatically reinstalled when you restart.

trashie65 commented 11 months ago

All deleted except core:

ic error 6

going to try Comfy again now

trashie65 commented 11 months ago

I thnk we are getting there, but. how to choose the image?

attached is the only message in F12

ic error 7

I also have problems with other custom nodes not working now?

chrisgoringe commented 11 months ago

The way to select an image is to right-click on the image - but if that isn't giving you 'select' as an option, it's probably due to the other error (and may also generate an error message in the log, you can check with f12)

So... what I'd like you to try is this:

find the file [comfy]/custom_nodes/cg_custom_core/js/ui_output_dispatch.js edit it (using a simple text editor, notepad or similar) find line 6 (where the error is coming from), which probably looks like this:

            if (message[message_type]) {

and change it to read

            if (false) {

That will turn off a relatively minor piece of functionality used by use_everywhere (the option to show in a text widget what got sent) which appears to be breaking for some reason.

If that fixes it, I'll be able to put a proper fix into an update.

Really appreciate you doing these tests, it will help make the nodes much more reliable!

trashie65 commented 11 months ago

No problem helping i realy like both of your custom nodes image chooser and anything everywhere and i really won't to use them in my workflow and tell others about them in the discord server im on

i go try what you said now

trashie65 commented 11 months ago

changed the .js ic error 9

right click image no options, just produces errors

ic error 8

trashie65 commented 11 months ago

Have we got an update as at the moment im not using the workflow incase you want me to test anything

chrisgoringe commented 11 months ago

I think you changed the file ui_output.js, not ui_output_dispatch.js...

trashie65 commented 11 months ago

Shit ok yes i did,, ive changed it back and changed the correct one. now try again

trashie65 commented 11 months ago

Still the same right click gives errors no options to choose

ic error 10

chrisgoringe commented 11 months ago

So looking at that error trace, I'm not seeing anything related to the image chooser - it's ttn, failfast, and ComfyUI-Custom-Scripts.

Most likely that means either one of those is broken, or there is an interaction between one of them and image chooser.

I'll try to install them and see what I can find out!

trashie65 commented 11 months ago

Ok thank you im also going to look if i still use any of the mentioned nodes if not i will delete

trashie65 commented 11 months ago

looks like it is pysssss ive removed the others and still have the problem

chrisgoringe commented 11 months ago

Ok, that helps.

trashie65 commented 11 months ago

i can confirm it was pysssss this is what was installed and causing the problem, https://github.com/pythongosssss/ComfyUI-Custom-Scripts. i now get to choose the image, but i have a problem with face detailer at the moment... but it looks like the problem is fixed... Hopefully

trashie65 commented 11 months ago

I can confirm now everything is working great yay. after deleting pythongosssss. thank you for your great node packs and your time... now to go and find another show text node (there arn't many about)... lol. Thank you again

trashie65 commented 11 months ago

can you write a quick show text node (nothing fancy just simple) even if its stand alone that i can use? please

halr9000 commented 11 months ago

For the record tho, seriously -- pythongosssss's stuff is mandatory to my workflow and I do recommend it to others. :D Not saying it's bug free! Just that it's full of some super useful stuff which I use constantly.

chrisgoringe commented 11 months ago

Yeah, I learned loads from looking at their custom nodes!

chrisgoringe commented 11 months ago

I'm working on some code for my nodes that should decouple them from pythonsssss, so hopefully the problem will go away... but first I need to reproduce it!

chrisgoringe commented 11 months ago

can you write a quick show text node (nothing fancy just simple) even if its stand alone that i can use? please

There's one in my utilities pack that might work for you - https://github.com/chrisgoringe/cg-utilities - under utilities/strings/showtext or something like that

On the other hand, it's based on pythossssss code, so maybe it's going to break!

trashie65 commented 11 months ago

Ok great ill go and have a look

trashie65 commented 11 months ago

Ive learned alot too getting to fix this problem... lol

chrisgoringe commented 11 months ago

Hey - I just did an update to the UE nodes which might help with compatibility with pythonssssss