Kevin ASCIONE
commited on
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from PIL import Image
|
| 3 |
+
import time
|
| 4 |
+
|
| 5 |
+
def mock_comfyui_process(img_produit, img_background):
|
| 6 |
+
time.sleep(1)
|
| 7 |
+
result = Image.blend(img_produit.resize((512, 512)), img_background.resize((512, 512)), alpha=0.5)
|
| 8 |
+
return result
|
| 9 |
+
|
| 10 |
+
demo = gr.Interface(
|
| 11 |
+
fn=mock_comfyui_process,
|
| 12 |
+
inputs=[
|
| 13 |
+
gr.Image(type="pil", label="Image du produit"),
|
| 14 |
+
gr.Image(type="pil", label="Image du fond")
|
| 15 |
+
],
|
| 16 |
+
outputs=gr.Image(type="pil", label="Résultat IA (démo)"),
|
| 17 |
+
title="Générateur de visuel produit",
|
| 18 |
+
description="Uploade une image de produit + une image de fond. On les fusionne comme si c'était ComfyUI."
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
demo.launch()
|