Repository: stable-diffusion-webui
Issue: [Feature Request]: Retrieve meta-data for models from a YAML file
Labels: enhancement

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

Allow to store meta-data for models (i.e. Checkpoints, LoRAs, Hypernets,
Embeddings) which can be useful for the WebUI, in a YAML file together with the
model (in the same directory, with extension `.webui.yaml`).

This would allow solving a whole bunch of existing feature requests; I found at
least those:
#3121 #3497 #3522 #4996 #5237 #5922 #6013 #6729 #7169

It might also help with:
#4476 #3443 #4286 #1800 #6574

There already exists a pull request, #7953, which stores 1 piece of meta-data
(a description) in a `.txt` file, similar to [sd-model-preview](https://github.com/Vetchems/sd-model-preview),
but we might want to store so much more, e.g.

* A nice "display name", which can be shown in the UI instead of the filename
* The already mentioned description
* Usage hints for the model
* Trigger words
* A "favorite" flag (can then show that model with a star icon)
* URL where to find the model (e.g. to look for updates, and more details)
* URL where to donate
* Flag for NSFW-filtering (so we could switch the WebUI to "SFW mode" by not
  showing any models with that tag)
* Information if the model works on realistic/semi-realistic/anime style
* Information if the model *can* produce SFW and/or NSFW pictures
* For checkpoints: Which (if any) VAE is recommended?
* List of other models this is known to work with (e.g. for a LoRA: which
  checkpoints does it work with?)
* Example generation data (prompt, neg-prompt, cfg, sampler, steps, seed)
* Suggested weight(-range)
* Can the model be used for txt2img and/or img2img?

(and that list is just what *I* can come up with, I'm sure others will have
 a lot of other great ideas!)


### Proposed workflow

User has to manually create the meta-data file (at least at first; later on,
there might be extensions allowing to do this via UI, or maybe model authors can
start providing such files too).

Whenever the WebUI creates a list of models by scanning a directory, it will
need to also load and parse the meta-data file, and add the retrieved
information to the object.

This would then allow other parts of the WebUI (and of course extensions) to use
this data (see above list or some ideas).


### Additional information

I don't expect to simply write this feature request and then have others do all
the work :) I wanted to put this out there before starting any coding.

So this is more of an RFC:
* What do you think about the idea?
* What other data could be stored?
* Is there already something out there, which does sth similar?
* Is there some better way to do this?
* @AUTOMATIC1111, would you be okay with a PR?
* Any important hints on how to implement this?

Here's an example file for AOM3A (`AOM3A3.webui.yaml`)

```yaml
displayname: AbyssOrangeMix3 A3
description: |
  The main model, "AOM3 (AbyssOrangeMix3)", is a purely upgraded model that
  improves on the problems of the previous version, "AOM2". "AOM3" can generate
  illustrations with very realistic textures and can generate a wide variety of
  content.

  A3 is a midpoint of artistic and kawaii. The model has been tuned to combine
  realistic textures, a artistic style that also feels like an oil colour
  style, and a cute anime-style face.
source: "https://civitai.com/models/9942/abyssorangemix3-aom3"
based-on: "SD 1.5"
nsfw-filter: false
does:
  anime:  true
  semirealistic: true
  realistic: false
  sfw: true
  nsfw: true
hints: |
  Don't write a lot of "Negative prompt".
  Sampler: “DPM++ SDE Karras” is good.
  Steps: for Test: 12, illustration: 20
vae: AOM3A3.vae.pt
works-with:
  # 1: no, 2: ok, 3: good, 0/unset: unknown
  vaes:
    - name: anythingv3
      hash: 0e3f4822
      rating: 2
    - name: bastard_mse
      rating: 3
  loras:
    - name: alloldrpgarts11990s_alloldrpgarts11990sV1
      rating: 2
examples:
  - pos: farmer, plowing field, under an alien sun
    neg: machines
    cfg: 7.0
    sampler: Euler a
    steps: 25
    seed: 8123234
  - pos: pumpkin with hat
    neg: witch
```