Code Monkey home page Code Monkey logo

sd-aesthetic-optimizer's Introduction

sd-aesthetic-optimizer

Iteratively improve Stable Diffusion outputs using aesthetic scores

This script uses the A1111 webui API, so ensure you have --api in the launch flags.

Setup

# clone with submodules
git clone --recurse-submodules https://github.com/feffy380/sd-aesthetic-optimizer
# install dependencies (you may want to do this in a venv)
pip install -r requirements.txt

Usage

Copy config.json.template and fill in the fields:

  • seed_search_patience: number of txt2img seeds to sample. Best result will be used as the starting point for img2img.
  • img2img_patience: after generating this many images with img2img with no score improvement, reduce denoising strength.
  • initial_denoising_strength: img2img start with this denoising strength.
  • options: passed to /sdapi/v1/options. See webui's /docs page.
  • parameters: passed to /sdapi/v1/txt2img and /sdapi/v1/img2img. See webui's /docs page.
# see --help for available options

# default values. same as running with no arguments
# search seeds with txt2img and iterate on the best result with img2img. save current best to "outputs" folder
python aesthetic_optimizer.py --config="config.json" --outdir="outputs"

# skip txt2img phase by providing a starting image
python aesthetic_optimizer.py --init_image="path/to/init_image.png"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.