| import gradio as gr | |
| from PIL import Image | |
| import time | |
| def mock_comfyui_process(img_produit, img_background): | |
| time.sleep(1) | |
| result = Image.blend(img_produit.resize((512, 512)), img_background.resize((512, 512)), alpha=0.5) | |
| return result | |
| demo = gr.Interface( | |
| fn=mock_comfyui_process, | |
| inputs=[ | |
| gr.Image(type="pil", label="Image du produit"), | |
| gr.Image(type="pil", label="Image du fond") | |
| ], | |
| outputs=gr.Image(type="pil", label="Résultat IA (démo)"), | |
| title="Générateur de visuel produit", | |
| description="Uploade une image de produit + une image de fond. On les fusionne comme si c'était ComfyUI." | |
| ) | |
| demo.launch() | |