EZLINK AI API
  1. Edit
EZLINK AI API
  • LLMs
    • 介绍
    • 项目说明
    • 导言
    • 身份验证
    • 发出请求
    • 参数详情
    • 音频(Audio)
      • 创建语音
      • 创建转录
      • 创建翻译
    • 聊天(Chat)
      • 聊天完成对象
      • 聊天完成块对象
      • 创建聊天补全
    • 自动补全(Completions)
      • 完成对象
      • 创建完成
    • 嵌入(Embeddings)
      • 嵌入对象
      • 创建嵌入
    • 图像(Images)
      • README
      • 图像对象
      • 创建图像
      • 创建图片编辑
      • 创建图像变体
    • 模型(Models)
      • 模型对象
      • 列出模型
      • 检索模型
    • 审查(Moderations)
      • 调节对象
      • 创建内容审核
  • Stability
    • Image-to-Video
      • Start generation
      • Fetch generation result
    • Upscale
      • Conservative
      • Start Creative Upscale
      • Fetch Creative Upscale result
    • Edit
      • Erase
        POST
      • Inpaint
        POST
      • Outpaint
        POST
      • Search and Replace
        POST
      • Remove Background
        POST
    • Generate
      • Stable Image Ultra
      • Stable Image Core
      • Stable Diffusion 3
    • Control
      • Sketch
      • Structure
      • Style
  • Midjourney
    • InsightFace任务提交
      • 提交swap_face任务
    • 任务提交
      • 执行动作
      • 提交Blend任务
      • 提交Describe任务
      • 提交Imagine任务
      • 提交Modal
      • 提交Shorten任务
    • 任务查询
      • 指定ID获取任务
      • 获取任务图片的seed(需设置mj或niji的私信ID)
  • File
  • Flux
    • 创建图像 Copy
  • video
    • 视频生成
    • 生成查询
  1. Edit

Outpaint

POST
https://api.ezlinkai.com/v2beta/stable-image/edit/outpaint
Edit
The Outpaint service inserts additional content in an image to fill in the space in any direction.
Compared to other automated or manual attempts to expand the content in an image, the Outpaint service
should minimize artifacts and signs that the original image has been edited.

Try it out#

Grab your API key and head over to Open Google Colab

How to use#

Please invoke this endpoint with a POST request.
The headers of the request must include an API key in the authorization field. The body of the request must be
multipart/form-data, and the accept header should be set to one of the following:
image/* to receive the image in the format specified by the output_format parameter.
application/json to receive the image encoded as base64 in a JSON response.
The body of the request must include:
image
Along with at least one outpaint direction:
left
right
up
down
Note: for best quality use outpaint direction values smaller or equal to your source image dimensions.
Each of these parameters should be set to a number between 0 and 2000, representing the number of pixels to outpaint in that direction.
Optionally, the body of the request may also include:
prompt
seed
output_format
creativity
Note: for more details about these parameters please see the request schema below.

Credits#

Flat rate of 4 credits per successful generation. You will not be charged for failed generations.

Request

Header Params
authorization
string 
required
Your Stability API key, used to authenticate your requests. Although you may have multiple keys in your account, you should use the same key for all requests to this API.
>= 1 characters
content-type
string 
required
The content type of the request body. Do not manually specify this header; your HTTP client library will automatically include the appropriate boundary parameter.
>= 1 characters
Example:
multipart/form-data
accept
enum<string> 
required
Specify image/* to get the image bytes directly. Otherwise specify application/json to receive the image as base64 encoded JSON.
Allowed values:
image/*application/json
Default:
image/*
stability-client-id
string 
optional
The name of your application, used to help us communicate app-specific debugging or moderation issues to you.
<= 256 characters
Example:
my-awesome-app
stability-client-user-id
string 
optional
A unique identifier for your end user. Used to help us communicate user-specific debugging or moderation issues to you. Feel free to obfuscate this value to protect user privacy.
<= 256 characters
Example:
DiscordUser#9999
stability-client-version
string 
optional
The version of your application, used to help us communicate version-specific debugging or moderation issues to you.
<= 256 characters
Example:
1.2.1
Body Params multipart/form-data
image
file 
required
The image you wish to outpaint.
Supported Formats:
jpeg
png
webp
Validation Rules:
Every side must be at least 64 pixels
Total pixel count must be between 4,096 and 9,437,184 pixels
The aspect ratio must be between 1:2.5 and 2.5:1
Example:
./some/image.png
left
integer 
optional
The number of pixels to outpaint on the left side of the image. At least one outpainting direction must be supplied with a non-zero value.
>= 0<= 2000
Default:
0
right
integer 
optional
The number of pixels to outpaint on the right side of the image. At least one outpainting direction must be supplied with a non-zero value.
>= 0<= 2000
Default:
0
up
integer 
optional
The number of pixels to outpaint on the top of the image. At least one outpainting direction must be supplied with a non-zero value.
>= 0<= 2000
Default:
0
down
integer 
optional
The number of pixels to outpaint on the bottom of the image. At least one outpainting direction must be supplied with a non-zero value.
>= 0<= 2000
Default:
0
creativity
number 
optional
Controls the likelihood of creating additional details not heavily conditioned by the init image.
>= 0.2<= 0.5
Default:
0.5
prompt
string 
optional
What you wish to see in the output image. A strong, descriptive prompt that clearly defines
elements, colors, and subjects will lead to better results.
To control the weight of a given word use the format (word:weight),
where word is the word you'd like to control the weight of and weight
is a value between 0 and 1. For example: The sky was a crisp (blue:0.3) and (green:0.8)
would convey a sky that was blue and green, but more green than blue.
>= 0 characters<= 10000 characters
seed
number 
optional
A specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass 0 to use a random seed.)
>= 0<= 4294967294
Default:
0
output_format
enum<string> 
optional
Dictates the content-type of the generated image.
Allowed values:
pngjpegwebp
Default:
png
Example:
png

Request samples

Python
JavaScript
Shell
Java
Swift
Go
PHP
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Python
JavaScript
Shell
Java
curl --location --request POST 'https://api.ezlinkai.com/v2beta/stable-image/edit/outpaint' \
--header 'authorization;' \
--header 'accept;' \
--header 'stability-client-id;' \
--header 'stability-client-user-id;' \
--header 'stability-client-version;' \
--form 'image=@"./some/image.png"' \
--form 'left=""' \
--form 'right=""' \
--form 'up=""' \
--form 'down=""' \
--form 'creativity=""' \
--form 'prompt=""' \
--form 'seed=""' \
--form 'output_format="png"'

Responses

🟢200Outpainting was successful.
application/json
Body
object {0}
Example
{}
🟠400Invalid parameter(s), see the `errors` field for details.
🟠403Your request was flagged by our content moderation system.
🟠413Your request was larger than 10MiB.
🟠422Your request was well-formed, but rejected. See the `errors` field for details.
🟠429You have made more than 150 requests in 10 seconds.
🔴500An internal error occurred. If the problem persists [contact support](https://stabilityplatform.freshdesk.com/support/tickets/new).
Modified at 2024-08-18 02:36:51
Previous
Inpaint
Next
Search and Replace
Built with