Wan 2.2 Prompt Enhancer With an LLM API (Text Only)
A wan 2.2 prompt enhancer is a small script that turns a few words into a full video prompt with subject, motion, camera and light. This page shows how to build one with a text API. It writes prompts only; it does not render video.


Key points
- The API produces text. You paste or send the result to Wan 2.2 in whatever tool or workflow you already run.
- A good enhancer fixes the structure: subject, scene, motion, camera, lighting, style.
- JSON mode keeps each part separate, so you can rebuild or edit prompts in code.
- One thousand enhanced prompts cost about 17 cents at $0.15 and $0.50 per 1M tokens.
What an enhancer does, and what it does not
Wan 2.2 is an open video generation model from the Wan-AI team. Video models respond best to prompts that read like a shot description, not like a search query. People type "a fox in the snow" and get something generic. An enhancer takes that short idea and expands it into a detailed description: what the fox looks like, how it moves, where the camera sits, what the light does.
The enhancer here is a text language model behind an OpenAI-compatible API. It does not generate video, images or audio, and it is not part of Wan or affiliated with its makers. Your pipeline stays as it is: you run Wan 2.2 yourself or through a service you already use, and this API supplies the prompt text beforehand. The model is tuned to answer without content refusals for lawful adult use, and sexual content involving minors is never allowed.
Keep your expectations realistic. A better prompt improves the odds of a good clip; it does not guarantee one. You will still sample several seeds.
The structure an enhanced prompt should follow
Wan guidance commonly describes a prompt as a stack of parts. Check your tool's own documentation for its exact preferences, but this order works as a base:
- Subject: who or what, with visible details (color, material, age range, clothing).
- Scene: place, time of day, weather, background elements.
- Motion: what moves and how: speed, direction, the start and end of the action.
- Camera: shot size, angle, movement (static, slow dolly in, handheld, orbit).
- Light and color: source, quality, palette.
- Style: film look, animation style, lens feel.
Short clips cover one action. A common mistake is to ask for three events in a five-second clip. Tell the enhancer to keep one action per clip and to describe the motion in concrete terms. "Walks slowly toward the camera, snow lifting from each step" beats "moves dynamically".
The system prompt for the enhancer
The system prompt is the product. Write it once, test it on twenty ideas, and keep it fixed.
You expand short ideas into prompts for a text-to-video generator.
Return JSON with these keys: subject, scene, motion, camera, lighting, style, prompt.
- Each key is one or two plain sentences, concrete and visual.
- "motion" describes one action that fits in about five seconds.
- "camera" names the shot size and any camera movement.
- Do not add text overlays, captions or logos.
- "prompt" joins all parts into one paragraph of 70 to 110 words, no lists.
- Keep the user's idea and mood; do not add characters they did not ask for.
- All characters are adults.
The last two rules prevent two common problems: the enhancer inventing extra subjects, and prompts drifting into content you cannot use. Adjust the word range for your tool's prompt limits; some interfaces truncate long inputs.
Before and after
Here is what the step changes. The input idea is five words: "a fox crossing a frozen lake at dawn". An enhancer using the system prompt above might return a paragraph like this:
A slender red fox with a thick winter coat trots across a frozen lake, pale breath rising from its muzzle. Low mist hangs over the ice and distant pines stand dark against a peach and lavender dawn sky. The fox moves steadily left to right, then pauses and lifts its head toward the camera. Medium wide tracking shot at ground level, slowly pushing in. Soft low sunlight with long shadows and a cool blue shade. Calm nature documentary look, shallow depth of field, natural color.
The same text split into keys is useful for editing. If the fox pauses too early in the clip, you edit the motion field and rebuild the prompt without rewriting the rest. If you want to test three camera moves, you loop over three values of camera and keep everything else fixed. That makes A/B comparison of clips honest, since only one thing changes.
Notice how the example avoids vague words like "beautiful" or "epic". Ask the enhancer to avoid them in the system prompt. They add length without giving the video model anything to draw.
Python: enhance one prompt
Create an account and key on the API key page. The code uses the standard OpenAI SDK with this site's base URL and the model ID uncensored.
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.wannsfw.com/v1", api_key="YOUR_KEY")
SYSTEM = open("enhancer_system.txt").read()
def enhance(idea, style_hint=""):
user = "Idea: " + idea
if style_hint:
user += "\nPreferred style: " + style_hint
r = client.chat.completions.create(
model="uncensored",
temperature=0.7,
response_format={"type": "json_object"},
messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": user}],
)
return json.loads(r.choices[0].message.content)
result = enhance("a fox crossing a frozen lake at dawn", "calm nature documentary")
print(result["prompt"])
print(result["camera"])
Because the reply is JSON, you can swap a single part without touching the others, for example replacing only camera to try an orbit instead of a dolly. Wrap json.loads in a try block and retry once if parsing fails. The API docs cover JSON mode and all other parameters.
Batch mode for many prompts
If you run a queue of ideas, enhance them in a small thread pool and write results to a file your video workflow can read.
import csv
from concurrent.futures import ThreadPoolExecutor
ideas = [line.strip() for line in open("ideas.txt") if line.strip()]
def safe(idea):
for attempt in range(3):
try:
return idea, enhance(idea)
except Exception:
continue
return idea, None
with ThreadPoolExecutor(max_workers=4) as pool, open("enhanced.csv", "w", newline="") as f:
w = csv.writer(f)
w.writerow(["idea", "prompt"])
for idea, res in pool.map(safe, ideas):
if res:
w.writerow([idea, res["prompt"]])
Four workers stay safely under the limits: a full key allows 8 concurrent requests and 300 per minute, while a trial key allows 2 and 60. If you see HTTP 429, the code rate_limited means too many per minute and concurrency means too many at once. Lower the worker count, or wait five seconds when the response includes Retry-After: 5.
Cost per thousand prompts
Rates are $0.15 per 1M input tokens and $0.50 per 1M output tokens. An enhancer call has a fixed system prompt and a short idea, say 600 tokens in, and returns JSON of about 150 tokens out.
- Input: 600 / 1,000,000 x $0.15 = $0.00009
- Output: 150 / 1,000,000 x $0.50 = $0.000075
- One prompt: $0.000165
- One thousand prompts: $0.165
Five thousand prompts come to $0.825. Compare that with the GPU time for a single failed render, and the prompt step is the cheapest part of the pipeline. Failed or refused requests are not charged, and credit never expires. Top-ups start at $20; see the pricing page for amounts, bonuses and crypto payment details (USDT on TRC20 or USDC on Base).
Tuning and troubleshooting
- Prompts are too long for your tool. Lower the word range in the system prompt and set
max_tokensas a cap. - All outputs look alike. Raise temperature to 0.9 and add a style hint per idea; keep a list of styles to rotate.
- Motion is vague. Add examples of good and bad motion lines to the system prompt, three of each.
- The enhancer changes the idea. Lower temperature to 0.4 and repeat the "keep the user's idea" rule.
- You need negative prompts. Add a
negativekey to the JSON schema if your tool has that field.
Save each idea, the full JSON and the resulting clip seed together. When a clip works, you can trace it back to the exact prompt.
More guides
Questions and answers
Does this API generate Wan 2.2 videos?
No. It is a text API only. It writes prompts that you then use in a Wan 2.2 workflow you run elsewhere.
Is this connected to the Wan-AI team?
No. It is an independent OpenAI-compatible text endpoint and is not an official product of Wan or its makers.
How long should an enhanced prompt be?
A single paragraph of roughly 70 to 110 words works as a starting range. Check your tool's limit and adjust the system prompt.
Can I test it before paying?
Yes. New users can claim $0.50 of trial credit with one click on the API key page. It needs no payment method and lasts 7 days.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.