• Stars
    star
    180
  • Rank 213,097 (Top 5 %)
  • Language
    Python
  • Created about 2 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Smart Pre-processing extension for Stable Diffusion

Stable Diffusion WebUI Smart Pre-Processing Extension

What is this??

As the name would imply, this is an extension for the Stable-Diffusion WebUI by @Automatic1111

What does this do?

It does a few things, actually.

For starters, it utilizes a combination of BLIP/CLIP and YOLOv5 to provide "smart cropping" for images. The primary subject of each image is identified, the center of that subject is determined, and then the application tries it's best to crop the image so as to keep as much of the subject as possible within the dimensions specified.

Second, it allows storing the determined image caption directly to the image filename, versus having to create a txt file along side every image. You can still create a txt file, use existing captions, or not do any captioning at all.

Third, I've provided face restoration and upscaling options for input images. You can select from GFPGAN and Codeformer for face restoration, and any of the provided upscalers from the "extras' tab to refine/smooth/add detail to your final output images.

Last, but not least, it offers a rudimentary way to swap the "class" of a captioned image with the specific keyword in the image. So, if you're trying to train a subject called "xyz" and "xyz" is a dog, you can easily swap "dog" (and "a dog") wth "xyz" in your captions. Neato!

Smart Cropping

As I said above, smart cropping utilizes a combination of YOLOV5 object recognition and BLIP/CLIP (and DeepDanBooru) captioning to automatically determine the most prominent subject in a photo, and automatically crop the subject as completely as possible. You can also specify a specific subject (dog/cat/woman/house) for the software to find, and skip the YOLOV5 detection entirely.

If a subject is not found, the image will be downscaled and cropped from the center.

Smart Captioning

This uses all the same features as set in user preferences, with the additional options to save to txt or append to the image file name.

Additionally, you can swap the generic "class" of the image with a specific subject keyword. This feature may not be perfect in all cases, but it should still go a long way in speeding up the captioning process.

You can also specify a maximum caption length, which will split the caption by spaces and append words until the maximum length is reached.

Post Processing

It's basically a simplified version of the "extras" tab. The idea is that you can do facial restoration and/or use a model like swinIR or LDSR to smooth or add details to an image. If an image is "actually" upscaled beyond the target crop size, it will be downscaled again back to the original size.

More Repositories

1

sd_dreambooth_extension

Python
1,825
star
2

Phlex

A super-sexy voice interface for the Plex HTPC
PHP
611
star
3

FlexTV

PHP
213
star
4

Cast.bundle

A Plex Channel To Interact With Local Cast Devices, Via Plex Media Server
Python
59
star
5

glimmr

Glimmr is a .Net Core application to synchronize Ambient LED strips with Hue Lights, Lifx Bulbs, and Nanoleaf Panels
C#
54
star
6

FlexTV.bundle

Cast media, fetch stats...do more with less. :D
Python
50
star
7

deluge-extractorplus-plugin

Extractor Plus plugin for Deluge (Formerly SimpleExtractor V2)
Python
17
star
8

DroidTV

Skin for Kodi based on the Leanback Launcher UI
16
star
9

docker-phlex

Docker Container for Phlex
Shell
15
star
10

sd_auto_fix

Fine, I'll just put my pull requests here.
Python
12
star
11

GPE_5.0.1_MULTI_GIT_DH

Home for ROM synching
Shell
7
star
12

DreamscreenDocs

A public repository to house information regarding the now-dead line of Dreamscreen products
Java
7
star
13

DroidShell

It's a droid...SHELL.
Batchfile
6
star
14

FlexConnect

It's like the FlexTV plugin...only not a plugin.
Python
6
star
15

unWatch

An Xposed module to disable root check for certain MDM applications.
Java
5
star
16

Radarr

A fork of Kryptonit3/Sonarr, modified to work with Radarr
PHP
4
star
17

FlexTV-docker

FlexTV...in a docker!
Shell
3
star
18

MIUI_SHOOTER_DH_GB

Base folder for shared development on MIUI Shooter edition
Vim Script
2
star
19

GPE_5.1_M8

GPE ROM for HTC M8
Shell
2
star
20

PhlexAgentTranslate

Add your locale, make Phlex multi-lingual!
2
star
21

DialogTools

A suite of utilities for manipulating DialogFlow Agents
PHP
2
star
22

OpenWRT-SlowLED

Slow LED configuration for OpenWRT
HTML
2
star
23

Adalight-FastLED-Plus

C++
2
star
24

MusicThing

A q&d clone of "SuperLooper" I made for my kid, with some extra features.
JavaScript
2
star
25

AngryDragon-Source

AngryDragon - a modified Tiamat source with multitouch drivers for MIUI/AOSP, and added governors/drivers.
2
star
26

tvheadend

Shell
1
star
27

addonscriptorde-beta-repo

Automatically exported from code.google.com/p/addonscriptorde-beta-repo
Python
1
star
28

unraid-repository

1
star
29

Stats.bundle

I said what what...
Python
1
star
30

shooter-cm9-deviltoast

The CM9 Devil Toast Kernel
C
1
star
31

glimmr_ha

Home Assistant Integration for Glimmr
Python
1
star