Skip to content

Commit

Permalink
Merge pull request #78 from ototadana/fix/remove-apply-scripts-to-fac…
Browse files Browse the repository at this point in the history
…es-option

remove "apply scripts to faces" option
  • Loading branch information
ototadana authored May 31, 2023
2 parents 5086e1c + 73e7631 commit 3647f74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ If you wish to modify the face of an already existing image instead of creating
![screen-shot](./images/screen-shot.jpg)
2. Click **Generate** button.

### Face control with ControlNet
You can control facial expressions with ControlNet by enabled **"Apply scripts to faces"**. Normally, no other scripts are executed during face image generation, but by enabling this option, they will be.

However, care must be taken when using this option: the ControlNet input image must be specified only in img2img, and nothing must be specified in the ControlNet panel. Specifying it in the ControlNet panel will completely collapse the image.

For more information, please see: [here](https://github.com/ototadana/sd-face-editor/issues/41#issuecomment-1537340496).

## How it works
This script performs the following steps:

Expand Down Expand Up @@ -208,11 +201,6 @@ For more information, please see: [here](https://github.com/ototadana/sd-face-ed
### Show intermediate steps
Specifies whether to display images of detected faces and masks.

### Apply scripts to faces
Normally, no other scripts are executed during face image generation, but by enabling this option, they will be.

For more information, please see: [here](https://github.com/ototadana/sd-face-editor/issues/41#issuecomment-1537340496).


## API
If you want to use this script as an extension (alwayson_scripts) in the [API](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API), specify **"face editor ex"** as the script name as follows:
Expand Down
3 changes: 3 additions & 0 deletions scripts/face_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def ui(self, is_img2img):

apply_scripts_to_faces = gr.Checkbox(
label="Apply scripts to faces",
visible=False,
value=False)
self.components.append((apply_scripts_to_faces, self.add_prefix("apply_scripts_to_faces")))

Expand Down Expand Up @@ -388,6 +389,8 @@ def __proc_image(self, p: StableDiffusionProcessingImg2Img,
self.add_prefix("ignore_larger_faces"): ignore_larger_faces,
}

apply_scripts_to_faces = False

if hasattr(p.init_images[0], 'mode') and p.init_images[0].mode != 'RGB':
p.init_images[0] = p.init_images[0].convert('RGB')

Expand Down

0 comments on commit 3647f74

Please sign in to comment.