<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tea</title>
    <description>The latest articles on DEV Community by Tea (@teafeh).</description>
    <link>https://dev.to/teafeh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3846529%2F9b431424-85c2-484c-b6be-50b3c3d93d8d.png</url>
      <title>DEV Community: Tea</title>
      <link>https://dev.to/teafeh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/teafeh"/>
    <language>en</language>
    <item>
      <title>🚀 How We Built AI Product Photography with Gemini + Next.js</title>
      <dc:creator>Tea</dc:creator>
      <pubDate>Fri, 27 Mar 2026 17:38:51 +0000</pubDate>
      <link>https://dev.to/teafeh/how-we-built-ai-product-photography-with-gemini-nextjs-nm4</link>
      <guid>https://dev.to/teafeh/how-we-built-ai-product-photography-with-gemini-nextjs-nm4</guid>
      <description>&lt;p&gt;In e-commerce, the difference between a sale and a bounce is often the lighting. But professional shoots are expensive. At Katalyst AI, we wanted to bridge that gap by turning raw smartphone photos into marketplace-ready 4K assets in under 60 seconds.&lt;/p&gt;

&lt;p&gt;Here’s the technical breakdown of how we built the pipeline using Next.js and Gemini.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Challenge: Beyond Background Removal
Most tools just remove backgrounds. We needed to handle:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Scene Consistency: Ensuring the product lighting matches the generated background.&lt;/p&gt;

&lt;p&gt;Resolution: Upscaling mobile shots to 4K without losing texture.&lt;/p&gt;

&lt;p&gt;SEO Automation: Generating marketplace-specific metadata simultaneously.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Tech Stack
We leaned into a modern, performance-first stack:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Framework: Next.js 14 (App Router) for high-performance SSR.&lt;/p&gt;

&lt;p&gt;AI Engine: Gemini 3 Flash for high-speed image-to-image prompting and vision analysis.&lt;/p&gt;

&lt;p&gt;Styling: Tailwind CSS for a clean, minimalist UI that stays out of the user's way.&lt;/p&gt;

&lt;p&gt;Database: PostgreSQL (via Prisma) for managing user galleries and asset states.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Implementing the Gemini Pipeline
Integrating Gemini wasn't just about a single API call; it was about a multi-stage workflow.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Stage A: Vision Analysis&lt;br&gt;
We use Gemini’s vision capabilities to "see" the product. It identifies the material (e.g., "matte leather") and the original lighting source to ensure the generated environment feels real.&lt;/p&gt;

&lt;p&gt;Stage B: The Image-to-Image Prompt&lt;br&gt;
Instead of generic prompts, we programmatically wrap user inputs:&lt;/p&gt;

&lt;p&gt;TypeScript&lt;br&gt;
const systemPrompt = &lt;code&gt;Act as a professional product photographer. &lt;br&gt;
Place the detected object in a ${userSelectedTheme} setting. &lt;br&gt;
Maintain sharp focus on the product, 4k resolution, cinematic lighting.&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scaling Performance with Next.js
To maintain a 95%+ success rate, we utilized:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Edge Functions: To handle the initial image processing near the user, reducing latency.&lt;/p&gt;

&lt;p&gt;Optimistic UI Updates: Users see the "Processing" state immediately, with real-time previews as the Gemini model iterates on the upscale.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Lessons Learned (The "Gotchas")
Prompt Injection: We found that "less is more." Over-prompting Gemini often led to artifacts. We moved to a "base-template" approach where the AI has more creative freedom within set guardrails.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;File Size: Handling 4K images meant optimizing our S3 upload strategy using pre-signed URLs to keep the Next.js server from becoming a bottleneck.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What’s Next for Katalyst AI?
We are currently exploring batch processing—allowing a seller to upload 20 raw shots and receive a full catalog in one go. We’re also refining our SEO engine to automatically generate descriptions that aren't just accurate but persuasive.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Final Thoughts&lt;br&gt;
Building with Gemini and Next.js allowed us to move from concept to a production-ready tool with incredible speed. If you're building in the AI space, the key is focusing on the user's friction, not just the AI's novelty.&lt;/p&gt;

&lt;p&gt;Check out the live version at &lt;a href="//Katalystai.co.uk"&gt;katalystai.co.uk&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
