Fotor OpenAPI
  1. Reference
Fotor OpenAPI
  • Getting Started
    • Introduction
    • Access and Authentication
    • For Serverless Clients
    • Token Consumption
  • Reference
    • AI Upscaler
      POST
    • AI Skin Retouch
      POST
    • Text to Image
      POST
    • Image to Image (AI Art Effects)
      POST
    • Background Remover
      POST
    • AI Headshot
      POST
    • Photo Colorize
      POST
    • Photo Restoration
      POST
    • Face Swap
      POST
    • AI Replace
      POST
    • Query Task Details
      GET
  • Webhook
    • Webhook
  • AI Editor SDK
    • Getting Started
    • Get Sdk Temporary Token
      GET
  1. Reference

Image to Image (AI Art Effects)

POST
/v1/aiart/img2img

Image to Image Styles#

Image to Image Styles

Request

Header Params
Authorization
string 
required
Example:
Bearer <your api key>
Body Params application/json
content
string 
optional
Describe the content of the image you want to generate, for example, "a boy."
templateId
string 
required
Template ID: Used to specify the specific style template for generating the image. Refer to the template table for available options.
negativePrompt
string 
optional
Describe the content to avoid in the generated image, for example, "girl."
userImageUrl
string 
required
The URL or BASE64 encoded image of the initial image provided by the user. Images should not exceed a maximum dimension of 1536.
format
string 
optional
jpg or png, default is jpg
strength
number 
optional
A parameter that affects the similarity between the original image and the generated image, ranging from 0 to 1.
Example
{
  "content": "",
  "templateId": "ca39d44f-e8c8-4a3e-9d09-c3f96cb2fe60",
  "negativePrompt": "",
  "userImageUrl": "https://pub-static.fotor.com/assets/goart-effects/examples/mini-figure-after.jpg",
  "strength": 0.5,
  "format": "jpg"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-b.fotor.com/v1/aiart/img2img' \
--header 'Authorization: Bearer <your api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
        "content": "",
        "templateId": "ca39d44f-e8c8-4a3e-9d09-c3f96cb2fe60",
        "negativePrompt": "",
        "userImageUrl": "https://pub-static.fotor.com/assets/goart-effects/examples/mini-figure-after.jpg",
        "strength": 0.5,
        "format": "jpg"
}'

Responses

🟢200success
application/json
Body
code
string 
required
000: Success,999: Unknown error
Example:
000
msg
string 
required
Example:
success
data
object 
required
taskId
string 
required
Task ID, used to query task information.
Example:
e0dc194703174b6eafeacb4ee8e02850
Example
{
  "code": "000",
  "msg": "success",
  "data": {
    "taskId": "e0dc194703174b6eafeacb4ee8e02850"
  }
}
Previous
Text to Image
Next
Background Remover
Built with