Skip to main content

Size & Aspect Ratio

The canvas is as important as the content. Mynth provides a flexible system for managing image dimensions, ranging from fully automatic “Magic Size” for dynamic applications to strict pixel-perfect control for professionals.

Magic Size (Auto)

Magic Size is our recommended way to handle dimensions when you are building dynamic systems like role-play apps, story generators, or any interface where the prompt is user-generated or unpredictable. Instead of your system having to use an LLM to figure out the right aspect ratio before calling our API, you can simply offload that logic to us. We analyze the prompt’s context and pick the perfect orientation (Portrait, Landscape, etc.) automatically. To enable it, just set size to auto:
{
  "size": "auto"
}

Size Shorthand & Presets

For cases where you know the general shape you want, you can use our shorthand presets or direct resolution strings.

Resolution Shorthand

You can pass a string in the format ${width}x${height}:
{
  "size": "1024x1024"
}

Named Presets

We provide several curated presets that are optimized for common use cases:
  • portrait: Standard vertical (e.g., for mobile).
  • landscape: Standard horizontal.
  • square: 1:1 aspect ratio.
  • instagram: Optimized for social media posts.
{
  "size": "portrait"
}
Note: We are constantly adding more presets to simplify common integration patterns.

Advanced Size Configuration

For full control, you can pass a structured size object. This allows you to specify precise dimensions and how Mynth should handle them relative to the model’s capabilities.
{
  "size": {
    "width": 1200,
    "height": 800,
    "mode": "preset"
  }
}

Size Modes

Different models have different rules for supported resolutions (e.g., some require dimensions to be multiples of 8 or 64). The mode property determines how we reconcile your request with these rules.
ModeBehavior
preset (Default)Highly Recommended. We adjust your requested size to the nearest “High Quality” preset specifically optimized for the selected model. This ensures the highest aesthetic quality.
alignedWe find the closest technically valid resolution for the model (e.g., adjusting to the nearest multiple of 64). A great balance of control and stability.
strictWe send your exact pixels to the provider. Not recommended, as it can lead to errors if the model doesn’t support those specific dimensions. You are still charged the service fee for failed generations caused by strict size errors.

Recommendations

  • For dynamic content: Use "size": "auto" (Magic Size).
  • For custom designs: Use the structured object with mode: "preset" or mode: "aligned".
  • For safety: Avoid strict unless you are absolutely certain the model provider supports your specific pixel count.

Roadmap: Dynamic Scale Control ⚡

We are working on a Scale parameter that will allow you to control the fidelity of your generations independently of the aspect ratio.Soon, when using auto or preset modes, you’ll be able to specify a scale like hd, fhd, or 4k.Why this matters:
  • Precision: Get a portrait image in 4k or an instagram post in hd.
  • Cost Management: Choose a lower scale for rapid prototyping and a higher scale for final assets, giving you granular control over your generation costs.

Included in your standard service fee, these intelligent sizing features ensure your generations always have the right framing for the job.