---
title: "Create image from text - Classic fast"
method: POST
path: "/v1/ai/text-to-image"
tags: ["text-to-image"]
---

# Create image from text - Classic fast

`POST /v1/ai/text-to-image`

## Request

- Base URL: `https://api.magnific.com`
- URL: `https://api.magnific.com/v1/ai/text-to-image`
- Auth: API key in header `x-magnific-api-key`

Convert descriptive text input into images using AI. This endpoint accepts a variety of parameters to customize the generated images.

## Request body

- RequestContent
  - `prompt` string, required: Text to generate image from Minimum length: `3 characters`
  - `negative_prompt` string: Attributes to avoid in the generated image Minimum length: `3 characters`
  - `styling` RequestContentStyling
    - `style` 'photo' | 'digital-art' | '3d' | 'painting' | 'low-poly' | 'pixel-art' | 'anime' | 'cyberpunk' | 'comic' | 'vintage' | 'cartoon' | 'vector' | 'studio-shot' | 'dark' | 'sketch' | 'mockup' | '2000s-pone' | '70s-vibe' | 'watercolor' | 'art-nouveau' | 'origami' | 'surreal' | 'fantasy' | 'traditional-japan': Style to apply to the image
    - `colors` ColorsPaletteInner[]: Dominant colors to generate the image
      - `color` string, required: Hex color code
      - `weight` number, required: Weight of the color (0.05 to 1)
    - `effects` RequestContentStylingEffects
      - `color` 'b&w' | 'pastel' | 'sepia' | 'dramatic' | 'vibrant' | 'orange&teal' | 'film-filter' | 'split' | 'electric' | 'pastel-pink' | 'gold-glow' | 'autumn' | 'muted-green' | 'deep-teal' | 'duotone' | 'terracotta&teal' | 'red&blue' | 'cold-neon' | 'burgundy&blue': Effects - Color to apply to the image
      - `lightning` 'studio' | 'warm' | 'cinematic' | 'volumetric' | 'golden-hour' | 'long-exposure' | 'cold' | 'iridescent' | 'dramatic' | 'hardlight' | 'redscale' | 'indoor-light': Effects - Lightning to apply to the image
      - `framing` 'portrait' | 'macro' | 'panoramic' | 'aerial-view' | 'close-up' | 'cinematic' | 'high-angle' | 'low-angle' | 'symmetry' | 'fish-eye' | 'first-person': Effects - Framing to apply to the image
  - `guidance_scale` number: Defines the level of fidelity to the prompt when generating the image. A lower value allows for more creativity from the AI, while a higher value ensures closer adherence to the prompt. Valid values range `[0.0, 2.0]`, default `1.0`.
  - `image` ImageSize
    - `size` 'square_1_1' | 'classic_4_3' | 'traditional_3_4' | 'widescreen_16_9' | 'social_story_9_16' | 'smartphone_horizontal_20_9' | 'smartphone_vertical_9_20' | 'standard_3_2' | 'portrait_2_3' | 'horizontal_2_1' | 'vertical_1_2' | 'social_5_4' | 'social_post_4_5', required: Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.\ If not present, the default is `square_1_1`. Note: For the `fluid` model, only this values are valid: * square_1_1 * social_story_9_16 * widescreen_16_9 * traditional_3_4 * classic_4_3
  - `num_images` integer: Specifies the number of images to generate in a single request. Valid values range `[1, 4]`, default `1`.
  - `seed` integer: Seed value for image generation. Using the same seed will produce the same image. If omitted, random seed will be applied, resulting in a different image each time. Valid values range `[0, 1000000]`.
  - `filter_nsfw` boolean: If true, the generated image will be filtered for NSFW content. If false, the image may contain NSFW content. Default value is `true`.

## Response `200`

OK - The request has succeeded, and the images generated from the text are returned.

- CreateImageFromTextClassic200Response
  - `data` Image[], required
    - `base64` string, base64, required: Base64 encoded image
    - `has_nsfw` boolean, required: True if the image has No Safe For Work content, false otherwise
  - `meta` Meta, required
    - `prompt` string, required: Prompt given to generate the image
    - `seed` integer, required: The seed value used to generate the image. Providing the same seed will result in the same image being generated. If omitted, random seed will be applied, producing a different image each time. Valid values range `[0, 1000000]`.
    - `num_inference_steps` integer: Number of inference steps, higher values will generate more realistic images but will take longer to generate. Valid values range `[1, 8]`, default `8`
    - `guidance_scale` number, required: Defines the level of fidelity to the prompt we give to the image, the lower the level, the greater the creativity of the AI. Valid values range `[0.0, 2.0]`, default `1.0`
    - `image` MetaImage, required
      - `size` 'square_1_1' | 'classic_4_3' | 'traditional_3_4' | 'widescreen_16_9' | 'social_story_9_16' | 'smartphone_horizontal_20_9' | 'smartphone_vertical_9_20' | 'standard_3_2' | 'portrait_2_3' | 'horizontal_2_1' | 'vertical_1_2' | 'social_5_4' | 'social_post_4_5', required: Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.\ If not present, the default is `square_1_1`. Note: For the `fluid` model, only this values are valid: * square_1_1 * social_story_9_16 * widescreen_16_9 * traditional_3_4 * classic_4_3
      - `width` integer, required: Image width. If not present, default is `1024`. Valid values range `[1, 1792]`
      - `height` integer, required: Image height

## Other responses

- `400`: Bad Request - The server could not understand the request due to invalid syntax.
- `401`: Unauthorized - The client must authenticate itself to get the requested response.
- `500`: Internal Server Error - The server has encountered a situation it doesn't know how to handle.
- `503`: Service Unavailable

---

[API](https://skmtc.dev/magnific/apis/magnific-api.md) · [All operations](https://skmtc.dev/magnific/apis/magnific-api/llms.txt) · [OpenAPI document](https://skmtc.dev/magnific/apis/magnific-api/revisions/60711fb082c7?raw)
