# Image Generation

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/aiart/imagegeneration/{provider}:
    post:
      summary: Image Generation
      deprecated: false
      description: >+
        The AI Image Generation API allows you to generate images based on a
        combination of text prompts and reference images.

        It supports multi-modal input, enabling scenarios such as character
        consistency, style transfer, composition guidance, and creative image
        generation.


        With this API, developers can:


        Generate new images purely from textual descriptions (e.g., landscapes,
        portraits, product shots)


        Provide reference images to maintain character or object consistency


        Combine multiple reference images with prompts for more precise control


        Customize the output resolution via width and height parameters


        Use smart reference mode (smart_reference) to automatically extract key
        visual features from the reference image.


        ## Gemini 2.5 Flash Image


        | Aspect Ratio | Resolution | Tokens |

        |--------------|------------|--------|

        | 1:1          | 1024×1024  |  5 |

        | 2:3          | 832×1248   |  5 |

        | 3:2          | 1248×832   |  5 |

        | 3:4          | 864×1184   |  5 |

        | 4:3          | 1184×864   |  5 |

        | 4:5          | 896×1152   |  5 |

        | 5:4          | 1152×896   |  5 |

        | 9:16         | 768×1344   |  5 |

        | 16:9         | 1344×768   |  5 |

        | 21:9         | 1536×672   |  5 |


        ## Gemini 3 Pro Image (Preview)


        | Aspect Ratio | 1K Resolution | 1K Tokens | 2K Resolution | 2K Tokens |
        4K Resolution | 4K Tokens |

        |--------------|----------------|-----------|----------------|-----------|----------------|-----------|

        | 1:1          | 1024×1024      | 15      | 2048×2048      | 15      |
        4096×4096      | 30      |

        | 2:3          | 848×1264       | 15      | 1696×2528      | 15      |
        3392×5056      | 30      |

        | 3:2          | 1264×848       | 15      | 2528×1696      | 15      |
        5056×3392      | 30      |

        | 3:4          | 896×1200       | 15      | 1792×2400      | 15      |
        3584×4800      | 30      |

        | 4:3          | 1200×896       | 15      | 2400×1792      | 15      |
        4800×3584      | 30      |

        | 4:5          | 928×1152       | 15      | 1856×2304      | 15      |
        3712×4608      | 30      |

        | 5:4          | 1152×928       | 15      | 2304×1856      | 15      |
        4608×3712      | 30      |

        | 9:16         | 768×1376       | 15      | 1536×2752      | 15      |
        3072×5504      | 30      |

        | 16:9         | 1376×768       | 15      | 2752×1536      | 15      |
        5504×3072      | 30      |

        | 21:9         | 1584×672       | 15      | 3168×1344      | 15      |
        6336×2688      | 30      |



        ## Seedream 4.0


        | Resolution | Tokens |           

        |--------------|------------|

        | Total pixels range: [1280×720, 4096×4096] |
        5                                                                              

        ## Qwen   


        | Resolution | Tokens |           

        |--------------|------------|

        |  Total pixels range: [1280×720, 2048×2048] | 3     | 



      tags:
        - Reference
      parameters:
        - name: provider
          in: path
          description: >
            Specifies the AI model used for image generation.

            This field is an enumeration that defines which backend model will
            process the request.

            Different models provide different capabilities, image quality
            levels, aspect-ratio support, performance characteristics, and token
            costs.


            ## Allowed Values (Enum)

            | Enum Value                     | Model
            Description                                                                                                                                             
            |

            | ------------------------------ |
            --------------------------------------------------------------------------------------------------------------------------------------------------------------
            |

            | **qwen**                     |  Great at reading and creating
            clear text inside images.               |

            | **seedream-4-0-250828**               | Precise control over
            multiple images.                |

            | **gemini-2.5-flash-image**     | Unparalleled facial
            consistency.                                                     |

            | **gemini-3-pro-image-preview** | Ultra-sharp 4K, consistent,
            intelligent generation. |
          required: true
          example: gemini-3-pro-image-preview
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            Here, <your_api_key> is the API key you obtained from the Fotor
            Developer Platform.
          required: true
          example: Bearer <your api key>
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: >-
                          The type of input. Allowed values: text (text prompt),
                          image_url (reference image).
                      text:
                        type: string
                        description: >-
                          Used when type = "text". Describes the desired
                          content, style, composition, etc.
                      url:
                        type: string
                        description: >-
                          Used when type = "image_url". A URL pointing to the
                          accessible reference image.
                      role:
                        type: string
                        description: >-
                          Indicates the role/type of the reference image,
                          guiding the model to focus on certain aspects of the
                          image. Common value: smart_reference (intelligent
                          reference).
                    required:
                      - type
                    x-apifox-orders:
                      - type
                      - text
                      - url
                      - role
                  description: >-
                    Describes the input elements for image generation. Supports
                    mixed text prompts and reference images.
                width:
                  type: integer
                  description: Target width of the generated image (in pixels).
                height:
                  type: integer
                  description: Target height of the generated image (in pixels).
              required:
                - content
                - width
                - height
              x-apifox-orders:
                - content
                - width
                - height
            example:
              content:
                - type: text
                  text: >-
                    Subject:

                    The human subject is reimagined as the main character in a
                    cinematic moment, walking a loyal pet companion. Their
                    silhouette is enhanced with soft, dramatic lighting that
                    adds depth, presence, and storytelling. The subject’s
                    features remain natural, recognized, and elevated with
                    movie-grade atmosphere.


                    Outfit:

                    A stylish, film-inspired outfit adapted to the user’s
                    daily-wear vibe — flowing coats, layered sweaters, subtle
                    textures, or minimalist modern clothing depending on the
                    final look. Everything is realistic, grounded, and
                    aesthetically pleasing.


                    Pet:

                    A [Dog] walking beside the subject. The pet’s form is
                    natural, expressive, and receives soft directional lighting
                    to match the cinematic tone. The pet behaves calmly, walking
                    close to the subject.


                    Setting:

                    A beautifully cinematic environment such as a quiet evening
                    street, a misty park pathway, a soft golden-hour field, or a
                    lantern-lit city walkway. Warm or cool tones depending on
                    the mood. Light mist, drifting particles, or soft bokeh
                    enhance the storytelling. Nature or city elements glow
                    gently in the background.


                    Camera / Composition:

                    4:5 vertical movie-frame

                    Medium-distance shot showing the full walk

                    Cinematic depth, wide aperture feel, atmospheric haze

                    No text, no watermark
                - type: image_url
                  url: >-
                    https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/ef3f9d2c-aa9b-4a99-96e6-c6c32d11df36.jpg
                  role: smart_reference
              width: 841
              height: 1152
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: '000: Success，999: Unknown error'
                    x-apifox-mock: '000'
                    examples:
                      - '000'
                  msg:
                    type: string
                    x-apifox-mock: success
                    examples:
                      - success
                  data:
                    type: object
                    properties:
                      taskId:
                        type: string
                        description: Task ID, used to query task information.
                        x-apifox-mock: e0dc194703174b6eafeacb4ee8e02850
                        examples:
                          - e0dc194703174b6eafeacb4ee8e02850
                    required:
                      - taskId
                    x-apifox-orders:
                      - taskId
                required:
                  - code
                  - msg
                  - data
                x-apifox-orders:
                  - code
                  - msg
                  - data
          headers: {}
          x-apifox-name: success
      security: []
      x-apifox-folder: Reference
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5562290/apis/api-384299001-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api-b.fotor.com
    description: 正式环境
security: []

```
