인페인트, 아웃페인트, 다시 그리기 작업 생성
기존 이미지를 편집합니다:
- 인페인트(
fillType: inpaint): 마스크 영역을 다시 그립니다. - 아웃페인트(
fillType: outpaint): 이미지를 가장자리 바깥으로 확장합니다. 원본을 더 큰 흰색 캔버스에 배치해baseImageMediaId로 보내고, 마스크로 새 영역을 표시하세요. - 다시 그리기(
fillType: inpaint, 마스크 없음): 이미지 전체를 다시 그립니다.strength가 낮을수록 원본에 가깝게 유지됩니다.
마스크 편집에는 항상 함께 보내야 하는 이미지 두 개가 추가로 필요합니다:
maskMediaId: 베이스 이미지와 같은 크기로, 다시 그릴 곳은 흰색, 유지할 곳은 검은색입니다.maskedImageMediaId: 베이스 이미지에서 마스크의 흰색 영역을 회색(#808080)으로 칠한 이미지입니다.
마스크를 보내면 출력은 마스크 적용 이미지의 크기가 되고, 보내지 않으면 베이스 이미지의 크기가 됩니다. 이미지는 미디어 ID로 지정합니다. POST /v2/media/image/upload-url을 참고하세요.
modelPreset: "v1"을 사용하세요. 프리셋의 크기 제한과 sdeditPreset 이름은 GET /v2/gen-task/inpaint/constraints에서 확인할 수 있습니다. 크레딧은 작업 생성 시 차감되며, 결과는 GET /v2/task/{id}의 outputs.mediaIds[0]입니다.
Authorization
bearerAuth 인증이 필요한 모든 요청에는 HTTP 헤더에 다음을 추가하세요
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST https://api.pixai.art/v2/gen-task/inpaint \ -H "Authorization: Bearer $PIXAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "modelPreset": "v1", "fillType": "inpaint", "baseImageMediaId": "1943547603237249965", "maskMediaId": "1943547603237249966", "prompt": "red scarf" }'{
"id": "string",
"status": "waiting",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"startedAt": "2019-08-24T14:15:22Z",
"endAt": "2019-08-24T14:15:22Z",
"taskKind": "string",
"paidQuota": 0,
"taskStatusMsgI18n": {
"key": "string",
"defaultMessage": "string"
},
"outputs": {
"videoMediaId": "string",
"seed": "string",
"mediaIds": [
"string"
],
"mediaUrls": [
"string"
]
}
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}{
"code": "string",
"status": 0,
"message": "string",
"data": {},
"defined": true
}