Updated
Prompt Enhancer AI: Build One With a Text API
A prompt enhancer ai takes a short idea such as "a fox in the snow" and rewrites it into a detailed prompt with lighting, lens, composition and style. You can build one yourself with a text LLM API with a short script, and it costs a fraction of a cent per prompt.


What a prompt enhancer does
Image generators reward specific descriptions. Short prompts leave the model to guess, and the guesses tend to look generic. A prompt enhancer ai fills in the missing detail in a controlled way. You type "a fox in the snow" and it returns something closer to: "A red fox standing in deep powder snow at dusk, breath visible in cold air, low three-quarter angle, 85mm lens, shallow depth of field, soft blue ambient light with a warm rim light from the setting sun, fine fur detail, muted palette."
There is no magic in this. It is a language model told how to write good prompts. That means you can build your own, tune it to the tool you use, and keep your style consistent. Public enhancers apply their own taste and often add fixed phrases; yours does what you say.
The service used here is a hosted, OpenAI-compatible text API with one model, uncensored. It writes text only. It does not generate, edit or analyse images, and it has no embeddings or fine-tuning. The enhanced prompt goes to whatever image tool you already use. The site's pages on image generation and testing an image API cover that side.
The system prompt is the product
All the quality comes from the instruction you give the model. A good one has five parts:
- Role and goal. "You rewrite short ideas into detailed prompts for text-to-image tools."
- Required slots. Subject, setting, composition, lighting, lens or medium, colour palette, mood.
- Length. "50 to 80 words, one paragraph." A cap prevents rambling that some tools truncate.
- Faithfulness. "Do not change the subject or add new subjects. Keep any style the user names."
- Format. "Reply only with JSON: {"prompt": ..., "negative": ...}."
The faithfulness rule matters most. Without it, models happily turn a fox into a fox wearing a crown on a mountain. Tell the model that detail may be added but intent may not be changed.
The model is tuned to answer without content refusals for lawful adult use, so adult-oriented artists and character designers do not get lectured about their briefs. One hard limit applies: nothing sexual involving minors, whatever the framing.
Working code
This script reads short ideas, calls the API in JSON mode and prints a detailed prompt and a negative prompt for each. It uses the OpenAI Python SDK with the service's base URL.
import json
import os
import sys
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredimage.cc/v1",
api_key=os.environ["API_KEY"])
SYSTEM = (
"You rewrite short ideas into detailed prompts for text-to-image tools. "
"Keep the user's subject and any named style; never add new subjects. "
"Add setting, composition and camera angle, lighting, lens or medium, colour palette and mood. "
"50 to 80 words, one paragraph, comma-separated phrases. "
"Also give a short negative prompt listing common flaws to avoid. "
'Reply only with JSON: {"prompt": "...", "negative": "..."}'
)
def enhance(idea, style_hint=""):
r = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": SYSTEM},
{"role": "user", "content": f"Idea: {idea}\nStyle hint: {style_hint or 'none'}"},
],
response_format={"type": "json_object"},
temperature=0.7,
max_tokens=350,
)
return json.loads(r.choices[0].message.content)
if __name__ == "__main__":
for idea in sys.argv[1:]:
out = enhance(idea)
print(out["prompt"])
print("NEGATIVE:", out["negative"], "\n")
Run it as python enhance.py "a fox in the snow" "an abandoned greenhouse". The same call from a terminal:
curl https://api.uncensoredimage.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","response_format":{"type":"json_object"},"messages":[{"role":"system","content":"Rewrite the idea as a detailed image prompt. Reply in JSON with keys prompt and negative."},{"role":"user","content":"a fox in the snow"}]}'Tuning the enhancer for your tool
Image tools differ in what they like. Some read natural sentences, others prefer comma-separated tags, and some weight words near the start of the prompt more heavily. Check your tool's documentation, then reflect that in the system prompt. A few adjustments that usually help:
- Tag style vs sentences. Add "comma-separated tags, most important first" or "natural sentences" to the rules.
- Aspect and framing. If you always render portraits or wide shots, state it in the rules so the model writes a matching composition.
- House style. Add a fixed style line, such as "muted film colours, grain", and tell the model to append it unchanged.
- Intensity. Offer a parameter: low means three added details, high means eight. Pass it in the user message.
- Few-shot examples. Two examples of idea and ideal output in the system prompt anchor the format better than any description.
Change one rule at a time and render the same five ideas each time. Keep the version that wins most often.
One more habit pays off quickly: save every idea with the prompt it produced and a note on how the render turned out. After fifty entries you can paste your three best examples into the system prompt as few-shot samples, and the enhancer starts to write in the voice that already works for your tool and your taste.
Batches and cost
Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. The script above sends about 200 input tokens (system prompt plus idea) and gets about 250 tokens back.
- Input: 200 x $0.15 / 1,000,000 = $0.00003
- Output: 250 x $0.50 / 1,000,000 = $0.000125
- Per enhancement: $0.000155
- 1,000 enhancements: $0.155
- 10,000 enhancements: $1.55
The free $0.50 trial credit pays for about 3,200 enhancements ($0.50 / $0.000155 is about 3,226). Credit is prepaid, never expires, and failed or refused requests are not charged. Paid top-ups are whole amounts from $20 to $500 in crypto (USDT on TRC20 or USDC on Base), with +5% from $50, +10% from $100 and +15% from $200. See the pricing page.
For big batches, run a few requests in parallel. A full key allows 8 concurrent requests and 300 per minute; a trial key 2 and 60. When you go over, the API returns 429 with code rate_limited or concurrency, and Retry-After: 5 on temporary overload. A pool of 4 workers is a sensible start.
Make it a small web service or Telegram bot
Once the function works, wrap it. A tiny HTTP endpoint lets your browser extension, notes app or automation tool call the enhancer. Keep the API key on the server; never ship it inside a browser script.
import express from "express";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.uncensoredimage.cc/v1",
apiKey: process.env.API_KEY,
});
const app = express();
app.use(express.json());
app.post("/enhance", async (req, res) => {
const r = await client.chat.completions.create({
model: "uncensored",
messages: [
{ role: "system", content: "Rewrite the idea as a detailed image prompt in 50 to 80 words. Reply with JSON: {\"prompt\": \"...\"}" },
{ role: "user", content: String(req.body.idea || "").slice(0, 500) },
],
response_format: { type: "json_object" },
max_tokens: 300,
});
res.json(JSON.parse(r.choices[0].message.content));
});
app.listen(3000);
Two safeguards belong in any public version: cap the input length, as above, and rate-limit your own users so one person cannot drain your balance. For chat-based front ends, the Telegram bot API documentation page is a good starting point, and the API documentation covers every parameter used here.
Limits worth knowing
A text model improves wording; it cannot see what your image tool will draw. Enhanced prompts are a better starting point, not a guarantee. Expect to iterate. Very long prompts do not always render better, and some tools ignore everything after a certain length.
Prompts are not used for training. The context window is 100,000 tokens, far more than an enhancer needs. To try the script, sign up with Google or with email and password, then claim the $0.50 trial in one click on the API key page. It needs no payment and is valid for 7 days.
More guides
Questions and answers
What is a prompt enhancer?
A tool, usually an LLM with a fixed instruction, that rewrites a short idea into a detailed prompt for an image generator.
Can this API generate the images too?
No. It is text only. It writes the prompt and you paste it into the image tool of your choice.
How much does it cost to enhance 1,000 prompts?
About $0.155 for 200 input and 250 output tokens per prompt, at $0.15 and $0.50 per 1M tokens.
How do I stop the enhancer from changing my subject?
Add an explicit rule: keep the user's subject and style, add detail only, never add new subjects. Test with five ideas after each change.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.