• Docs
  • API reference
  • SDKs & tools
  • Models
  • Changelog
Sign inGet an API key
DocsAPI referenceSDKs & toolsModelsChangelog

Start here

IntroductionGetting startedAuthenticationPricing and billingBeta

Concepts

TasksPrompts and imagesDestinationsWebhooksRate limits

Models

The model fieldChoosing an image modelVideo models

Guides

Generate imagesGenerate videoImage to imageEnhance prompts
  1. Docs
  2. /
  3. Guides
  4. /
  5. Generate

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.

PreviousImage to imageNextRemove background

On this page

What the rewrite doesPrice and limitsNext steps

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.

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.

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.

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.