UPDATE: Enable like A1111-1.7.0; GFPGAN loading

+ UPDATE: Troubleshooting Sec. (Insightface whl installation)
This commit is contained in:
Gourieff 2023-12-19 14:54:23 +07:00
parent ed66d91819
commit d8e300b202
5 changed files with 25 additions and 21 deletions

View File

@ -2,7 +2,7 @@
<img src="https://github.com/Gourieff/Assets/raw/main/sd-webui-reactor/ReActor_logo_NEW_EN.png?raw=true" alt="logo" width="180px"/>
![Version](https://img.shields.io/badge/version-0.6.0_alpha2-lightgreen?style=for-the-badge&labelColor=darkgreen)
![Version](https://img.shields.io/badge/version-0.6.0_alpha3-lightgreen?style=for-the-badge&labelColor=darkgreen)
<a href="https://boosty.to/artgourieff" target="_blank">
<img src="https://lovemet.ru/www/boosty.jpg" width="108" alt="Support Me on Boosty"/>
@ -257,10 +257,10 @@ If this method doesn't help - there is some other extension that has a wrong ver
### **VIII. (For Windows users) If you still cannot build Insightface for some reasons or just don't want to install Visual Studio or VS C++ Build Tools - do the following:**
1. Close (stop) your SD WebUI Server if it's running
2. Download and put [prebuilt Insightface package](https://github.com/Gourieff/sd-webui-reactor/raw/main/example/insightface-0.7.3-cp310-cp310-win_amd64.whl) into the stable-diffusion-webui (or SD.Next) root folder (where you have "webui-user.bat" file)
3. From stable-diffusion-webui (or SD.Next) root folder run CMD and `.\venv\Scripts\activate`
4. Then update your PIP: `python -m pip install -U pip`
5. Then install Insightface: `pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`
2. Download and put [prebuilt Insightface package](https://github.com/Gourieff/sd-webui-reactor/raw/main/example/insightface-0.7.3-cp310-cp310-win_amd64.whl) into the stable-diffusion-webui (or SD.Next) root folder where you have "webui-user.bat" file or (A1111 Portable) "run.bat"
3. From stable-diffusion-webui (or SD.Next) root folder run CMD and `.\venv\Scripts\activate`<br>OR<br>(A1111 Portable) Run CMD
4. Then update your PIP: `python -m pip install -U pip`<br>OR<br>(A1111 Portable)`system\python\python.exe -m pip install -U pip`
5. Then install Insightface: `pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`<br>OR<br>(A1111 Portable)`system\python\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`
6. Enjoy!
### **IX. 07-August-23 Update problem**

View File

@ -2,7 +2,7 @@
<img src="https://github.com/Gourieff/Assets/raw/main/sd-webui-reactor/ReActor_logo_NEW_RU.png?raw=true" alt="logo" width="180px"/>
![Version](https://img.shields.io/badge/версия-0.6.0_alpha2-lightgreen?style=for-the-badge&labelColor=darkgreen)
![Version](https://img.shields.io/badge/версия-0.6.0_alpha3-lightgreen?style=for-the-badge&labelColor=darkgreen)
<a href="https://boosty.to/artgourieff" target="_blank">
<img src="https://lovemet.ru/www/boosty.jpg" width="108" alt="Поддержать проект на Boosty"/>
@ -264,10 +264,10 @@ Inpainting также работает, но замена лица происх
### **VIII. (Для пользователей Windows) Если вы до сих пор не можете установить пакет Insightface по каким-то причинам или же просто не желаете устанавливать Visual Studio или VS C++ Build Tools - сделайте следующее:**
1. Закройте (остановите) SD WebUI Сервер, если он запущен
2. Скачайте готовый [пакет Insightface](https://github.com/Gourieff/sd-webui-reactor/raw/main/example/insightface-0.7.3-cp310-cp310-win_amd64.whl) и сохраните его в корневую директорию stable-diffusion-webui (или SD.Next) - туда, где лежит файл "webui-user.bat"
3. Из корневой директории откройте Консоль (CMD) и выполните `.\venv\Scripts\activate`
4. Обновите PIP: `python -m pip install -U pip`
5. Затем установите Insightface: `pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`
2. Скачайте готовый [пакет Insightface](https://github.com/Gourieff/sd-webui-reactor/raw/main/example/insightface-0.7.3-cp310-cp310-win_amd64.whl) и сохраните его в корневую директорию stable-diffusion-webui (или SD.Next) - туда, где лежит файл "webui-user.bat" или (A1111 Portable) "run.bat"
3. Из корневой директории откройте Консоль (CMD) и выполните `.\venv\Scripts\activate`<br>ИЛИ<br>(A1111 Portable) Откройте Консоль (CMD)
4. Обновите PIP: `python -m pip install -U pip`<br>ИЛИ<br>(A1111 Portable)`system\python\python.exe -m pip install -U pip`
5. Затем установите Insightface: `pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`<br>ИЛИ<br>(A1111 Portable)`system\python\python.exe -m pip install insightface-0.7.3-cp310-cp310-win_amd64.whl`
6. Готово!
### **IX. Ошибка обновления 07-Август-23**

View File

@ -6,7 +6,7 @@ from typing import List
import modules.scripts as scripts
from modules.upscaler import Upscaler, UpscalerData
from modules import scripts, shared, images, scripts_postprocessing
from modules import scripts, shared, images, scripts_postprocessing, ui_components
from modules.processing import (
Processed,
StableDiffusionProcessing,
@ -40,7 +40,8 @@ class FaceSwapScript(scripts.Script):
return scripts.AlwaysVisible
def ui(self, is_img2img):
with gr.Accordion(f"{app_title}", open=False):
with ui_components.InputAccordion(False, label=f"{app_title}") as enable:
# with gr.Accordion(f"{app_title}", open=False):
# def on_files_upload_uncheck_so(selected: bool):
# global SAVE_ORIGINAL
@ -50,8 +51,8 @@ class FaceSwapScript(scripts.Script):
# clear_faces_list()
# return gr.Checkbox.update(value=SAVE_ORIGINAL,visible=True)
enable = gr.Checkbox(False, label="Enable", info=f"The Fast and Simple FaceSwap Extension - {version_flag}")
gr.Markdown("<br>")
# enable = gr.Checkbox(False, label="Enable", info=f"The Fast and Simple FaceSwap Extension - {version_flag}")
gr.Markdown(f"<sup>The Fast and Simple FaceSwap Extension - {version_flag}</sup>")
# TAB MAIN
msgs: dict = {
@ -405,9 +406,11 @@ class FaceSwapScriptExtras(scripts_postprocessing.ScriptPostprocessing):
order = 20000
def ui(self):
with gr.Accordion(f"{app_title}", open=False):
with ui_components.InputAccordion(False, label=f"{app_title}") as enable:
# with gr.Accordion(f"{app_title}", open=False):
enable = gr.Checkbox(False, label="Enable", info=f"The Fast and Simple FaceSwap Extension - {version_flag}")
# enable = gr.Checkbox(False, label="Enable", info=f"The Fast and Simple FaceSwap Extension - {version_flag}")
gr.Markdown(f"<span style='display:block;font-size:0.75em;margin-bottom:-24px;'>The Fast and Simple FaceSwap Extension - {version_flag}</span>")
# TAB MAIN
msgs: dict = {

View File

@ -23,9 +23,9 @@ from scripts.console_log_patch import apply_logging_patch
from modules.face_restoration import FaceRestoration
try: # A1111
from modules import codeformer_model
from modules import codeformer_model, gfpgan_model
except: # SD.Next
from modules.postprocess import codeformer_model
from modules.postprocess import codeformer_model, gfpgan_model
from modules.upscaler import UpscalerData
from modules.shared import state
from scripts.reactor_logger import logger
@ -142,8 +142,9 @@ def restore_face(image: Image, enhancement_options: EnhancementOptions):
numpy_image = codeformer_model.codeformer.restore(
numpy_image, w=enhancement_options.codeformer_weight
)
else:
numpy_image = enhancement_options.face_restorer.restore(numpy_image)
else: # GFPGAN:
numpy_image = gfpgan_model.gfpgan_fix_faces(numpy_image)
# numpy_image = enhancement_options.face_restorer.restore(numpy_image)
restored_image = Image.fromarray(numpy_image)
result_image = Image.blend(
original_image, restored_image, enhancement_options.restorer_visibility

View File

@ -1,5 +1,5 @@
app_title = "ReActor"
version_flag = "v0.6.0-a2"
version_flag = "v0.6.0-a3"
from scripts.reactor_logger import logger, get_Run, set_Run