AI Photo Editor with SAM & SDXL

Mar 10, 2024 · 1 min read
projects

This project explores the intersection of precise computer vision and generative image editing by combining Segment Anything (SAM) with Stable Diffusion XL.

The core idea is straightforward: segmentation provides exact control over what should be changed, while diffusion-based inpainting provides the generative flexibility to actually change it. That makes the system useful not only as a demo, but as a concrete example of how discriminative and generative models can be combined inside the same workflow.

Built in Python with PyTorch, Diffusers, and Gradio, the project supports interactive masking, object replacement, and background generation while keeping the pipeline lightweight enough to run on consumer hardware with the right optimizations.

Stefano Blando
Authors
PhD Student in Artificial Intelligence
Stefano Blando is a PhD student in the National PhD Program in Artificial Intelligence at Scuola Superiore Sant’Anna and the University of Pisa. His research lies at the intersection of AI, agent-based modeling, and economics. He studies adaptive multi-agent systems, statistical verification of economic simulations, and robust quantitative methods for financial and socio-economic data.