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

Embedding forced reload. #223

Merged
merged 3 commits into from
Aug 20, 2023
Merged

Conversation

Symbiomatrix
Copy link
Contributor

@Symbiomatrix Symbiomatrix commented Aug 20, 2023

Hey dom, been having some trouble with getting embeddings to reload on the latest webui.
I found this method load_textual_inversion_embeddings which can be called to reload embeddings instantly, adding it to refresh_temp_files seems to do the trick for me.
The force_reload might not be necessary but I think it's better to be sure we're refreshing. I'm not sure whether auto's architecture on this is the same as vlad's (and of course in legacy versions), so I added an exception and dummified the function in such cases.

@DominikDoom
Copy link
Owner

Yeah, the current update function will only refresh on a model change or if the user reloads embeddings using the extra networks button beforehand. Don't know why I didn't add the direct call beforehand, but from a quick git blame, it should be in every legacy version too by now.

This is the earliest commit with the force flag AUTOMATIC1111/stable-diffusion-webui@f55ac33, which was still in 2022, so I think it would also be safe to leave the fallback out (although it doesn't hurt either). Most version splits are just for the gradio and hires fix changes some hold on to, which was much later.

If we want to leave the callback in, I would change the message a bit, though. To avoid confusion a "Tag Autocomplete: ..." or "tag_autocomplete_helper: ..." message prefix would be preferred, also "reload" instead of load to make the attempted functionality clearer.

@Symbiomatrix
Copy link
Contributor Author

Symbiomatrix commented Aug 20, 2023

In my old version, the embedding reload somehow seemed to happen naturally after a few gens even without loading a new model (which I rarely do) or pressing the extra networks button (which I don't use at all). Perhaps there was some other roundabout call. It was a bit of a pain actually since embedding reload was extremely slow.

If we want to leave the callback in, I would change the message a bit, though. To avoid confusion a "Tag Autocomplete: ..." or "tag_autocomplete_helper: ..." message prefix would be preferred, also "reload" instead of load to make the attempted functionality clearer.

Done.

@DominikDoom
Copy link
Owner

In my old version, the embedding reload somehow seemed to happen naturally after a few gens

Yeah, I think while parsing the prompt, it calls the function internally if changes are detected. Not sure under which conditions exactly though.

@DominikDoom DominikDoom merged commit b2a663f into DominikDoom:main Aug 20, 2023
@Symbiomatrix
Copy link
Contributor Author

Cool, that makes sense. Thanks.

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

Successfully merging this pull request may close these issues.

2 participants