AutoChar is a custom script for Stable Diffusion WebUI by Automatic1111 (1.6.0+) made to help beginners 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)
GitHub Page:
https://github.com/alexv0iceh/AutoChar
Please check my new guide for it on YouTube that explain all basic functions and pipeline:
For text description of scripts' basic idea check 0.9 version tab.
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!
Also I highly recommend to download 4x-UltraSharp Upscaler (https://mega.nz/folder/qZRBmaIY#nIG8KyWFcGNTuMX_XNbJ_g) and put in /modes/ESRGAN folder
How to use, in short
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 0.9.5" in dropdown menu Scripts in the lower part of page
4. Click "Generate" and enjoy
0.9.5 changes:
Fully revamped interface:
Info added for all crucial parameters, containing tips for usage and clarification for not-so-obvious functions
Upscaler choosing changed from check panels to dropdowns to reduce distraction
Function and slider groups divided to different blocks with clarification headers
True img2img mode: edit existing pictures with SD upscale and automatic face&eyes inpaint
Additional Advanced options!
Brand new Really Advanced options tab for brave enthusiasts willing to take complete control of AutoChar's generation pipeline and maximize their creativity
Various fixes:
Fixed infamous bug with OpenCV on inpaint step (If you STILL have it, do this: please download archive again, I made changes to the code which helped people!)
Fixed inpaint only masked padding, drastically improving results on some artstyles and checkpoints
Fixed High-Res Fix upscalers' list, now it shows all available upscalers as it should
Styles from Styles Menu are now working properly
Many small fixes in code's logic and parameters
Comprehensive description of Advanced and Really Advanced options and tips for their usage:
Advanced options:
Quality functions:
Filtering function: sharpens and applies denoising filter to image after High-Res Fix to improve quality and reduce the number of necessary img2img steps. May negatively impact desired result on "noisy" and blurry artstyles. On by default
Inpaint only the biggest face on the image: does what it says, can be great to prevent undesired face detection and inpaint of background or body parts. May cause problems on images with small character head (full-height pictures and landscapes). In this case, either increase Face Recognition minimum confidence or disable this options. Also disable for pictures with two or more characters. On by default
Lower LoRA strength for face inpaint. Helps avoid burnout with strong LORAs: does what it says. On by default
Use DDIM sampler for better inpaint. Will use chosen in interface otherwise: better for detailed faces. Note that from SD WebUi's version 1.6.0+ denoising strength works differently for DMP++ samplers, so if you're disabling this option because of possible mask residue issues, consider increasing denoising strength for inpaint steps. On by default
Lower CFG for face inpaint. Helps avoid burning with multiple LoRAs: does what it says. Off by default
Algorithm-alterting functions:
Make face inpaint box larger to inpaint hair along with the face: does what it says. It can become quite VRAM heavy, so consider lowering Scaling factor for face inpainting if you're running into issues with it. Off by default
Do face inpaint after hair inpaint: does what it says. Off by default
Attempt mid-uspcale inpainting with chosen options: does what it says. Can be helpful for adding an additional level of detail. Off by default
Use plain Image2Image instead of SD Upscale: does what it says. Off by default
Don't use SD upscale and inpaint HRfix result. Great for weak GPUs: besides stated reason to use it, it can be useful to people accustomed to High-Res Fix-only pipeline. Off by default
Regulate denoise for each step:
All needed info is already in UI, but i would like to add that rom SD WebUi's version 1.6.0+ necessary denoise for DPM++ samplers is like x2 from DDIM denoise up to 0.5; E.g. 0.2 on DDIM is roughly the same as 0.4 on DPM++ 2M Karras
Sliders for parameters:
High-Res Fix scale factor: all info in UI
trength of Filtering: intensity of Filtering function's effect. 0.3-0.5 works best, higher is tricky, but can be helpful for some artstyles
Multiplier for LoRA strength lowering: does what it says. Increase if you want to preserve more of artstyle from your LoRAs
Face Recognition minimum confidence: increase for stricter face detection, decrease if having problems on more anime-like artstyles
Really advanced options:
Tile Overlap parameter for SD Upscale, Scaling factor for face inpainting, Scaling factor for eyes inpainting: all info in UI
Algorithm's steps' settings:
Checkpoint: allows you to choose different one of your checkpoints to be used on this step. Great for mixing artstyles and combining best qualities of each checkpoint!
Sampler: obvious
Clip Skip: my use case is to generate base image on Сlip Skip 2 but work with it on later steps on Clip Skip 1 for better realism
Steps: obvious
Prompt & Negative prompt: allows you to use different prompts and LoRAs for each step. Like, using object or content LoRAs and exclude them from later steps, replacing with LoRAs that have great style, but negatively impact image's content if used in txt2img generation
Coming in 1.0:
Release as full extension.
ControlNet integration.
More face recognition models (including anime-friendly)
Description
FAQ
Comments (20)
Interesting scripts, as far as my testing went it works quite well. My only question is, is there a way to disable saving of steps pictures? I only want the final result saved.
It's surprisingly tricky to do so in Automatic1111's code, so I gave up on it earlier, but I will try my best now!
Also, due to issue with accidental body horror inpainting on boobs and armpits, it can be really helpful to keep previous versions, at least until that bug is resolved (I have a solution, but not release-ready yet)
Nearly ready for release, coming soon in 0.9 version along other improvements!
Added!
i'm getting the following error:
error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\arithm.cpp:650: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op'
Any ideas in how to fix it? Thanks.
it only happens when i have the "filtering function" option selected
@juldcj I guess it's some issue with different OpenCV versions. Will look into it!
@alexv0iceh error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\net_impl.cpp:279: error: (-204:Requested object was not found) Layer with requested id=-1 not found in function 'cv::dnn::dnn4_v20230620::Net::Impl::getLayerData'
I had such a problem after I installed SD via Stability Matrix
Fixed in 0.9! Sorry for the wait.
Really in love with this. I used to run adetailer together with https://github.com/ilian6806/stable-diffusion-webui-eyemask and the results were amazing and this script gives near same results. Script has bit less control over the inpainting job sadly as eyedlib has it's own seperate inpaint prompt box where you can run for example eye inpaint lora's for the inpaint task, and more control over the resolution and other inpaint settings. But it does wat it should do and the results are stunning. Goodjob! Hope it will get better with time.
Have to add, this script handles multiple people better then the eyedlib as it inpaints the faces and eye's one by one instead of doing all eye's of multiple people in one swoop.
Thanks! I have thoughts about lora adding/subtracting feature, will do it in some time.
@Dutchgrasss Yeah, it handles all faces consecutively, creating separate face and eyes mask for each, Also it shifts seed between them to avoid samefacing.
@alexv0iceh Yes exactly, that is the only thing i am cursing on with eyedlib as it will give every person the same set of eyes.
won't generate due to errors when set to 4X ultrasharp using RTX 3070
which errors? can you give the error message?
Love this tool!
What I really like is how it improves the overall compositon/coherency of my projects. I usually start with an idea and add lots of inpaintings and GIMP edits. Adding things the original gen wouldn't or new ideas along the way. Mixing prompts, Lora's, models, controlnets, and extensions often makes the work look very odd, with leftover issues that can escalate as I go. Cleaning it up and getting a style I like without losing my intent is hard. Autochar makes it much faster and keeps my ideas while improving quality.
Really helping me avoid a humpty dumpty mix of ideas and go for bigger concepts.
Recently a strategy I'm liking is:
Multidiffusion Upscaler with noise inversion enabled. 5 inversion steps @ 0.2 renoise strength. Or 10 & 0.4 if I use it's extra upscaler @ 1.5-2x scale factor. Denoising strength @ 0.1-0.3. Running Autochar with it or with the output minus Multidiffusion. Controlnet tile_resample is also nice to combo. Wouldn't say it's really enhancing the tiny details. But playing with the 1-8 downsampling rate can help reserve lora effects or uncommon objects that can be erased with img2img. It can also add some unique alterations I'm not seeing without it. This is all done with only the quality type keywords in my positive prompt and mostly in the negative.
Generally: Add tons of edits/experiments > GIMP edit easier things(bent objects, erase large ugly bits, repaint color bleeding) > Autochar clean up, low step/denoise (possibly w/ controlnet reference if output is too diff for this stage) > repeat above steps until a milestone of additions/edits is achieved and it looks real funky > Multidiffusion noise inversion pass(es)
I wonder what others think? Or how they're using AutoChar?
Thanks for your review!


