접근 불가능한 URL: 하나 이상의 reference_image_urls를 다운로드할 수 없음.
잘못된 파라미터: aspect_ratio가 선택한 ai_model에 허용되지 않는 값임.
충돌: generate_multi_view와 aspect_ratio를 동시에 사용할 수 없음.
Name
401 - Unauthorized
Description
인증에 실패했습니다. API 키를 확인하십시오.
Name
402 - Payment Required
Description
이 작업을 수행하기에 충분한 크레딧이 없습니다.
Name
429 - Too Many Requests
Description
속도 제한을 초과했습니다.
Request
POST
/openapi/v1/image-to-image
# Transform a reference image with a text promptcurlhttps://api.meshy.ai/openapi/v1/image-to-image \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "reference_image_urls": [ "<your publicly accessible image url or base64-encoded data URI>" ] }'## Using Data URI examplecurlhttps://api.meshy.ai/openapi/v1/image-to-image \-XPOST \-H"Authorization: Bearer ${YOUR_API_KEY}" \-H'Content-Type: application/json' \-d'{ "ai_model": "nano-banana", "prompt": "Transform this into a cyberpunk style artwork", "reference_image_urls": [ "data:image/png;base64,${YOUR_BASE64_ENCODED_IMAGE_DATA}" ] }'
{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-image","ai_model":"nano-banana","prompt":"Transform this into a cyberpunk style artwork","status":"SUCCEEDED","progress":100,"created_at":1692771650657,"started_at":1692771667037,"finished_at":1692771669037,"expires_at":1692771679037,"image_urls": ["https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ]}
[ {"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-image","ai_model":"nano-banana","prompt":"Transform this into a cyberpunk style artwork","status":"SUCCEEDED","progress":100,"created_at":1692771650657,"started_at":1692771667037,"finished_at":1692771669037,"expires_at":1692771679037,"image_urls": ["https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ] }]
이미지로 이미지 작업 객체는 참조 이미지와 텍스트 prompt 입력을 통해 이미지를 생성하기 위해 Meshy가 추적하는 작업 단위입니다.
이 객체는 다음과 같은 속성을 가지고 있습니다:
속성
Name
id
Type
string
Description
작업의 고유 식별자입니다. 우리는 작업 ID에 대해 k-sortable UUID를 구현 세부사항으로 사용하지만, ID의 형식에 대해 어떠한 가정도 하지 않아야 합니다.
Name
type
Type
string
Description
이미지 생성 작업의 유형입니다. 이미지로 이미지 작업의 경우, 항상 image-to-image가 됩니다.
Name
ai_model
Type
string
Description
이 작업에 사용된 AI 모델입니다. 가능한 값은 nano-banana, nano-banana-2, nano-banana-pro, 또는 gpt-image-2입니다.
Name
prompt
Type
string
Description
이미지 변환을 안내하는 데 사용된 텍스트 prompt입니다.
Name
status
Type
string
Description
작업의 상태입니다. 가능한 값은 PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED 중 하나입니다.
Name
progress
Type
integer
Description
작업의 진행 상황입니다. 작업이 아직 시작되지 않은 경우, 이 속성은 0이 됩니다. 작업이 성공하면, 이 값은 100이 됩니다.
Name
created_at
Type
timestamp
Description
작업이 생성된 시간의 타임스탬프입니다(밀리초 단위).
타임스탬프는 1970년 1월 1일 UTC 이후 경과된 밀리초 수를 나타내며, RFC 3339 표준을 따릅니다.
예를 들어, 2023년 9월 1일 금요일 오후 12:00:00 GMT는 1693569600000으로 표현됩니다. 이는 Meshy API의 모든 타임스탬프에 적용됩니다.
Name
started_at
Type
timestamp
Description
작업이 시작된 시간의 타임스탬프입니다(밀리초 단위). 작업이 아직 시작되지 않은 경우, 이 속성은 0이 됩니다.
Name
finished_at
Type
timestamp
Description
작업이 완료된 시간의 타임스탬프입니다(밀리초 단위). 작업이 아직 완료되지 않은 경우, 이 속성은 0이 됩니다.
Name
expires_at
Type
timestamp
Description
작업 결과가 만료되는 시간의 타임스탬프입니다(밀리초 단위).
Name
preceding_tasks
Type
integer
Description
이전 작업의 수입니다.
이 필드의 값은 작업 상태가 PENDING일 때만 의미가 있습니다.
Name
image_urls
Type
array
Description
생성된 이미지의 다운로드 가능한 URL 배열입니다. generate_multi_view가 활성화된 경우, 이 배열은 서로 다른 시각 각도를 나타내는 세 개의 이미지 URL을 포함합니다. 그렇지 않으면, 단일 이미지 URL을 포함합니다.
Name
task_error
Type
object
Description
실패한 작업에 대한 오류 세부사항입니다. 전체 task_error 객체 참조는 오류를 참조하십시오.
Name
consumed_credits
Type
integer
Description
이 작업에 소비된 크레딧의 수입니다. 작업 상태가 PENDING, IN_PROGRESS, 또는 SUCCEEDED일 때 나타납니다. FAILED 작업의 경우 0을 반환합니다 (실패 시 크레딧은 환불됩니다).
Example Image to Image Task Object
{"id":"018a210d-8ba4-705c-b111-1f1776f7f578","type":"image-to-image","ai_model":"nano-banana","prompt":"Transform this into a cyberpunk style artwork","status":"SUCCEEDED","progress":100,"created_at":1692771650657,"started_at":1692771667037,"finished_at":1692771669037,"expires_at":1692771679037,"preceding_tasks":0,"image_urls": ["https://assets.meshy.ai/***/tasks/018a210d-8ba4-705c-b111-1f1776f7f578/output/image.png?Expires=***" ],"task_error": {"message":"" },"consumed_credits":3}