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.magicPrompt?.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.
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.
FLUX.3 also has model-specific rewriting.
Set model: "black-forest-labs/flux-3" and magic_prompt: true for a
text-to-image request. The rewrite preserves your supplied text, subject
counts, and layout, and describes the image in natural language.
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.