Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Reload wildcard files on queue start #37

Open
michaelLochlann opened this issue Nov 14, 2023 · 12 comments
Open

Feature Request: Reload wildcard files on queue start #37

michaelLochlann opened this issue Nov 14, 2023 · 12 comments

Comments

@michaelLochlann
Copy link

michaelLochlann commented Nov 14, 2023

Current State:
Wildcard files appear to be loaded once at ComfyUI start and never refreshed again.
This means any wildcard file changes/edits require a ComfyUI restart to use.

Proposed State:
Whenever you hit "Queue Prompt" or "Refresh" on ComfyUI it should reload the wildcard files.
This is how A1111 does it currently.

I wouldn't imagine this would be a resource problem as it's just text files and those normally handle pretty fast.
So it seems to me a programming/ComfyUI problem to solve.

Hopefully we can get this as troubleshooting/adding to wildcard files will be a big pain if you have to restart every time.

@rafstahelin
Copy link

Has this been fixed?

@darkpixel
Copy link

It doesn't appear so. I'm running the latest release, and I still have to restart ComfyUI after updating wildcard text files.

@rafstahelin
Copy link

It doesn't appear so. I'm running the latest release, and I still have to restart ComfyUI after updating wildcard text files.

really not worth it.
I Think a better solution might be to go for Comfyroll Custom Nodes "List Nodes" as you can save lists and update lists on the fly on the workflow itself

@michaelLochlann
Copy link
Author

What I've been doing is closing the python EXE and restarting it then going back to the browser window I had open. But it makes testing additions/changes an extreme PITA. List nodes might be good if it's static but the dynamic prompts also allow you to weight different things to show up more often or less often, which I'm using extensively. I would think if the program had a "load wildcards" function it would be trivial to call it on run instead of on load, but I dunno how any of this works.

@rafstahelin
Copy link

We could ask the developer of list nodes to add a load from yaml node that lets you use weights. She's on Ai Revolution discord. I'll ask her there, and that would just solve the refresh annoyance

@darkpixel
Copy link

I worked around this by writing a simple ComfyUI add-on that accepts a filename, reads the file, strips out blank lines and any text after a comment (# character) and then feed that into a "Text Random Line" node.

The reason dynamicprompts isn't re-reading on every access is probably because the wildcard files are read during __init__ here (

self._random_generator = RandomPromptGenerator(
) instead of during the call to get_prompt.

@rafstahelin
Copy link

Could I install this addon? Mind sharing?

@darkpixel
Copy link

I'm still working on cleaning it up and getting things packaged. We're in the middle of a huge ice storm at the moment, so I've got my hands full, but I'll try to get it shared within the next few days.

@rafstahelin
Copy link

Oh I wish I could be in a thunder storm. Ok!

@darkpixel
Copy link

Hey @rafstahelin, I finally polished the code off and tossed it into my production workflow.
Not sure if it's what you're looking for, but it's already working well for me.

https://github.com/darkpixel/darkprompts

It's not in the ComfyUI Manager list yet because I still have some packaging work to do, but the README explains the simple install. Feel free to leave a bug report if you run into any trouble.

@rafstahelin
Copy link

rafstahelin commented Jan 20, 2024 via email

@darkpixel
Copy link

GMT-8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants