# Text to Image

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/aiart/text2img:
    post:
      summary: Text to Image
      deprecated: false
      description: >
        The **Text2Image** feature in Fotor OpenAPI leverages advanced AI
        technology to transform your textual descriptions into realistic images.
        Simply input a text description, and the system quickly generates a
        corresponding image—no design skills required.  


        This feature supports a variety of styles and templates, offering
        fine-grained control options to help you effortlessly create diverse and
        creative visuals.  


        ## Key Features  


        - **Easy to Use**:  
          Generate images effortlessly by simply entering a text description, with an intuitive and quick process.  

        - **Diverse Styles**:  
          Offers a wide range of artistic styles and templates, including:  
          - Photography  
          - Anime  
          - Oil Painting  
          - 3D  
          - And more, to suit various creative needs.  

        - **Precise Control**:  
          Supports specifying:  
          - Image dimensions  
          - Template selection  
          - Negative prompts for fine-tuned results  

        - **High-Quality Output**:  
          Delivers high-resolution images with rich details, ready for commercial use.  

        - **Fast Generation**:  
          Powered by advanced AI algorithms and optimized server architecture, ensuring quick image creation.  

        ## Text to Image Styles


        [Text to Image
        Styles](https://docs.fotor.com/reference/text2img/styles/)
      tags:
        - Reference
      parameters:
        - 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: string
                  description: >-
                    Describe the content of the image you want to generate, for
                    example, "A cute cat playing on the grass."
                sizeId:
                  type: string
                  description: >-
                    Image dimensions, used to specify the size of the generated
                    image. For example（1:1、4:3、3:4、16:9、9:16）。
                templateId:
                  type: string
                  description: >-
                    [Template
                    ID](https://docs.fotor.com/reference/text2img/styles/), used
                    to specify the specific style template for the generated
                    image. Refer to the template table for available options.
                negativePrompt:
                  type: string
                  description: >-
                    Negative prompts are used to describe content you want to
                    avoid in the generated image, such as "blurry" or
                    "distorted." Using negative prompts helps you have better
                    control over the output, preventing unwanted elements from
                    appearing.
              required:
                - content
                - sizeId
                - templateId
              x-apifox-orders:
                - content
                - sizeId
                - templateId
                - negativePrompt
            example:
              content: a boy
              sizeId: 6361e03bc09cb851c66328a4
              templateId: 7b3b1f40-60b0-41df-8280-238baae78c38
              negativePrompt: girl
      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
              example:
                code: '000'
                msg: success
                data:
                  taskId: e0dc194703174b6eafeacb4ee8e02850
          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-240777220-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api-b.fotor.com
    description: 正式环境
security: []

```
