Stable Diffusion Database Manager named Nex is a Stable Diffusion extension.
It supports generating of a single or in batches of images that will be inserted into a single or multiple databases.
The extension is built using the existing stable diffusion webUI gradio UI framework.
It supports 4 different types of databases such as:
- MySQL (RDBMS, SQL)
- Postgres (RDBMS, SQL)
- Neo4j + IPFS (Graph, CQL)
- MongoDB (Document, NoSQL)
- SQlite
Beneficial for producing images intended for distribution across diverse platforms.
This approach is especially effective for content that demands intricate post-processing tasks, including label categorization, advanced image enhancement, and beyond.
Another use case could be distributed systems of image backup.
Suggest to use neo4j + IPFS for such case, since IPFS is known for high availability and its distribution capabilities in a public network of nodes.
- Install stable-diffusion (https://github.com/AUTOMATIC1111/stable-diffusion-webui)
- Install Docker v4.22.0 or higher (https://docs.docker.com/engine/install)
- Install Python 3.10.6 (tags/v3.10.6:9c7b4bd) (https://www.python.org/downloads/release/python-3106/)
- Install Git (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
If you are using Stable Diffusion WebUI
- Start Stable Diffusion WebUI (https://github.com/AUTOMATIC1111/stable-diffusion-webui#installation-and-running)
- Go to extensions tab
- Go to Install from URL tab
- Copy this github link and paste into (URL for extension's git repository)
- Press install
- Restart Stable Diffusion WebUI
Alternatively, is to git clone or download this repository and place everything into the stable diffusion webUI extensions
folder
- Go to Settings tab
- Find for Nex databases within Uncategorized section
- When setting up and enabling one or more databases
- Always save your changes by hitting the button Apply Settings
- Check the connection String and ensure the database schema is created.
- Test connectivity button to ensure extension is able to connect with the respective database.
- Tables, columns, and collections are created on the fly if they do
not exist
in the 1. database when images are generated.
Refer to Test and Adminer UI to access the various database types to create a database.
This project has been developed and tested in Windows using docker containers for ease of setup and configuration.
Docker will install various images, docker networks, and setup containers such as:
- MySQL 5.7
- PostgresSQL latest
- Mongodb latest
- Mongo express, access MongoDB web based database UI at (http://localhost:8081/)
- Adminer, access MySQL and PostgresSQL Web based Database UI at (http://127.0.0.1:8085/)
- Neo4j latest, access neo4j UI at (http://127.0.0.1:7474)
- IPFS 0.7.0, access IPFS UI at (http://127.0.0.1:5001/webui/)
Run the test by executing docker-compose
cd scripts/test
docker-compose up -d
The above command will download and install all relevant docker containers
The credentials (username and password) can be found at scripts/test/docker-compose.yml
Please change and secure the credentials.
When using Adminer UI
The default username for MySql is root
The default username for PostgreSql is postgres
For Windows and Mac
The Server input box will be: host.docker.internal
For Linux
Run the command ip route | awk 'NR==1 {print $3}'
Copy the ip address and paste it into the Server input box
Testing SQLite
Use any Sqlite tools to view the sqlite db file.
https://inloop.github.io/sqlite-viewer/ is a good start.
- Issue 1: Neo4j and IPFS are using IPFS ipfs/go-ipfs:v0.7.0, the python client for IPFS only supports up to that version.
- Issue 2: Neo4j is hardcoded for both named Prompt and Images when creating a new node.
Feel free to contribute to this project by submitting issues or pull requests.