-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,65 @@ | ||
# InvokeAI Preset CLI | ||
# InvokeAI Models CLI | ||
|
||
> [!IMPORTANT] | ||
> This tool makes changes to the Invoke AI database and while it does make snapshots before operations | ||
> that write to a table, there is always a chance the data could become corrupted. Use stand-alone tools | ||
> if you are paranoid about losing data. This tool is provided as-is and is not guaranteed to work in all | ||
> environments. It is recommended to backup your database before using this tool at least once. | ||
**InvokeAI Models CLI** is a simplified command-line tool for managing orphaned Invoke AI models left in the database after their external sources have been deleted. This tool allows you to list, compare, and delete models automatically or via an interactive selection menu. | ||
|
||
## Overview | ||
## Why Use This Tool? | ||
|
||
**InvokeAI Preset CLI** is a simple CLI tool that streamlines the process of managing large | ||
entries of presets into the Invoke AI. The tool was primarily designed to allow me to quickly | ||
add, update, and delete presets in bulk. | ||
This tool addresses a personal pain point with unmanaged external models not handled by Invoke AI. It is not intended to replace the official Invoke AI web UI but provides additional functionality for managing orphaned models. | ||
|
||
Presets/styles can be found at the [gist.github.com/regiellis](https://gist.github.com/regiellis/af5fc6a046d69d62036c6e9be2ff08da) | ||
make sure to use the raw link to import the styles. | ||
## Installation | ||
|
||
These styles are re-post of the work from the great people at: | ||
[twri](https://github.com/twri), [3Diva](https://github.com/3Diva), [Marc K3nt3L](https://github.com/K3nt3L), and the | ||
[fooocus](https://github.com/lllyasviel/Fooocus) project. Show your love on their projects. | ||
Choose one of the following methods to install/run the tool: | ||
|
||
|
||
![screenshot](screen.png) | ||
|
||
## Why | ||
|
||
Just wanted a easy way to get presets in and out of the database without having to use the web interface. The web interface is great for one-off presets, | ||
and does have a bulk import feature, but I wanted to be able to do it from the command line with a litte more control over the process. I have also | ||
added a few features that are not available in the web interface. | ||
|
||
|
||
|
||
## Installation (Recommended) | ||
|
||
You have a couple of options for installing/running the tool: | ||
|
||
### Install [pipx](https://pipxproject.github.io/pipx/installation/), then run the tool with the following command | ||
### Using `pipx` (Recommended) | ||
|
||
```bash | ||
pipx install invokeai-presets-cli | ||
pipx install invokeai-models | ||
``` | ||
|
||
### Alternatively, you can install using `pip` | ||
### Using `pip` | ||
|
||
```bash | ||
pip install . | ||
``` | ||
|
||
## Configuration | ||
Or, if you prefer a local installation with the ability to explore and modify the code: | ||
|
||
> [!IMPORTANT] | ||
> Before using the tool, It's required to set up a `.env` file in the parent directory of the script or your home user dir [windows] or `$HOME/.config/invoke-presets-itsjustregi/.env` | ||
> You will be asked to create a new `.env` file if it does not exist. | ||
```bash | ||
pip install -e . | ||
``` | ||
|
||
The application intelligently locates your `.env` file, accommodating various platforms like Windows and Linux, or defaulting to the current directory. | ||
Make sure to create and activate a virtual environment before installing locally. | ||
|
||
## Usage // Available Commands | ||
## Usage | ||
|
||
Once installed via pipx or pip: | ||
After installation, use the following commands: | ||
|
||
``` | ||
invoke-presets about -readme -changelog -version [-c, -r, -v] | ||
invoke-presets list [--all, --only-defaults] | ||
invoke-presets database create-snapshot | ||
invoke-presets database list-snapshots | ||
invoke-presets database delete-snapshot | ||
invoke-presets database restore-snapshot | ||
invoke-presets tools | ||
invoke-presets export | ||
invoke-presets import | ||
invoke-presets delete | ||
invokeai-models [OPTIONS] COMMAND [ARGS] | ||
``` | ||
|
||
**Available Commands:** | ||
|
||
- **database** | ||
- `create-snapshot`: Create a snapshot of the current database state. | ||
- `list-snapshots`: List available snapshots. | ||
- `delete-snapshot`: Delete a snapshot by ID. | ||
- `restore-snapshot`: Restore a snapshot by ID. | ||
|
||
- **local-models**: Display local models information. | ||
|
||
- **compare-models**: Compare models based on specific criteria (e.g., model name, hash). | ||
|
||
### Contact | ||
- **sync-models**: Sync orphaned models with the current external sources or delete them if they no longer exist. | ||
|
||
For any inquiries, feedback, or suggestions, please feel free to open an issue on this repository. | ||
- **database-models**: List and manage models in the Invoke AI database, including orphaned ones. | ||
|
||
### License | ||
- **about**: Display information about this CLI tool, such as version and licensing details. | ||
|
||
This project is licensed under the [MIT License](LICENSE). | ||
## Examples | ||
|
||
--- | ||
- Create a snapshot: `invokeai-models database create-snapshot` | ||
- List snapshots: `invokeai-models database list-snapshots` | ||
- Delete a snapshot: `invokeai-models database delete-snapshot` | ||
- Restore a snapshot: `invokeai-models database restore-snapshot` | ||
- Compare models: `invokeai-models compare-models` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters