Skip to content

Automatically creates character expressions from given image using A1111 Stable Diffusion API (with ADetailer).

License

Notifications You must be signed in to change notification settings

deepratna-awale/AutoExpress

Repository files navigation

Favicon AutoExpress

Introduction

Automatically creates 28 different expressions from a given image using Automatic1111 Stable Diffusion WebUI API. The application uses Inpainting with After Detailer Extension to inpaint the following expressions on the face:

For the latest changes, goto: Change Log

Emotion Emotion Emotion Emotion
Admiration Amusement Anger Annoyance
Approval Caring Confusion Curiosity
Desire Disappointment Disapproval Disgust
Embarrassment Excitement Fear Gratitude
Grief Joy Love Nervousness
Neutral Optimism Pride Realization
Relief Remorse Sadness Surprise

Examples

Anime

Anime Image Grid Anime Image Emotion Grid

The above is an example anime expressions on the following image without cherry picking results.

Realistic Input Image Anime input image

Realistic

Realistic Image Grid Realistic Image Emotion Grid

The above is an example realistic expressions on the following image without cherry picking results.

Realistic Input Image Realistic input image

Requirements

Run With Docker (Requires Docker)

Now AutoExpress is also available as a Docker Image

Pull image from DockerHub

docker pull deepratna/autoexpress

Run

docker run -p 5000:5000 deepratna/autoexpress

Using Installer

  • Clone repository
git clone https://github.com/deepratnaawale/AutoExpress.git
cd AutoExpress
  • Run installer
    • Linux
    chmod +x install.sh
    ./install.sh

Manual Installation

git clone https://github.com/deepratnaawale/AutoExpress.git
cd AutoExpress
  • Create and activate virtual enviorenment
python3 -m venv .venv
  • WINDOWS
.venv\Scripts\activate
  • LINUX
source .venv/bin/activate
  • Install Requirements
pip install -r requirements.txt

Launch App

  • Linux
chmod +x ./run.sh
./run.sh
  • Windows (Simply execute the run.bat file)

Connect to the AutoExpress UI at http://127.0.0.1:5000


Launch Your A1111 Stable Diffusion WebUI Api

You can check if the api is active by accessing the docs (if running locally) http://127.0.0.1:7860/docs#/default/

Usage

UI Description

It's pretty Straight forward. Keep an eye on the logs in the console. Dropping an image will auto populate all attributes in the UI if the image has Stable Diffusion info text. Only supports A1111 WebUI API for now.

PS: This is a very handy tool to use with Silly Tavern to generate character expressions sprites for any bot.

Latest UI

LatestUI

Future Work

  • Change pose along with expression keeping consistent clothes and background. (Probably via Controlnets and ADetailer)
  • Better Expressions for Realistic Images.
  • Tests to check each module.

Special Thanks

SD Parsers by d3x-at

SD API Examples

Avery Velfaire for bug fixes, UI design, and prompt engineering.