Metadata-Version: 2.3
Name: invokeai_models_cli
Version: 1.0.0
Summary: CLI tool for working with orphaned external models and the InvokeAI database
Project-URL: Repository, https://github.com/regiellis/invokeai_models_cli
Project-URL: Documentation, https://github.com/regiellis/invokeai_models_cli/blob/main/README.md
Project-URL: Bug Tracker, https://github.com/regiellis/invokeai_models_cli/issues
Author-email: Regi E <regi@bynine.io>
License: Copyright 2024 Regi E Ellis
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License-File: LICENSE
Keywords: ai,cli,generative-ai,invokeai
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
Requires-Dist: httpx
Requires-Dist: inquirer
Requires-Dist: packaging
Requires-Dist: pytest
Requires-Dist: python-dotenv
Requires-Dist: rich
Requires-Dist: shellingham
Requires-Dist: typer
Description-Content-Type: text/markdown

# InvokeAI Models CLI


[![PyPI](https://img.shields.io/pypi/v/invokeai-models)](https://pypi.org/project/invokeai-models/)
[![Python Versions](https://img.shields.io/pypi/pyversions/invokeai-models)](https://pypi.org/project/invokeai-models/)

> [!NOTE]
> Project features were driven by personal needs and not a sense to create a general-purpose tool. As such, the tool may not be suitable for all use cases. Please use it with caution and always back up your data before making any changes. It is not intended to replace the official Invoke AI web UI but provides additional functionality for managing orphaned models.





**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.

## Why Use This Tool?

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.

## Installation

Choose one of the following methods to install/run the tool:

### Using `pipx` (Recommended)

```bash
pipx install invokeai-models
```

### Using `pip`

```bash
pip install .
```

Or, if you prefer a local installation with the ability to explore and modify the code:

```bash
pip install -e .
```

Make sure to create and activate a virtual environment before installing locally.

## Usage

After installation, use the following commands:

```
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).

- **sync-models**: Sync orphaned models with the current external sources or delete them if they no longer exist.

- **database-models**: List and manage models in the Invoke AI database, including orphaned ones.

- **about**: Display information about this CLI tool, such as version and licensing details.

## 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`