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

Integrate metadata editor #69

Open
space-nuko opened this issue Jan 28, 2023 · 1 comment · Fixed by #77
Open

Integrate metadata editor #69

space-nuko opened this issue Jan 28, 2023 · 1 comment · Fixed by #77

Comments

@space-nuko
Copy link
Contributor

space-nuko commented Jan 28, 2023

So after closing #45 I wrote https://github.com/space-nuko/sd-webui-model-metadata-editor and it works pretty well. However I'm finding a few downsides from having the functionality separated from additional_networks:

  1. No ability to pass a model from additional_networks into the metadata editor and vice-versa. I have to go to the dropdown to select the model a second time even though it's already selected in one place. The dropdown is super inconvenient with hundreds of models and it's double the work each time
  2. The metadata editor tab makes the additional networks tab redundant, the additional networks tab is pretty empty currently
  3. Model hashing has to be done separately for each extension since they have no knowledge of each others' hashing caches, eating up additional time doing the same exact work two times. It makes much more sense for them to share a single cache
  4. Less adoption of the metadata system since many more people use additional_networks than they do model-metadata-editor. If nobody knows the metadata is even there then it doesn't really help anyone

I do know it's a lot of code, but I'm mulling whether or not the extra maintenance burden is worth the tighter integration with additional_networks. Perhaps this integration could be accomplished while keeping the separation, for example with the "pass to txt2img" feature that could be done by exposing the Gradio components in additional_networks so they can be manipulated with event handlers in model-metadata-editor. (But in that case I'm not sure about the other way around, passing the models in additional_networks into model-metadata-editor)

@kohya-ss
Copy link
Owner

Thank you for this! The metadata editor is quite charming.

I agree with your concerns. I think I understand that there are drawbacks to the separated extension.

I am not familiar with either the Web UI or Gradio, but would it be possible to implement the functionality of the metadata editor in a separate .py file as much as possible? e.g., parts of on_ui_tabs or on_ui_settings.
And additional_networks.py calls the functions in the new file if necessary. Also some functions can be shared for these script files.

If that could be done, I would be able to leave that file to you, with little or no editing on my part.

In addition, if something goes wrong on the metadata editor side, it would be great if it do not affect the availability of the extension.

If these can be accomplished, I do not think the cost of maintenance will increase much after integration.

By the way, do you plan to extend the metadata editor to models other than LoRA, e.g., Hypernetworks or even SD models? If so, a separate extension might be rather preferable.

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 a pull request may close this issue.

2 participants