Free AI Product Photo Generator for E-Commerce

Краткое содержание

Pixel’s announcement explores adding a free AI product-photo generator to a zero-budget toolbox for Chinese e-commerce sellers. It explains how Pollinations generates images without an API key, why anonymous users may hit a 45-second rate limit, and how translating Chinese product details into concise English prompts improves results.

DEV Community

How I Added a Free AI Product Photo Generator to a Zero-Budget Toolbox

I run a small AI toolbox for Chinese e-commerce sellers. The whole thing is built with vanilla HTML, one cheap Node server, and free APIs. Last week I added a ninth tool: a product-photo generator that costs $0 per image and needs no API key. Here is the weird part: the hard problem was not image generation. It was getting the model to understand Chinese product descriptions. The stack Static frontend hosted on Netlify A small Node HTTP server for text generation Pollinations for free image generation: https://image.pollinations.ai/prompt/{prompt} No signup, no API key, no credit card The image endpoint returns a JPEG directly. You can open it in a browser or fetch it server-side. I call it from the browser and show the returned URL. Problem 1: the free tier is rate-limited Pollinations gives anonymous users roughly one image every 45 seconds per IP. If you go over the limit, it does not return an HTTP error. It returns a yellow image that literally says: Free limit reached 1 free image every 45 seconds That is a trap for any automated test: the request looks successful, the image has a valid JPEG content type, and your UI happily displays the rate-limit card. I now check the generated image visually and tell users to wait 45 seconds before retrying. For a production product I would queue requests per IP and return a clear retry-after value. For a free tool, a plain hint is enough. Problem 2: Chinese prompts were ignored My first test used a Chinese prompt: 专业电商商品摄影:白色陶瓷马克杯,原木桌面、晨光、简约北欧风,无文字,无水印 The result was a young woman standing under cherry blossoms. The model had ignored the subject completely. The lesson: do not send a long Chinese instruction to an English-first image model and expect it to pick out the product. Translate the product and scene into English keywords first, then build a short image prompt. I added a translation step using Pollinations' text endpoint: const ask = '请把下面的中文商品和场景翻译成英文图片生成关键词,只输出英文关键词,用逗号分隔,不要解释:' + text;
const url = 'https://text.pollinations.ai/' + encodeURIComponent(ask) + '?model=openai';
const res = await fetch(url);
const keywords = (await res.text()).trim();
The translation returned: white ceramic mug, natural wood desk, morning light, minimalist Nordic style Then the final image prompt becomes: 'professional e-commerce product photography, ' + keywords +
', clean composition, subject centered, no text, no watermark, high detail'
That produced a clean mug on a wooden desk on the first try. Same tool, same model, completely different result. Problem 3: Node fetch can hang In Node 22, fetch sometimes times out connecting to the image CDN. Adding this at startup fixed it: import dns from 'node:dns';
dns.setDefaultResultOrder('ipv4first');
I also retry the image request up to four times. Each attempt is cheap. The client only sees a loading state. The workflow users see Type a product name and an optional scene, in Chinese. The page translates the scene into English keywords. It requests a 768×768 image from Pollinations. The image appears with a "long-press or right-click to save" hint. No login. No server-side image storage. The image URL points at the public CDN. What I would improve next Add optional reference-image upload so the output keeps the exact product shape Queue requests and show a real countdown instead of a static hint Add background removal after generation For now, the limitation is clear and I state it in the UI: the output is a scene illustration, not a real product photo. Do not use it as a fake "real shot" on a product page. Try it The tool is free and open in the browser: https://xiaoshengyi-toolbox.netlify.app/tools/tupian.html?utm_source=devto&utm_medium=social&utm_campaign=tupian The rest of the toolbox is here: https://xiaoshengyi-toolbox.netlify.app/ If you are building something similar, the two things worth stealing are the translate-first step and the rate-limit check. Both are small changes that turn a demo into something a real seller can use.
Free AI Product Photo Generator for E-Commerce
Powered by Readybot.io

Последнее от Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …

Why a Java HPA Got Stuck at 20 Kubernetes Pods

Pixel shares how a Spring Boot pricing service autoscaled to 20 Kubernetes pods and stayed there because the JVM retained committed heap memory after traffic …