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

# Merge Portraits

> Merge Portraits API blends faces from target and template images using AI face fusion for realistic portrait composites.



## OpenAPI

````yaml /openapi.json post /api/portrait/effects/face-fusion
openapi: 3.0.0
info:
  title: AILabAPI
  description: >-
    [<b>AILabTools</b>](https://www.ailabtools.com) is an advanced tool that
    offers a vast array of simple and flexible API endpoints to suit your
    specific needs. With just one [<b>API
    KEY</b>](https://www.ailabtools.com/doc/get-api-key), you can easily call
    any of the endpoints and integrate them quickly into your application or
    workflow, allowing for smooth and efficient operations.


    [<b>AILabTools</b>](https://www.ailabtools.com) is continuously evolving,
    and you can anticipate even more API endpoints being added in the future,
    further enhancing its capabilities and usefulness for your artificial
    intelligence and machine learning requirements.
  version: 1.0.0
servers:
  - url: https://www.ailabapi.com
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: AI IMAGE
  - name: AI IMAGE > Image Enhancement
  - name: AI IMAGE > Image Effects
  - name: AI IMAGE > Image Editing
  - name: AI IMAGE > Image Scoring
  - name: AI BACKGROUND REMOVAL
  - name: AI BACKGROUND REMOVAL > Portrait
  - name: AI BACKGROUND REMOVAL > General
  - name: AI PORTRAIT
  - name: AI PORTRAIT > Portrait Effects
  - name: AI PORTRAIT > Portrait Enhance
  - name: AI PORTRAIT > Portrait Editing
  - name: AI PORTRAIT > Portrait Analysis
  - name: AI COMMON
paths:
  /api/portrait/effects/face-fusion:
    post:
      tags:
        - AI PORTRAIT > Portrait Effects
      summary: Merge Portraits
      description: >-
        Merge Portraits API blends faces from target and template images using
        AI face fusion for realistic portrait composites.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image_target:
                  type: string
                  description: Target image.
                  format: binary
                image_template:
                  type: string
                  description: Template images.
                  format: binary
                source_similarity:
                  type: string
                  description: >-
                    Face similarity, where a higher numerical value indicates
                    greater similarity. <li>`0`: Consistent with the original
                    template.</li> <li>`1`: Maximum similarity with the target
                    image.</li>
      responses:
        '200':
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                request_id: ''
                log_id: ''
                error_code: 0
                error_code_str: ''
                error_msg: ''
                error_detail:
                  status_code: 200
                  code: ''
                  code_message: ''
                  message: ''
                data:
                  image: ''
          description: Success
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: ailabapi-api-key
      description: API Key for authentication

````