Skip to content

Stable Diffusion WebUI extension for fast and easy automatic creation of detailed character art.

License

Notifications You must be signed in to change notification settings

Praecordi/AutoChar

 
 

Repository files navigation

AutoChar - Version 0.9 is here!

https://civitai.com/models/95923/autochar-easy-character-art-creation-with-face-auto-inpaint

AutoChar Control Panel is a custom script for Stable Diffusion WebUI by Automatic1111 made to help newbies and enthusiasts alike achieve great pictures with less effort. Basically, it's automation of my basic SD workflow for illustrations (check 'em here: https://t.me/dreamforge_tg) and also my Bachelor graduation work, for which I got an A. I've put decent emphasis in code readability and comments for it, so I hope it will help future contributors and developers of other scripts.

So, let us enjoy the open beta!

Installation

Just put script and .onnx face recognition model in your stable-diffusion-webui/scripts folder. PLEASE, don't try to install via URL, it's not an extension, it won't be visible this way!

How to use

  1. Go to your txt2img tab
  2. Write prompt, select basic parameters as usual (you don't need highres fix, since it's included in the algorithm)
  3. Select "AutoChar Beta 0.9" in dropdown menu Scripts in the lower part of page
  4. Click "Generate" and enjoy image

image

WARNINGS

  • It's kind of conflicting with AfterDetailer and may cause crashes if used together
  • If it gives you FileNotFoundError, please, make sure your saving directories are divided by txt2img and img2img folders in /stable-diffusion-webui/output. You can do it it Settings-Paths for saving.

Functions and features as of now:

  • Automatic 2-stage upscale
  • Automatic face and eyes inpaint, for all detected faces on image
  • Custom filtering function to help reduce noise on first generation and raise sharpness of the image before upscaling
  • For even higher quality, you can toggle face and eyes inpaint in between upscaling steps with little impact on generation time
  • If you're really heavy on your LORA's usage, you can toggle CFG scale lowering for face inpaint to avoid burning
  • Fully compatible with ControlNet
  • Works in both txt2img and img2img (for img2img, it will use selected resolution as base, and Second upscale denoising strength in AutoChar's advanced settings, and ignore one selected in parameters of generation)
  • Added full support for Dynamic Prompts. Enjoy fully automatic enhancement for all of your randomized generations.
  • Added SD Upscale as a new default instead of basic Image2Image. Much greater detail and sharpness + customization with your preferred upscaler.
  • Lower LoRA: new measure to avoid burnout on faces when using strong or multiple LoRAs. On by default.
  • Biggest face: inpaints only the largest face on generation, no more abominable body horrors on armpits and breasts, also helps with crowdy pictures. On by default.
  • Now only first and last generation of each cycle will be saved to Txt2img output folder by default. All the other steps will be stored in Img2img folder.

image

image

image

Algorithm itself:

  • Txt2img generation in chosen resolution
  • High-res fix (default: x1.2 on 0.55 denoising strength) to boost details and gain sharpness
  • [Optional, "on" by default] Filtering with chosen strength (default: 0.5, less is better for realistic or smooth-rendered images)
  • [Optional, "off" by default] Automatic inpainting of face and eyes with chosen parameters (default: 0.2 denoising strength)
  • Img2img (default: x1.5 from first generation on 0.3 denoising strength)
  • Automatic inpainting of face and eyes with chosen parameters (default: 0.2 denoising strength)

Future functions, feel free to wait or suggest your code:

  • Adding anime face recognition model (sadly, it will kinda break or make it less time efficient to upscale eyes)
  • More elegant implementation for img2img (it works just fine now, but the inteface is the same when it should be different)
  • Add automatic head area hightlighting with added contrast and brightness
  • Move information from terminal to textbox in WebUI
  • ControlNet fixation of first/second generation to preserve shapes through upscale better
  • Selecting flat color for init image, would be great in achieving darker pictures with black or grey init, as well as setting color theme of image
  • Integration of postprocessing extras upscale and custom effects, such as noise, vignette or watermarks

image

Known issues, also feel free to suggest your fixes:

  • Poor for using on anime arts, can't detect faces on them
  • Doesn't pick up your selected Styles from menu automatically, you need to APPLY them to prompt first
  • Don't select 4x-UltraSharp upscaler if you don't have one (if so, get it here https://mega.nz/folder/qZRBmaIY#nIG8KyWFcGNTuMX_XNbJ_g)

Coming in 1.0:

  • Release as full extension.
  • Full Img2Img support.
  • ControlNet integration.
  • More parameters for advanced users.

About

Stable Diffusion WebUI extension for fast and easy automatic creation of detailed character art.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%