<?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: Youssef elabbassi</title>
    <description>The latest articles on DEV Community by Youssef elabbassi (@yelabbassidev).</description>
    <link>https://dev.to/yelabbassidev</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F559826%2F5f4873d7-da16-4287-a937-ee9319326121.jpeg</url>
      <title>DEV Community: Youssef elabbassi</title>
      <link>https://dev.to/yelabbassidev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yelabbassidev"/>
    <language>en</language>
    <item>
      <title>How I Built a Free Image-to-Prompt Tool with Next.js and a Vision Model</title>
      <dc:creator>Youssef elabbassi</dc:creator>
      <pubDate>Sat, 18 Jul 2026 00:45:28 +0000</pubDate>
      <link>https://dev.to/yelabbassidev/how-i-built-a-free-image-to-prompt-tool-with-nextjs-and-a-vision-model-4dp3</link>
      <guid>https://dev.to/yelabbassidev/how-i-built-a-free-image-to-prompt-tool-with-nextjs-and-a-vision-model-4dp3</guid>
      <description>&lt;p&gt;Recently, I kept hitting the same wall in AI art: I'd find an image with a style I loved, but recreating it in Stable Diffusion or Midjourney meant guessing at the prompt for far too long. Writing prompts from scratch is slow and inconsistent.&lt;/p&gt;

&lt;p&gt;So I built the reverse: a tool where you upload an image and get a detailed, ready-to-use prompt back. This post walks through how it works and the decisions behind it.&lt;/p&gt;

&lt;p&gt;Live version: &lt;a href="https://imagepromptnow.com" rel="noopener noreferrer"&gt;ImagePromptNow&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;p&gt;Instead of prompt → image, go image → prompt. Feed a picture into a vision-language model, and format its output into a prompt describing the subject, style, lighting, and composition — something you can paste straight into Midjourney, Flux, Stable Diffusion, or DALL-E.&lt;/p&gt;

&lt;p&gt;The whole product is really just three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An upload flow (file or image URL)&lt;/li&gt;
&lt;li&gt;A vision model call&lt;/li&gt;
&lt;li&gt;Output formatting into a usable prompt plus a structured breakdown&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Next.js (App Router) for the frontend and API routes&lt;/li&gt;
&lt;li&gt;next-intl for localization — the tool ships in 6 languages&lt;/li&gt;
&lt;li&gt;A vision-language model (Llama 3.2 11B Vision) for image analysis&lt;/li&gt;
&lt;li&gt;A CWP-based VPS for hosting, with the worker running separately&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing exotic. The interesting parts were the prompting and the deployment, not the framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting good prompts out of a vision model
&lt;/h2&gt;

&lt;p&gt;The naive approach — "describe this image" — gives you a caption, not a prompt. A caption reads like "a man sitting on a yellow swing." A prompt needs structure: subject, setting, style, lighting, camera, mood.&lt;/p&gt;

&lt;p&gt;The fix was instructing the model to return the description in a specific order and level of detail, then post-processing it into a clean prompt. I also expose a "structured breakdown" so users can see how each element maps back to the image, which makes it easier to tweak specific parts.&lt;/p&gt;

&lt;p&gt;A few lessons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear, well-lit images produce dramatically better prompts than busy or dark ones.&lt;/li&gt;
&lt;li&gt;Over-describing hurts. A prompt bloated with every detail generates worse art than a focused one.&lt;/li&gt;
&lt;li&gt;Different models want different phrasing. Stable Diffusion likes keyword-style prompts; DALL-E and Flux prefer natural language. Giving users one solid base prompt they can adapt beat trying to auto-target each model.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Localization was worth it early
&lt;/h2&gt;

&lt;p&gt;I added next-intl and 6 languages sooner than most people would. The payoff showed up fast in search: non-English pages started ranking within days, in markets where competitors only ship English. If you're building anything content-adjacent, localization is underrated distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment gotchas
&lt;/h2&gt;

&lt;p&gt;The site runs on a CWP7pro VPS behind Apache with a Next.js reverse proxy. One sharp edge: AutoSSL renewals would wipe the proxy vhost config and take the site down with a 403. The fix was a small watchdog cron that re-inserts the ProxyPass block if it goes missing. Not glamorous, but it turned a recurring outage into a non-issue.&lt;/p&gt;

&lt;p&gt;Another one specific to Next.js on a monorepo: &lt;code&gt;apps/web&lt;/code&gt; had &lt;code&gt;"type": "module"&lt;/code&gt; in its package.json, so any helper Node scripts inside it had to use the &lt;code&gt;.cjs&lt;/code&gt; extension or they'd throw ESM errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping it free and frictionless
&lt;/h2&gt;

&lt;p&gt;I made three deliberate choices that shaped everything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No login. You should be able to try it in one click.&lt;/li&gt;
&lt;li&gt;No usage limits. Nothing kills experimentation like a credit counter.&lt;/li&gt;
&lt;li&gt;No paywall on the core feature.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't just nice-to-haves — they're the product. The friction-free path is what makes people actually use and share a tool like this.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;The most requested feature so far is an inline-editable prompt with the ability to "lock" certain visual elements before regenerating — keep the subject, change the style, that kind of thing. That's next on my list.&lt;/p&gt;

&lt;p&gt;If you want to try it, it's here: &lt;a href="https://imagepromptnow.com" rel="noopener noreferrer"&gt;ImagePromptNow&lt;/a&gt; — no signup, and I'd genuinely welcome feedback, especially on prompt quality versus what you'd write by hand.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

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