automatic/cli
Vladimir Mandic 614b482ee3 major installer work 2023-04-13 11:19:15 -04:00
..
modules improve error handling 2023-03-26 21:50:15 -04:00
random update launcher 2023-04-06 11:23:25 -04:00
train switch cmdflags to settings 2023-04-12 10:40:11 -04:00
.pylintrc enable pylint 2023-01-18 19:31:40 -05:00
README.md update documentation 2023-02-14 10:12:49 -05:00
generate.json update 2023-03-04 18:14:56 -05:00
generate.py update 2023-03-03 09:04:35 -05:00
random.json add cli 2023-01-14 14:15:47 -05:00
requirements.txt major installer work 2023-04-13 11:19:15 -04:00
train-lora.py implement new training master script 2023-03-19 12:13:16 -04:00
train-ti.py switch cmdflags to settings 2023-04-12 10:40:11 -04:00
xformers.sh update 2023-01-14 11:12:31 -05:00

README.md

Stable-Diffusion Productivity Scripts

Notes:

  • Offline scripts can be used with or without Automatic WebUI
  • Online scripts rely on Automatic WebUI API which should be started with --api parameter
  • All scripts have built-in --help parameter that can be used to get more information

Main Scripts

Generate

Text-to-image with all of the possible parameters
Supports upsampling, face restoration and grid creation

python generate.py

By default uses parameters from generate.json

Parameters that are not specified will be randomized:

  • Prompt will be dynamically created from template of random samples: random.json
  • Sampler/Scheduler will be randomly picked from available ones
  • CFG Scale set to 5-10

Train

Textual inversion embedding training

python train-ti.py

Combined pipeline:

  1. Creates embedding
  2. Extracts images if input is movie
  3. Preprocesses images
  4. Runs training

LoRA training

python train-lora.py

Combined pipeline:

  1. Preprocesses images
  2. Runs training

Detailed documentation

LoRA extract from model

python moidules/lora-extract.py


Auxiliary Scripts

Benchmark

Benchmark your Automatic WebUI
Note: Requires SD API

python modules/bench.py

Embedding Previews

Create previews of embeddings using preview templates
Note: Requires SD API

python modules/preview-embeddings.py

Grid

Create flexible image grids from any number of images
Note: Offline tool

python modiles/grid.py

Image Watermark

Create invisible image watermark and remove existing EXIF tags
Note: Offline tool

python modules/image-watermark.py

Interrogate

Runs CLiP and Booru image interrogation
Note: Requires SD API

python modules/interrogate.py

Interrogate-Offline

Standalone implementation of GiT, CLiP and ViT image interrogation
Note: Offline tool

python modules/interrogate-offline.py

Models Previews

Create previews of models using built-in templates
Note: Requires SD API

python modules/preview-models.py

Palette Extract

Extract color palette from image(s)
Note: Offline tool

python modules/palette-extract.py

Image Process

Run image processing to extract face/body segments and run resolution/blur/dynamic-range checks
Note: Offline except for interrogate to generate caption files which requires SD API

python modules/process.py

Detailed documentation

Prompt Ideas

Generate complex prompt ideas Note: Offline tool

python modules/prompt-ideas.py

Prompt Promptist

Attempts to beautify the provided prompt
Note: Offline tool

python modules/promptist.py

Training Loss-Chart

Create loss-chart from training log Note: Offline tool, may require adjustment to train paths if used with other repos

python modules/train-losschart.py

Training Loss-Rate

Create customizable loss rate to be used in training Note: Offline tool

python modules/train-lossrate.py

Video Extract

Extract frames from video files
Note: Offline tool

python modules/video-extract.py


Utility Scripts

SDAPI

Utility module that handles async communication to Automatic API endpoints
Note: Requires SD API

Can be used to manually execute specific commands:

python sdapi.py progress
python sdapi.py interrupt python sdapi.py shutdown