UI Component

1. Create

Create a new example file:
facefusion/uis/components/example.py

2. Implement

Implement the essential methods of the UI component:
from typing import Optional
import gradio
from facefusion.uis.typing import Update
EXAMPLE_IMAGE : Optional[gradio.Image] = None
def render() -> None:
global EXAMPLE_IMAGE
EXAMPLE_IMAGE = gradio.Image()
def listen() -> None:
EXAMPLE_IMAGE.change(update, inputs = EXAMPLE_IMAGE, outputs = EXAMPLE_IMAGE)
def update() -> Update:
return gradio.update()

3. Done

Finally, add the component:
from facefusion.uis.components import example
Last modified 1mo ago