mirror of
https://github.com/facefusion/facefusion.git
synced 2026-08-09 10:36:03 +02:00
* Mark as NEXT * Reduce caching to avoid RAM explosion * Reduce caching to avoid RAM explosion * Update dependencies * add face-detector-pad-factor * update facefusion.ini * fix test * change pad to margin * fix order * add prepare margin * use 50% max margin * Minor fixes part2 * Minor fixes part3 * Minor fixes part4 * Minor fixes part1 * Downgrade onnxruntime as of BiRefNet broken on CPU add test update update facefusion.ini add birefnet * rename models add more models * Fix versions * Add .claude to gitignore * add normalize color add 4 channel add colors * worflows * cleanup * cleanup * cleanup * cleanup * add more models (#961) * Fix naming * changes * Fix style and mock Gradio * Fix style and mock Gradio * Fix style and mock Gradio * apply clamp * remove clamp * Add normalizer test * Introduce sanitizer for the rescue (#963) * Introduce sanitizer for the rescue * Introduce sanitizer for the rescue * Introduce sanitizer for the rescue * prepare ffmpeg for alpha support * Some cleanup * Some cleanup * Fix CI * List as TypeAlias is not allowed (#967) * List as TypeAlias is not allowed * List as TypeAlias is not allowed * List as TypeAlias is not allowed * List as TypeAlias is not allowed * Add mpeg and mxf support (#968) * Add mpeg support * Add mxf support * Adjust fix_xxx_encoder for the new formats * Extend output pattern for batch-run (#969) * Extend output pattern for batch-run * Add {target_extension} to allowed mixed files * Catch invalid output pattern keys * alpha support * cleanup * cleanup * add ProcessorOutputs type * fix preview and streamer, support alpha for background_remover * Refactor/open close processors (#972) * Introduce open/close processors * Add locales for translator * Introduce __autoload__ for translator * More cleanup * Fix import issues * Resolve the scope situation for locals * Fix installer by not using translator * Fixes after merge * Fixes after merge * Fix translator keys in ui * Use LOCALS in installer * Update and partial fix DirectML * Use latest onnxruntime * Fix performance * Fix lint issues * fix mask * fix lint * fix lint * Remove default from translator.get() * remove 'framerate=' * fix test * Rename and reorder models * Align naming * add alpha preview * fix frame-by-frame * Add alpha effect via css * preview support alpha channel * fix preview modes * Use official assets repositories * Add support for u2net_cloth * fix naming * Add more models * Add vendor, license and year direct to the models * Add vendor, license and year direct to the models * Update dependencies, Minor CSS adjustment * Ready for 3.5.0 * Fix naming * Update about messages * Fix return * Use groups to show/hide * Update preview * Conditional merge mask * Conditional merge mask * Fix import order --------- Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com> Co-authored-by: Harisreedhar <46858047+harisreedhar@users.noreply.github.com>
55 lines
2.1 KiB
Python
55 lines
2.1 KiB
Python
from typing import List, Optional
|
|
|
|
import gradio
|
|
|
|
import facefusion.choices
|
|
from facefusion import state_manager, translator
|
|
from facefusion.common_helper import calculate_int_step
|
|
from facefusion.types import BenchmarkMode, BenchmarkResolution
|
|
|
|
BENCHMARK_MODE_DROPDOWN : Optional[gradio.Dropdown] = None
|
|
BENCHMARK_RESOLUTIONS_CHECKBOX_GROUP : Optional[gradio.CheckboxGroup] = None
|
|
BENCHMARK_CYCLE_COUNT_SLIDER : Optional[gradio.Button] = None
|
|
|
|
|
|
def render() -> None:
|
|
global BENCHMARK_MODE_DROPDOWN
|
|
global BENCHMARK_RESOLUTIONS_CHECKBOX_GROUP
|
|
global BENCHMARK_CYCLE_COUNT_SLIDER
|
|
|
|
BENCHMARK_MODE_DROPDOWN = gradio.Dropdown(
|
|
label = translator.get('uis.benchmark_mode_dropdown'),
|
|
choices = facefusion.choices.benchmark_modes,
|
|
value = state_manager.get_item('benchmark_mode')
|
|
)
|
|
BENCHMARK_RESOLUTIONS_CHECKBOX_GROUP = gradio.CheckboxGroup(
|
|
label = translator.get('uis.benchmark_resolutions_checkbox_group'),
|
|
choices = facefusion.choices.benchmark_resolutions,
|
|
value = state_manager.get_item('benchmark_resolutions')
|
|
)
|
|
BENCHMARK_CYCLE_COUNT_SLIDER = gradio.Slider(
|
|
label = translator.get('uis.benchmark_cycle_count_slider'),
|
|
value = state_manager.get_item('benchmark_cycle_count'),
|
|
step = calculate_int_step(facefusion.choices.benchmark_cycle_count_range),
|
|
minimum = facefusion.choices.benchmark_cycle_count_range[0],
|
|
maximum = facefusion.choices.benchmark_cycle_count_range[-1]
|
|
)
|
|
|
|
|
|
def listen() -> None:
|
|
BENCHMARK_MODE_DROPDOWN.change(update_benchmark_mode, inputs = BENCHMARK_MODE_DROPDOWN)
|
|
BENCHMARK_RESOLUTIONS_CHECKBOX_GROUP.change(update_benchmark_resolutions, inputs = BENCHMARK_RESOLUTIONS_CHECKBOX_GROUP)
|
|
BENCHMARK_CYCLE_COUNT_SLIDER.release(update_benchmark_cycle_count, inputs = BENCHMARK_CYCLE_COUNT_SLIDER)
|
|
|
|
|
|
def update_benchmark_mode(benchmark_mode : BenchmarkMode) -> None:
|
|
state_manager.set_item('benchmark_mode', benchmark_mode)
|
|
|
|
|
|
def update_benchmark_resolutions(benchmark_resolutions : List[BenchmarkResolution]) -> None:
|
|
state_manager.set_item('benchmark_resolutions', benchmark_resolutions)
|
|
|
|
|
|
def update_benchmark_cycle_count(benchmark_cycle_count : int) -> None:
|
|
state_manager.set_item('benchmark_cycle_count', benchmark_cycle_count)
|