Skip to content

Commit

Permalink
Update README, UPDATE Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
regiellis committed Sep 23, 2024
1 parent 24444cf commit fb14b1d
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 74 deletions.
10 changes: 1 addition & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

## All notable changes to this project will be documented in this file

### [1.1.0] - 2024-9-20

- **Paging for Presets**: added paging to the presets list to improve performance and user experience

### [1.0.0] - 2024-9-19

- **Launch Feature Release**: As the title says...we are ready to launch!

### [0.1.0] - 2024-9-16
### [1.0.0] - 2024-9-23

- **Initial Release**: Established the initial codebase for the project, laying the foundation for future development and enhancements.
90 changes: 35 additions & 55 deletions README.md
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`
29 changes: 19 additions & 10 deletions invokeai_models_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,36 @@

"""
=========================================================================
Invoke Preset CLI - Simplified Tool for installing Invoke AI styling presets
Invoke Models CLI - Simplified Tool working with orphaned Invoke AI models
=========================================================================
Invoke preset is a simplified tool for installing and updating Invoke AI
styles presets from the command line.
Invoke modelsis a simplified tool for working with orphaned Invoke AI models
left in the database after the external source has been deleted. It allows
you to list, compare, and delete models automatically or via a selection menu.
Wrote this tool to solve a personal pain point with orphaned external models
that are not managed by Invoke AI. This tool is not a replacement for the
official Invoke AI web ui.
Usage:
$ pipx install invoke-presets (recommended)
$ pipx install invokeai-models (recommended)
$ pipx install . (if you want to install it globally)
$ pip install -e . (if you want to install it locally and poke around,
make sure to create a virtual environment)
$ invoke-presets [OPTIONS] [COMMAND] [ARGS]
$ invokeai-models [OPTIONS] [COMMAND] [ARGS]
Commands:
invoke-presets database create-snapshot
invoke-presets database list-snapshots
invoke-presets database delete-snapshot
invoke-presets database restore-snapshot
invokeai-models database create-snapshot
invokeai-models database list-snapshots
invokeai-models database delete-snapshot
invokeai-models database restore-snapshot
invokeai-models local-models
invokeai-models compare-models
invokeai-models sync-models
invokeai-models database-models
invokeai-models about
"""

__all__ = ["invoke_models_cli"]
Expand Down

0 comments on commit fb14b1d

Please sign in to comment.