Skip to content

Conversation

blessedcoolant
Copy link
Collaborator

@blessedcoolant blessedcoolant commented Jul 15, 2023

This PR completely ports over the Model Manager to 3.0 -- all of the functionality has now been restored in addition to the following changes.

  • Model Manager now has been moved to its own tab on the left hand side.
  • Model Manager has three tabs - Model Manager, Import Models and Merge Models
  • The edit forms for the Models now allow the users to update the model name and the base model too along with other details.
  • Checkpoint Edit form now displays the available config files from InvokeAI and also allows users to supply their own custom config file.
  • Under Import Models you can directly add models or a scan a folder for your checkpoint files.
  • Adding models has two modes -- Simple and Advanced.
  • In Simple Mode, you just simply need to pass a path and InvokeAI will try to determine kind of model it is and fill up the rest of the details accordingly. This input lets you supply local paths to diffusers / local paths to checkpoints / huggingface repo ID's to download models / CivitAI links.
  • Simple Mode also allows you to download different models types like VAE's and Controlnet models and etc. Not just main models.
  • In cases where the auto detection system of InvokeAI fails to read a model correctly, you can take the manual approach and go to Advanced where you can configure your model while adding it exactly the way you want it. Both Diffusers and Checkpoint models now have their own custom forms.
  • Scan Models has been cleaned up. It will now only display the models that are not already installed to InvokeAI. And each item will have two options - Quick Add and Advanced .. replicating the Add Model behavior from above.
  • Scan Models now has a search bar for you to search through your scanned models.
  • Merge Models functionality has been restored.

This is a wrap for this PR.

TODO: (Probably for 3.1)

  • Add model management for model types such as VAE's and ControlNet Models
  • Replace the VAE slot on the edit forms with the installed VAE drop down + custom option

@lstein
Copy link
Collaborator

lstein commented Jul 16, 2023

Just played with the UI, and tested adding, deleting and updating a model (didn't test merge). I note that when you type in a Civitae model URL into Import Models it does import correctly. Another thing to be aware of is that you can provide the URL/path/repo_id of any kind of model, including controlnet, LoRA and embedding, and so it might be useful to expand the row of buttons to show these installed models as well.

@blessedcoolant blessedcoolant changed the title (wip) Model Manager UI (Final Stretch) Model Manager UI 3.0 Jul 17, 2023
@blessedcoolant blessedcoolant marked this pull request as ready for review July 17, 2023 06:11
@blessedcoolant
Copy link
Collaborator Author

blessedcoolant commented Jul 17, 2023

@lstein Model Rename is failing for models in the InvokeAI root folder. Works fine when the path is custom. The error:

WindowsTerminal_bsNwh5QAdv

@lstein lstein requested a review from Kyle0654 as a code owner July 17, 2023 11:31
@lstein
Copy link
Collaborator

lstein commented Jul 17, 2023

@lstein Model Rename is failing for models in the InvokeAI root folder. Works fine when the path is custom. The error:

WindowsTerminal_bsNwh5QAdv

I've fixed this crash. However there is an issue that emerges when the update and rename operations are combined. Let's say that you decide to rename "foo" to "foobar". The original configuration looked like this:

{
      "model_name": "foo",
      "base_model": "sd-2",
      "model_type": "main",
      "path": "/home/lstein/invokeai-main/models/sd-2/main/foo",
      "description": "Stable Diffusion version 2.1 diffusers model, trained on 768 pixel images (5.21 GB)",
      "model_format": "diffusers",
      "error": null,
      "vae": null,
      "variant": "normal"
    }

You decide to change foo's name to "foobar", and pass this body:

{
      "model_name": "foobar",
      "base_model": "sd-2",
      "model_type": "main",
      "path": "/home/lstein/invokeai-main/models/sd-2/main/foo",
      "description": "Stable Diffusion version 2.1 diffusers model, trained on 768 pixel images (5.21 GB)",
      "model_format": "diffusers",
      "error": null,
      "vae": null,
      "variant": "normal"
    }

Notice that the path is still ending with "foo" rather than the new name "foobar". What should the update code do? Should it rename the model path to "foobar", or should it honor the assigned path in the body?

Currently what happens is wrong. The path is renamed to "foobar" and then the entry in models.yaml is updated to the old path.

@blessedcoolant
Copy link
Collaborator Author

I think the path should remain untouched. Coz I can have a model that got added as "foobar_v2" .. but I renamed it to foobar.. I think the path should be irrelevant. If a user wants to change that, then they manually move the folder and update the path accordingly.

Coz I am not a fan of changing folder name coz what if another folder exists? We just error out and giving that feedback would be hard.

So i feel it should remain untouched.

Maybe @hipsterusername has some thoughts on it.

@lstein
Copy link
Collaborator

lstein commented Jul 17, 2023

I think the path should remain untouched. Coz I can have a model that got added as "foobar_v2" .. but I renamed it to foobar.. I think the path should be irrelevant. If a user wants to change that, then they manually move the folder and update the path accordingly.

Coz I am not a fan of changing folder name coz what if another folder exists? We just error out and giving that feedback would be hard.

So i feel it should remain untouched.

Maybe @hipsterusername has some thoughts on it.

Implemented. External paths (outside of the invokeai models directory) can be updated. Internal paths cannot.

@hipsterusername
Copy link
Member

To be explicit (I had only responded via reaction in Discord) - I think this is a good path. Do we have any blockers on merging in? Think this has been thoroughly tested

Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!!!

Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yolo

@lstein lstein merged commit c3a7e35 into invoke-ai:main Jul 18, 2023
@blessedcoolant blessedcoolant deleted the mm-ui branch July 19, 2023 04:20
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.

4 participants