benner3000's picture
Update app.py
a38b1ec verified
raw
history blame
1.66 kB
# -* coding:UTF-8 -*
# !/usr/bin/env python
import numpy as np
import gradio as gr
import roop.globals
from roop.core import (
start,
decode_execution_providers,
suggest_max_memory,
suggest_execution_threads,
)
from roop.processors.frame.core import get_frame_processors_modules
from roop.utilities import normalize_output_path
import os
from PIL import Image
article_text = """
<div style="text-align: center; padding: 20px; border-top: 1px solid #e0e0e0; margin-top: 30px;">
<h3>Leer zelf Generative AI-tools te bouwen en te begrijpen! πŸš€</h3>
<a href="https://www.glossybranding.com/masterclass" target="_blank" style="
background: linear-gradient(45deg, #7B1FA2, #4A148C);
color: white;
padding: 12px 24px;
border-radius: 8px;
text-decoration: none;
font-weight: bold;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
">Schrijf je in voor de AI Masterclass</a>
</div>
"""
def swap_face(source_file, target_file, doFaceEnhancer):
# ... [jouw bestaande swap_face functie blijft identiek] ...
app = gr.Interface(
fn=swap_face,
inputs=[
gr.Image(label="Upload jouw gezicht"),
gr.Image(label="Kies een template afbeelding"),
gr.Checkbox(label="Gezicht verbeteren?", info="Aanvinken voor HD-kwaliteit")
],
outputs=gr.Image(label="Resultaat", show_share_button=True),
title="🎭 Glossy Branding AI Face Swap",
description="Transformeer jezelf in een AI-kunstwerk! Upload je foto en kies een template.",
article=article_text, # πŸ‘ˆ Dit is de cruciale toevoeging
theme=gr.themes.Soft(primary_hue="purple")
)
app.launch()