Face Editor for Stable Diffusion. It can be used to repair broken faces in images generated by Stable Diffusion.
This is a extension of AUTOMATIC1111's Stable Diffusion Web UI.
This software improves facial images in these features:
Please try the following settings first:
0
.12
.0
.If you feel uncomfortable with the facial contours, try increasing the "Mask size" value. This discomfort often occurs when the face is not facing straight ahead.
When multiple faces are close together, one face may collapse under the influence of the other. In such cases, enable "Use minimal area for face selection".
Use "Prompt for face" option if you want to change the facial expression.
Faces can be individually directed with prompts separated by ||
(two vertical lines).
@@
, the normal prompts (written at the top of the screen) will be expanded at that position.__name__
syntax and the text file in the directory of the wildcards extension as well as the normal prompts.If you wish to modify the face of an already existing image instead of creating a new one, follow these steps:
This script performs the following steps:
First, image(s) are generated as usual according to prompts and other settings. This script acts as a post-processor for those images.
Detects faces on the image.
Crop the detected face image and resize it to 512x512.
Run img2img with the image to create a new face image.
Resize the new face image and paste it at the original image location.
To remove the borders generated when pasting the image, mask all but the face and run inpaint.
Use this parameter when you want to reduce the number of faces to be detected. If more faces are found than the number set here, the smaller faces will be ignored.
This is the parameter for step-1.
Confidence threshold for face detection. Set a lower value if you want to detect more faces.
This is the parameter for step-1.
Specify the size of the margin for face cropping by magnification.
If other parameters are exactly the same but this value is different, the atmosphere of the new face created will be different.
This is the parameter for step-2.
When pasting the generated image to its original location, the rectangle of the detected face area is used. If this option is not enabled, the generated image itself is pasted. In other words, enabling this option applies a smaller face image, while disabling it applies a larger face image.
This is the parameter for step-4.
Specifies one side of the image size when creating a face image. Normally, there should be no need to change this from the default value (512), but you may see interesting changes if you do.
This is the parameter for step-3.
Ignore if the size of the detected face is larger than the size specified in "Size of the face when recreating".
This is the parameter for step-1.
For more information, please see: here.
Prompt for generating a new face. If this parameter is not specified, the prompt entered at the top of the screen is used.
This is the parameter for step-3.
Denoising strength for generating a new face. If the value is too small, facial collapse cannot be corrected, but if it is too large, it is difficult to blend with the entire image.
strength: 0.4
strength: 0.6
strength: 0.8
This is the parameter for step-3.
Size of the mask area when inpainting to blend the new face with the whole image.
size: 0
size: 10
size: 20
This is the parameter for step-5.
Size of the blur area when inpainting to blend the new face with the whole image.
This is the parameter for step-5.
Denoising strength when inpainting to blend the new face with the whole image. If the border lines are too prominent, increase this value.
This is the parameter for step-5.
Paste an image cut out in the shape of a face instead of a square image.
This is the parameter for step-4.
For more information, please see: here.
Specify whether to save the image before modification.
For more information, please see: here.
Specifies whether to display images of detected faces and masks.
If you want to use this script as an extension (alwayson_scripts) in the API, specify "face editor ex" as the script name as follows:
"alwayson_scripts": {
"face editor ex": {
"args": [{"prompt_for_face": "smile"}]
},
For more information, please see: here.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。