FaceFusion
3.2.0
3.2.0
  • 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

UI Component

1. Create

Create a new example file:

facefusion/uis/components/example.py

2. Implement

Implement the basics 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