xuebinqin / aitools_server

Stable Diffusion web UI server forked to support Seth's AI Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AI Tools Server

(warning, version in the video above is outdated, but does give an idea of the workflow)

Features of this server

This is a forked version of the AUTOMATIC1111/stable-diffusion-webui project with some additional tweaks for my AI Tools to work.

To use my native Unity-based front-end Seth's AI Tools, you need this running somewhere.

  • My legacy api (txt2img, img2img, interrogate, background removal, on demand nsfw checks) can be used simultaneously with the normal web interface, AND the new partially done official api feature
  • Just want the legacy api and don't care about my front end? Here's a notebook showing how to use it directly
  • Also added a notebook showing how to use the new unfinished API here

Features of the AI Tools Client:

  • It's not a web app, it's a native .exe
  • Photoshop/image editor integration with live update
  • text to image, inpainting, image interrogation, face fixing, upscaling, tiled texture generation with preview, nsfw options, alpha mask subject isolation (background removal)
  • Adjustable inpaint size tool, useful for outpainting/mixing too
  • Drag and drop images in as well as paste images from windows clipboard
  • Pan/zoom with thousands of images on the screen
  • Mask painting with controllable brush size
  • Can utilize multiple servers allowing seamless use of all remote GPUs for ultra fast generation
  • All open source, use the Unity game engine and C# to do stuff with AI art
  • Neat workflow that allows evolving images with loopback while live-selecting the best alteratives to shape the image in real-time

Note: This repository was deleted and replaced with the AUTOMATIC1111/stable-diffusion-webui fork Sept 19th 2022, it has completely replaced the original AI Tools backend server.

Latest server changes (Oct 28th, 2022)

  • Added background removal (creates an alpha mask around the subject with ai)
  • Versioned to 0.27 (requires client 0.49 to use latest features)
  • Note: Now requires Python to be 3.9+, I got tired of fixing auto1111 changes to allow earlier, they may fix it later though. To upgrade python in a conda env, do "conda uninstall python" and then "conda install python=3.9"

Installation and Running (modified from stable-diffusion-webui docs)

Make sure the required dependencies are met and follow the instructions available for both NVidia (recommended) and AMD GPUs.

Automatic Installation on Windows

  1. Install Python 3.10.6, checking "Add Python to PATH"
  2. Install git.
  3. Download the aitools_server repository, for example by running git clone https://github.com/SethRobinson/aitools_server.git.
  4. Place model.ckpt in the models directory (see dependencies for where to get it).
  5. Run webui-user.bat from Windows Explorer as normal, non-administrator, user.

Automatic Installation on Linux

  1. Install the dependencies: Note: Requires Python 3.9+!
# Debian-based:
sudo apt install wget git python3 python3-venv
# Red Hat-based:
sudo dnf install wget git python3
# Arch-based:
sudo pacman -S wget git python3
  1. To install in /home/$(whoami)/aitools_server/, run:
bash <(wget -qO- https://raw.githubusercontent.com/SethRobinson/aitools_server/master/webui.sh)

Adding a necessary file (needed for Win/linux installs)

  1. Place model.ckpt (or better, use sd-v1.5-inpainting.ckpt) in the base aitools_server directory (see dependencies for where to get it).
  2. Run the server from shell with:
python launch.py --listen --port 7860 --api

Google Colab

Don't have a strong enough GPU or want to give it a quick test run without hassle? No problem, use this Colab notebook. (Works fine on the free tier)

How to update an existing install of the server to the latest version

Go to its directory (probably aitools_server) in a shell or command prompt and type:

git pull

Running Seth's AI Tools front end

Verify the server works by visiting it with a browser. You should be able to generate and paint images via the default web gradio interface. Now you're ready to use the native client.

Note The first time you use the server, it may appear that nothing is happening - look at the server window/shell, it's probably downloading a bunch of stuff for each new feature you use. This only happens the first time!

The client should start up. If you click "Generate", images should start being made. By default it tries to find the server at localhost at port 7860. If it's somewhere else, you need to click "Configure" and edit/add server info. You can add/remove multiple servers on the fly while using the app. (all will be utilitized simultaneously by the app)

Using multiple GPUs on the same computer

You can run multiple instances of the server from the same install.

Start one instance:

CUDA_VISIBLE_DEVICES=0 python launch.py --listen --port 7860 --api

Then from another shell start another specifying a different GPU and port:

CUDA_VISIBLE_DEVICES=1 python launch.py --listen --port 7861 --api

Then on the client, click Configure and edit in an add_server command for both servers.

Credits for things specific to this fork

Credits for Automatic1111's WebUI

About

Stable Diffusion web UI server forked to support Seth's AI Tools


Languages

Language:Jupyter Notebook 86.9%Language:Python 12.0%Language:JavaScript 0.8%Language:CSS 0.2%Language:Shell 0.1%Language:Batchfile 0.0%