Enhance prompts
Set magic_prompt to have Mynth rewrite the prompt for the chosen model before it runs, and read back the text that ran.
Set magic_prompt: true on POST /image/generate. Mynth rewrites the prompt
for the model that will run, then generates from the rewrite. Your original
prompt stays on the task's request, and the text that ran is
result.magic_prompt.
import Mynth from "@mynthio/sdk";
const mynth = new Mynth();
const task = await mynth.image.generate({
model: "black-forest-labs/flux.2-pro",
prompt: "please make a nice picture of a lighthouse",
magic_prompt: true,
});
console.log(task.result?.magic_prompt?.positive);{
"magic_prompt": {
"positive": "A lighthouse on a rocky point at dusk, film grain, cool blue haze",
"negative": "blurry, watermark"
}
}negative is present only when the request had a negative_prompt, which is
rewritten too.
What the rewrite does#
It keeps your intent. The subject, counts, names, and any text meant to appear in the image stay. Wrapper phrases such as "please generate" go. It does not add objects you did not ask for, and it adapts to the style of the model that will run. A more creative rewrite mode is in development.
Price and limits#
Magic Prompt costs $0 today. It is included in the generation estimate, so a
future price will show up before you send. Video requests do not take
magic_prompt.
Next steps#
- Generate images: the rest of the request.
- Prompts and images: what the rewrite reads, and what the provider receives.