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

Added --models-dir option #15742

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

MarcusNyne
Copy link
Contributor

Problem Statement

The --data-dir option sets the extensions and model folders for automatic1111. This can be problematic if a user wishes to have a common models folder, but continue to maintain extensions in the application folder. An option has been added that allows the models folder to be set independently while preserving the current functionality of --data-dir for backwards compatibility.

Users who maintain multiple installations or are regularly trying new extensions will find this feature useful.

Summary

The --model-dir option overrides the location of the models directory for stable diffusion, so that models can be shared across multiple installations. When --data-dir is specified alone, both the extensions and models folders are present in this folder. --models-dir can be used independently, but when used with --data-dir, models are found in --models-dir, and extensions are under --data-dir.

Description

  • Add a command line option for setting the models folder independently from the extensions folder
  • --models-dir was added as a command line option to modules/cmd_args.py
  • all other changes in modules/paths_internal.py:
  • no changes to functionality when --models-dir is not used
  • when used alone, --models-dir specifies where to look for models folders
  • when used with --data-dir, extensions are found in data-dir, but models are found in models-dir

Screenshots/videos:

Checklist:

Tested with all permutations:

  • no options specified
  • --data-dir alone
  • --models-dir alone
  • --data-dir and --models-dir together

The --model-dir option overrides the location of the models directory for stable diffusion, so that models can be shared across multiple installations.  When --data-dir is specified alone, both the extensions and models folders are present in this folder.  --models-dir can be used independently, but when used with --data-dir, then the models folder is specified by --models-dir, and extensions are found in the --data-dir.
@AUTOMATIC1111 AUTOMATIC1111 merged commit 64783dd into AUTOMATIC1111:dev Jun 8, 2024
3 checks passed
@planetrocky
Copy link

This is fantastic, as I'd love to separate my models from codebase. :)

--models-dir command line argument description needs to be added to the wiki Wiki CLI args

Just for clarity, I think an example of what moves when this is specified in the different cases would be a great help - it just a sample directory/file listing.

I also wonder if this will affect all extensions? Hoping so :) I have a rats nest of hard and soft links across different projects right now.

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.

3 participants