From a4dd8c95dff2844c9d880ab4f3ca789e8428edbb Mon Sep 17 00:00:00 2001 From: henryruhs Date: Mon, 16 Sep 2024 15:56:21 +0200 Subject: [PATCH] Introduce randomized action button --- facefusion/uis/components/about.py | 35 ++++++++++++++++++++++-------- facefusion/wording.py | 1 - 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/facefusion/uis/components/about.py b/facefusion/uis/components/about.py index d5fa3115..129d560d 100644 --- a/facefusion/uis/components/about.py +++ b/facefusion/uis/components/about.py @@ -1,24 +1,41 @@ +import random from typing import Optional import gradio -from facefusion import metadata, wording +from facefusion import metadata -ABOUT_BUTTON : Optional[gradio.Button] = None -DONATE_BUTTON : Optional[gradio.Button] = None +METADATA_BUTTON : Optional[gradio.Button] = None +ACTION_BUTTON : Optional[gradio.Button] = None def render() -> None: - global ABOUT_BUTTON - global DONATE_BUTTON + global METADATA_BUTTON + global ACTION_BUTTON - ABOUT_BUTTON = gradio.Button( + action = random.choice( + [ + { + 'wording': 'become a member', + 'url': 'https://members.facefusion.io' + }, + { + 'wording': 'join our community', + 'url': 'https://join.facefusion.io' + }, + { + 'wording': 'read the documentation', + 'url': 'https://docs.facefusion.io' + } + ]) + + METADATA_BUTTON = gradio.Button( value = metadata.get('name') + ' ' + metadata.get('version'), variant = 'primary', link = metadata.get('url') ) - DONATE_BUTTON = gradio.Button( - value = wording.get('uis.donate_button'), - link = 'https://donate.facefusion.io', + ACTION_BUTTON = gradio.Button( + value = action.get('wording'), + link = action.get('url'), size = 'sm' ) diff --git a/facefusion/wording.py b/facefusion/wording.py index ea236782..b1bdc08f 100755 --- a/facefusion/wording.py +++ b/facefusion/wording.py @@ -210,7 +210,6 @@ WORDING : Dict[str, Any] =\ 'benchmark_runs_checkbox_group': 'BENCHMARK RUNS', 'clear_button': 'CLEAR', 'common_options_checkbox_group': 'OPTIONS', - 'donate_button': 'DONATE', 'execution_providers_checkbox_group': 'EXECUTION PROVIDERS', 'execution_queue_count_slider': 'EXECUTION QUEUE COUNT', 'execution_thread_count_slider': 'EXECUTION THREAD COUNT',