# Processor

### 1. Create

Create a new example file:

```
facefusion/processors/modules/example.py
```

### 2. Implement

Define the inputs:

```python
ExampleInputs = TypedDict('ExampleInputs',
{
	'reference_vision_frame' : VisionFrame,
	'source_faces' : List[Face],
	'target_vision_frame' : VisionFrame
})
```

Implement the hooks of the processor:

```python
from argparse import ArgumentParser

from facefusion.processors.typing import ExampleInputs

from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ProcessMode, VisionFrame


def get_inference_pool() -> InferencePool:
	pass


def clear_inference_pool() -> None:
	pass


def register_args(program : ArgumentParser) -> None:
	pass


def apply_args(args : Args, apply_state_item : ApplyStateItem) -> None:
	pass


def pre_check() -> bool:
	return True


def pre_process(mode : ProcessMode) -> bool:
	pass


def post_process() -> None:
	pass


def process_frame(inputs : ExampleInputs) -> VisionFrame:
	pass

```

### 3. Done

Finally, run the program:

```
python run.py --processors 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/processor.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.
