Skip to content

Model swapping

Kilvoctu edited this page Mar 6, 2023 · 10 revisions

AIYA supports swapping between any number of models/checkpoints you have loaded into your Web UI.

On first launch, AIYA will generate a models.csv in its resources folder with a default dummy value, looking like this:

display_name|model_full_name|activator_token
Default||

This file can be left as-is if not using any model swapping. AIYA will simply take "Default" as whichever current model is loaded into the Web UI.

Adding models

If you'd like to add more models/checkpoints, replace the default value and add lines following the header format: display_name|model_full_name|activator_token

  • display_name is anything you want, except "Default".
  • model_full_name is how it would appear in the Web UI, without the hash nor file extension. This includes folder names, if any.
  • activator_token is any words a model may need to take effect. This can be blank, but remember to add a | separator afterward.

An example may look like:

display_name|model_full_name|activator_token
SD 1.5|v1-5-pruned-emaonly|
WD 1.3|subfolder\wd-v1-3-float32|
MoDi 1|moDi-v1-pruned|Modern Disney style

Explanation of the example:

Line 1 display_name|model_full_name|activator_token

  • The header and should always stay there.

Line 2 SD 1.5|v1-5-pruned-emaonly|

  • This will show "SD 1.5" as an option for AIYA.
  • My Web UI dropdown shows v1-5-pruned-emaonly.ckpt [3f4b7363fe], but we want just the filename, so it becomes v1-5-pruned-emaonly.
  • SD 1.5 has no activator token, but we still need to add a | at the end of this line.

Line 3 WD 1.3|subfolder\wd-v1-3-float32|

  • This is just like line 2, except my WD model is in a subfolder in my Web UI folder.
  • Web UI supports subfolders, so you can have a folder structure like your-webui\models\Stable-diffusion\subfolder. Then you can drop models into subfolder.

Line 4 MoDi 1|moDi-v1-pruned|Modern Disney style

  • I've set Modern Disney style as the activator token, so any prompts using MoDi 1 will include "Modern Disney style" in the prompt. When drawing with AIYA, this isn't shown, but it does get sent to the Web UI.

If a model has multiple activator tokens, you can duplicate the line with each. For example, I have two entries for the same model here:

Pixel Sprites|Pixel-Model|pixelsprite style
Pixel Scenes|Pixel-Model|16bitscene style

Notes

Since AIYA does not normally check file extensions, take care to not have the same filename for multiple models in the same folder; she will default to the first one found. If there's model.ckpt and model.safetensors, AIYA will load the first one. If you really need to do this, you can include the file extension for the model_full_name, but it can be buggy.

While AIYA can load any number of models as choices, Discord will only display the first 25 choices. If you're going over 25, consider a good display_name naming format so models not initially displayed don't get lost in the list.

Another caveat with AIYA's ability to bypass Discord's 25 choice limit is the auto-complete. She will only seek starting from the first letters. For example, if you have Anime and Manga and type a, AIYA will only find Anime not both. This is another thing to keep in mind when making your names.

In the Web UI, there is a setting named "Checkpoints to cache in RAM". If you have enough RAM, this value can be increased to speed up swapping.

Clone this wiki locally