# UI Layout

### 1. Create

Create a new example file:

```
facefusion/uis/layouts/example.py
```

### 2. Implement

Implement the hooks of the UI layout:

```python
import gradio

from facefusion.uis.components import example


def pre_check() -> bool:
	return True


def render() -> gradio.Blocks:
	with gradio.Blocks() as layout:
		example.render()
	return layout


def listen() -> None:
	example.listen()


def run(ui : gradio.Blocks) -> None:
	ui.launch()
```

### 3. Done

Finally, run the program:

```
python run.py --ui-layouts 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-layout.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.
