# UI Component

### 1. Create

Create a new example file:

```
facefusion/uis/components/example.py
```

### 2. Implement

Implement the basics of the UI component:

```python
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:

```python
from facefusion.uis.components import example
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.facefusion.io/workshop/ui-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
