> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simli.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preprocess Trinity Face Image

> Reframes a portrait to the framing its generation expects, and returns the reframed PNG. GSA_1.0: the head centred with equal padding above and below, squared to the camera, on a simplified version of the image's own background. GSA_2.0: the person waist-up, with the torso and both hands, on the image's own background. Either way, the image needs someone facing the camera.



## OpenAPI

````yaml https://api.simli.ai/openapi.yaml post /faces/trinity/preprocess
openapi: 3.1.0
info:
  title: Simli
  version: 1.0.0
servers:
  - url: https://api.simli.ai/
    description: API server
security:
  - ApiKeyAuth: []
paths:
  /faces/trinity/preprocess:
    post:
      summary: Preprocess Trinity Face Image
      description: >-
        Reframes a portrait to the framing its generation expects, and returns
        the reframed PNG. GSA_1.0: the head centred with equal padding above and
        below, squared to the camera, on a simplified version of the image's own
        background. GSA_2.0: the person waist-up, with the torso and both hands,
        on the image's own background. Either way, the image needs someone
        facing the camera.
      operationId: preprocess_image_faces_trinity_preprocess_post
      parameters:
        - name: gsVersion
          in: query
          required: false
          description: >-
            The avatar generation the image is for. Pass the same one to POST
            /faces/trinity. Checks that the account has a Trinity-2 generation
            (GSA_2.0) or a face slot (GSA_1.0) left, as that call does. GSA_1.0
            is only available to accounts created before October 26, 2026.
          schema:
            allOf:
              - $ref: '#/components/schemas/TrinityVersion'
            default: GSA_2.0
        - name: retry
          in: query
          required: false
          description: >-
            Render at higher quality. Substantially slower - roughly 160 seconds
            against 25 - so use it to re-run an image whose first result was
            unsatisfactory rather than as the default.
          schema:
            type: boolean
            default: false
            title: Retry
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_preprocess_image_faces_trinity_preprocess_post
      responses:
        '200':
          description: >-
            The reframed image. Pass TARGET-RATIO back to POST /faces/trinity as
            the target-ratio header, along with this image, to generate from it.
          headers:
            TARGET-RATIO:
              description: >-
                Tracker ratio measured off the returned image: how much frame
                surrounds the head. Pass it verbatim to POST /faces/trinity as
                the target-ratio header - that call needs it to track the face,
                and its presence also tells the API this image is already
                framed. GSA_2.0 measures none and returns 0; pass it back all
                the same.
              schema:
                type: number
                format: float
            warnings:
              description: >-
                JSON array of advisory strings. Empty when there is nothing to
                report; the image is still usable when it is not.
              schema:
                type: string
            required-padding:
              description: >-
                JSON object of the padding added around the head, keyed up,
                down, left, right. Always zero now that framing is done by
                cropping.
              schema:
                type: string
          content:
            image/png:
              schema:
                type: string
                format: binary
        '403':
          description: >-
            Out of avatars for this gsVersion: with GSA_2.0, you have no
            Trinity-2 generations left; with GSA_1.0, every face slot of your
            plan is taken. Also returned for GSA_1.0 on an account created on or
            after October 26, 2026, which can only make GSA_2.0 faces.
components:
  schemas:
    TrinityVersion:
      type: string
      description: >-
        The avatar generation: GSA_2.0 makes a Trinity-2 face, GSA_1.0 a
        Trinity-1 face (accounts created before October 26, 2026 only).
      enum:
        - GSA_1.0
        - GSA_2.0
      title: GSVersion
    Body_preprocess_image_faces_trinity_preprocess_post:
      properties:
        image:
          type: string
          format: binary
          title: Image
          description: >-
            JPEG, PNG or WEBP, under 5MB, at least 512x512. It must contain a
            person facing the camera whose head is at least 15% of the image
            height - a head smaller than that carries too few pixels to keep the
            likeness, and is rejected. Where several people are present, the
            largest camera-facing head is treated as the subject.
      type: object
      required:
        - image
      title: Body_preprocess_image_faces_trinity_preprocess_post
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-simli-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.