sd-webui-reactor/reactor_ui/reactor_tools_ui.py
Gourieff e62ff09e5c UPDATE: Multiple Source Images Support
Feature Request #143

+VersionUP (0.6.0 alpha1)
2023-12-06 19:36:40 +07:00

26 lines
935 B
Python

import gradio as gr
from scripts.reactor_swapper import build_face_model
# TAB TOOLS
def show():
with gr.Tab("Tools"):
with gr.Tab("Face Models"):
gr.Markdown("Load an image containing one person, name it and click 'Build and Save'")
img_fm = gr.Image(
type="pil",
label="Load Image to build Face Model",
)
with gr.Row(equal_height=True):
fm_name = gr.Textbox(
value="",
placeholder="Please type any name (e.g. Elena)",
label="Face Model Name",
)
save_fm_btn = gr.Button("Build and Save")
save_fm = gr.Markdown("You can find saved models in 'models/reactor/faces'")
save_fm_btn.click(
build_face_model,
inputs=[img_fm, fm_name],
outputs=[save_fm],
)