EN ▾
Get API key

Updated

Image Prompt LLM: Generate Detailed Prompts via API

An image prompt LLM is a text model that expands a rough idea into a detailed prompt your image generator can use. It does not draw anything itself; it writes the description, and it can do that thousands of times from a script.

Glass funnel turning loose glowing fragments into layered detailed panels, representing prompt expansion

No card needed. After sign-up, claim $0.50 of free test credit with one click (once per person).

Get API key

Key points

What an image prompt LLM does and does not do

Image generators respond well to specific wording: subject, setting, lens, light, palette, style. People rarely type all of that. A language model fills the gap. You supply "a lighthouse in a storm" and get back a paragraph covering composition, weather, colour and mood.

The API on this site is text only. It has no image, audio or video generation, so the output of every call is words. That is the point of using it for this job: prompt writing is a text task, and a cheap text endpoint handles it at scale. Rendering is a separate step in a separate tool. If you are comparing options for that second step, the GPT image API page covers the image side.

The model here is tuned to answer without content refusals for lawful adult use, which helps with dark, gritty or mature fiction art direction that other assistants sometimes decline to describe. Keep prompts non-explicit where you publish them, and note one hard rule: no sexual content involving minors, ever.

Design the system prompt first

Quality depends on the system prompt. A good one fixes the output shape and gives the model a house style, so ten runs look like they belong together.

  • Fix the fields. Ask for subject, setting, composition, lighting, palette, style and a short negative list.
  • Fix the length. "Final prompt of 40 to 70 words" prevents rambling that many generators truncate.
  • Give one example. One sample output teaches phrasing better than a paragraph of rules.
  • Ban what you do not want. If your generator mangles text, say "no text, no letters" in the rules and the model will add it to every prompt.

Lower the temperature to around 0.7 for consistent structure and raise it to 1.0 or more when you want unexpected ideas. The seed parameter is passed through, so you can reproduce a result while tuning.

Structured output with JSON mode

Free-form paragraphs are hard to process in bulk. JSON mode returns an object you can validate and store.

import os, json
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["API_KEY"],
    base_url="https://api.uncensoredimage.com/v1",
)

SYSTEM = (
    "You write prompts for image generators. "
    "Return a JSON object with keys: subject, setting, composition, lighting, "
    "palette, style, negative, final_prompt. "
    "final_prompt is one paragraph of 40 to 70 words combining the other fields. "
    "Never include text or logos in the described image."
)

def expand(idea):
    r = client.chat.completions.create(
        model="uncensored",
        response_format={"type": "json_object"},
        temperature=0.8,
        messages=[{"role": "system", "content": SYSTEM},
                  {"role": "user", "content": idea}],
    )
    return json.loads(r.choices[0].message.content)

print(expand("a lighthouse in a storm")["final_prompt"])

Wrap json.loads in a try block and retry once on failure. Do this even though JSON mode is on. A reply cut short by a low max_tokens is the usual cause of a broken object, so leave that parameter unset or generous.

A batch script for a whole idea list

For a catalogue of 500 ideas, read a file, run requests in parallel and write the results as JSON lines. Keep the worker count within your key limits: a full key allows 8 concurrent requests and 300 per minute, a trial key allows 2 and 60.

from concurrent.futures import ThreadPoolExecutor
import json, os, time
from openai import OpenAI, RateLimitError

client = OpenAI(api_key=os.environ["API_KEY"],
                base_url="https://api.uncensoredimage.com/v1")

def expand(idea):
    for attempt in range(4):
        try:
            r = client.chat.completions.create(
                model="uncensored",
                response_format={"type": "json_object"},
                messages=[{"role": "system", "content": "Return JSON with keys subject, lighting, style, final_prompt (40-70 words)."},
                          {"role": "user", "content": idea}],
            )
            return {"idea": idea, **json.loads(r.choices[0].message.content)}
        except RateLimitError:
            time.sleep(5)
        except json.JSONDecodeError:
            continue
    return {"idea": idea, "error": True}

ideas = [l.strip() for l in open("ideas.txt") if l.strip()]
with ThreadPoolExecutor(max_workers=2) as pool, open("prompts.jsonl", "w") as out:
    for row in pool.map(expand, ideas):
        out.write(json.dumps(row) + "\n")

Set max_workers to 2 on a trial key and up to 8 on a full key. Over the limit the API returns HTTP 429 with rate_limited or concurrency, and the retry above handles it. Rejected and failed requests are not charged.

What it costs

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Take a typical expansion: a 300-token system prompt plus idea in, a 250-token JSON object out.

  • Input: 300 / 1,000,000 x $0.15 = $0.000045
  • Output: 250 / 1,000,000 x $0.50 = $0.000125
  • Per prompt: $0.00017
Prompts generatedCost
1,000$0.17
10,000$1.70
100,000$17

If you add a long style guide and two examples, input grows to maybe 1,200 tokens: 1,200 / 1,000,000 x $0.15 = $0.00018, plus the same $0.000125 output gives about $0.0003 per prompt, or $0.31 per 1,000. Still cheap. The $0.50 trial credit covers about 2,900 of the short expansions.

Payment is crypto only on this site: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500 with +5% from $50, +10% from $100 and +15% from $200. See the pricing page for details.

Getting consistent batches

The common failure in bulk prompt generation is drift: the first fifty prompts look great and the last fifty wander. Three habits prevent it.

  1. Keep the system prompt identical across the run, and put anything variable in the user message.
  2. Validate each result. Check word count, check for banned words such as "text" or "logo", and regenerate failures instead of editing them by hand.
  3. Add a per-batch theme line (for example, "all scenes at dusk, teal and amber palette") to the user message so a series stays coherent.

If you save the JSON fields separately, you can later change only the style field and rebuild every final prompt without paying for new generations. The API documentation lists the parameters you can tune, and the key page has the trial credit so you can run a 100-idea test for under two cents.

Questions and answers

Can this API generate the images too?

No. It is text only. It writes the prompts, and you use a separate image generator to render them.

Which image generators can use the prompts?

Any tool that accepts a text prompt. The output is plain text, so the target is your choice; adjust word length and style terms to suit the tool.

How many prompts can I generate per minute?

A full key allows 300 requests per minute and 8 concurrent requests; a trial key allows 60 and 2. Run fewer parallel workers than your limit.

Is there a content filter on the prompt text?

The model is tuned to answer without content refusals for lawful adult use. Sexual content involving minors is not allowed.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key