Skip to main content
POST
이 경로를 사용하면 CometAPI에서 OpenAI 호환 multipart 업로드로 기존 이미지를 편집할 수 있습니다.

이 경로를 사용하는 경우

  • 이미 소스 이미지가 있고 프롬프트(Prompt) 기반 편집을 원할 때
  • 특정 부분만 변경하기 위해 마스크가 필요할 수 있을 때
  • 일반 JSON 요청 대신 multipart 파일 업로드를 처리할 수 있을 때

안전한 첫 요청

  • PNG 또는 JPG 파일 1개로 시작하세요
  • 기본 편집 흐름이 작동할 때까지 마스크는 건너뛰세요
  • 이 경로에서 GPT 이미지 편집 요청에는 model: "gpt-image-2"를 사용하세요
  • 눈에 보이는 변경 1가지를 요청하는 짧은 지시문 1개를 사용하세요
  • 편집된 결과는 data[0].b64_json에서 읽으세요
  • JPEG 페이로드가 필요하면 output_format: "jpeg"를 설정하세요
  • 일반 이미지 생성보다 지연 시간이 더 길 수 있음을 예상하세요

모델 동작

  • 이 경로의 GPT 이미지 편집 모델은 인라인 base64 이미지 데이터를 반환합니다
  • output_formatb64_json 내부의 인코딩된 이미지 형식을 제어합니다
  • response_format은 모델이 URL 출력을 지원할 때만 의미가 있습니다
  • qwen-image-edit는 동일한 CometAPI 경로 뒤에서 provider별 편집 동작을 따릅니다

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

본문

multipart/form-data
image
file
필수

Source image file. Start with one PNG or JPG input for the simplest flow.

prompt
string
필수

Edit instruction describing the change you want.

예시:

"Add a small red ribbon to the paper boat."

model
string
기본값:gpt-image-2

The image editing model to use. Choose a supported model from the Models page.

mask
file

Optional PNG mask. Transparent areas mark the regions to edit. The mask dimensions must match the source image exactly.

n
string
기본값:1

Number of edited images to return.

quality
enum<string>

Quality setting for models that support it.

사용 가능한 옵션:
high,
medium,
low
response_format
enum<string>

Requested response container when supported by the selected model. GPT image edit models return data[].b64_json; use output_format to choose the encoded image type.

사용 가능한 옵션:
url,
b64_json
output_format
string

Encoded image type for GPT image edit results returned in data[].b64_json. For example, use jpeg for a JPEG payload.

예시:

"jpeg"

size
string

Requested output size when supported by the selected model.

응답

200 - application/json

Edited image result.

created
integer
필수
usage
object
필수
data
object[]
필수
background
string

Background mode returned by models that expose it.

output_format
string

Encoded image type returned by GPT image models.

quality
string

Quality level returned by models that expose it.

size
string

Output size returned by models that expose it.

마지막 수정일 2026년 6월 23일