FaceFusion
NEXT
NEXT
  • Introduction
    • Changelog
    • Disclaimer
    • Licenses
  • Installation
    • Platform
      • Linux
      • macOS
      • Windows
    • Accelerator
      • Linux
      • Windows
  • Usage
    • CLI Commands
      • General
      • Job Manager
      • Job Runner
    • CLI Arguments
      • Paths
      • Patterns
      • Face Detector
      • Face Landmarker
      • Face Selector
      • Face Masker
      • Frame Extraction
      • Output Creation
      • Processors
        • Age Modifier
        • Deep Swapper
        • Expression Restorer
        • Face Debugger
        • Face Editor
        • Face Enhancer
        • Face Swapper
        • Frame Colorizer
        • Frame Enhancer
        • Lip Syncer
      • UIs
      • Execution
      • Download
      • Memory
      • Misc
    • Deepfake Webcam
    • Platform Benchmark
    • Run With Docker
  • Troubleshooting
    • macOS
    • Windows
  • Workshop
    • Processor
    • UI Layout
    • UI Component
  • Knowledgebase
    • Face Vocabulary
    • Error Codes
    • GPU Capabilities
  • Donation
  • FAQ
  • Project
    • GitHub
    • Shop
  • COMMUNITY
    • Discord
    • Reddit
  • Partner
    • RunDiffusion
    • Pinokio
Powered by GitBook
On this page
  • 1. Create
  • 2. Implement
  • 3. Done
  1. Workshop

Processor

1. Create

Create a new example file:

facefusion/processors/modules/example.py

2. Implement

Define the inputs:

ExampleInputs = TypedDict('ExampleInputs',
{
	'reference_faces' : FaceSet,
	'source_face' : Face,
	'target_vision_frame' : VisionFrame
})

Implement the hooks of the processor:

from argparse import ArgumentParser
from typing import List

from facefusion.processors.typing import ExampleInputs

from facefusion.typing import ApplyStateItem, Args, Face, InferencePool, ProcessMode, UpdateProgress, 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 get_reference_frame(source_face : Face, target_face : Face, temp_vision_frame : VisionFrame) -> VisionFrame:
	pass


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


def process_frames(source_path : str, temp_frame_paths : List[str], update_progress : UpdateProgress) -> None:
	pass


def process_image(source_path : str, target_path : str, output_path : str) -> None:
	pass


def process_video(source_path : str, temp_frame_paths : List[str]) -> None:
	pass

3. Done

Finally, run the program:

python run.py --processors example