Giter Club home page Giter Club logo

compare's Introduction

compare.py

Compare multiple Stable Diffusion models quickly with a contact sheet of multiple images from multiple models with the same prompt

Written and tested on Windows, but should work on Linux with minimal modifications (mostly just the os.system calls)

Requirements

ImageMagik - https://imagemagick.org/script/download.php

  • Required for all the post-generation image processing and labeling.

AUTOMATIC1111 stable_diffusion_webui - https://github.com/AUTOMATIC1111/stable-diffusion-webui

  • All the image generation uses API calls to AUTOMATIC1111.
  • You need to add --api to COMMANDLINE_ARGS in webui-user.bat to enable API access.

Parameters

Run with no arguments or empty arguments, the script will read from 'prompt.txt' and 'prompt_neg.txt' files in the same directory.

Currently supports the following commandline arguments:

options:
  -h, --help            show this help message and exit
  -p PROMPT, --prompt PROMPT
                        Text prompt to run. Leave blank to load ./prompt.txt file
  -n NEGATIVE_PROMPT, --negative-prompt NEGATIVE_PROMPT
                        Negative prompt. Leave blank to load ./prompt_neg.txt file
  -b BATCH_SIZE, --batch-size BATCH_SIZE
                        Number of images to generate per model
  -s STEPS, --steps STEPS
  -d SEED, --seed SEED  Seed to start at, consecutive batch images increment by 1
  -H HIRES, --hires HIRES
                        Enable hi-res fix
  -D DENOISE, --denoise DENOISE
                        De-noising strength
  -c CFG, --cfg CFG     Config Scale

Example

D:\stable-diffusion-webui\outputs>python compare.py -p"female superhero with a cape flying in the sky" -n"ugly, deformed, missing limbs, naked, nude"
[2023-03-11 12:42:44] [1/6] anything-v4.5-pruned.ckpt
[2023-03-11 12:42:44]   ๐Ÿก’ Generating [5] images with [25] steps.
[2023-03-11 12:43:19]   ๐Ÿก’ Saving generated images to disk.
[2023-03-11 12:43:21] [2/6] deliberate_v2.safetensors
[2023-03-11 12:43:28]   ๐Ÿก’ Generating [5] images with [25] steps.
[2023-03-11 12:44:04]   ๐Ÿก’ Saving generated images to disk.
[2023-03-11 12:44:06] [3/6] dreamlike-photoreal-2.0.safetensors
[2023-03-11 12:44:13]   ๐Ÿก’ Generating [5] images with [25] steps.
[2023-03-11 12:44:48]   ๐Ÿก’ Saving generated images to disk.
[2023-03-11 12:44:50] [4/6] DreamShaper_331BakedVae.safetensors
[2023-03-11 12:44:57]   ๐Ÿก’ Generating [5] images with [25] steps.
[2023-03-11 12:45:33]   ๐Ÿก’ Saving generated images to disk.
[2023-03-11 12:45:35] [5/6] NeverendingDreamNED_bakedVae.safetensors
[2023-03-11 12:45:37]   ๐Ÿก’ Generating [5] images with [25] steps.
[2023-03-11 12:46:12]   ๐Ÿก’ Saving generated images to disk.
[2023-03-11 12:46:15] [6/6] moDi-v1-pruned.ckpt
[2023-03-11 12:46:21]   ๐Ÿก’ Generating [5] images with [25] steps.
[2023-03-11 12:46:54]   ๐Ÿก’ Saving generated images to disk.
[2023-03-11 12:46:57]   ๐Ÿก’ Combining all models together and saving generation metadata to text file.
[2023-03-11 12:47:04]   ๐Ÿก’ Completed in 4:20

Example contact sheet

compare's People

Contributors

dyashman avatar

Stargazers

Ben Cleverdon avatar  avatar Stephen S avatar Randy H avatar bc1svmes avatar  avatar  avatar  avatar  avatar  avatar Michael Conner avatar  avatar  avatar Emil avatar Dusty avatar  avatar  avatar  avatar Simon avatar mangocan avatar

Watchers

Kostas Georgiou avatar  avatar

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.