FLUX 이미지 생성
CometAPI의 네이티브 BFL 호환 엔드포인트를 통해 FLUX.2 텍스트-이미지 및 참조 이미지 작업을 제출합니다.
개요
POST /flux/v1/\{model\} 네이티브 BFL 형식 이미지 작업을 제출합니다. 최상위 응답의 id을 저장한 후 GET /flux/v1/get_result 해당 작업 ID로 폴링합니다.
API 플레이그라운드에는 FLUX.2 Pro, Flex 및 Max용 텍스트-이미지 요청 예제가 포함되어 있습니다. 모델 ID와 계정 사용 가능 여부는 모델 페이지 또는 /v1/models에서 확인하세요.
요청 필드
prompt, width, height, output_format부터 시작하세요. seed도 전송할 수 있습니다. 완료된 결과에는 사용된 시드가 보고될 수 있지만, 이 필드만으로는 재현 가능한 출력이 보장되지 않습니다.
참조 이미지 편집의 경우 input_image에 공개 HTTPS 이미지 URL을 전송하세요. 이 필드는 위의 세 가지 FLUX.2 모델에서 지원됩니다. FLUX.2 Pro는 input_image_2에도 두 번째 공개 HTTPS URL을 허용합니다. input_image은 input_image_2을 전송할 때마다 포함하세요.
제출 및 폴링
작업이 실행되는 동안 생성 응답은status: "processing"을 사용할 수 있습니다. CometAPI 결과 엔드포인트에 최상위 id을 사용하세요. 클라이언트는 응답에서 제공되는 polling_url에 의존해서는 안 됩니다.
결과 엔드포인트가 status: "Ready"을 반환할 때까지 폴링하세요. Error, Failed, Failure, Task not found, Request Moderated, Content Moderated은 실패로 처리하세요. 다른 상태에서는 애플리케이션의 재시도 및 시간 제한 내에서 계속 폴링하세요.
인증
Bearer token authentication. Use your CometAPI key.
경로 매개변수
FLUX.2 model ID in the URL path. Check /v1/models or the Models page for account availability.
본문
Text prompt describing the image or reference-image edit.
"A clean editorial photograph of a red ceramic teapot on a pale blue table, soft window light, no text."
Public HTTPS URL of the first reference image. Replace the example URL with an image that the model provider can retrieve. This editing field is available for the FLUX.2 models covered by this reference.
"https://your-image-host/reference-one.jpg"
Public HTTPS URL of a second reference image for flux-2-pro. Replace the example URL and also send input_image.
"https://your-image-host/reference-two.jpg"
Optional seed value. A completed result can report the used seed; that field alone does not establish repeatable output.
Requested output width in pixels. Use a dimension supported by the selected model.
1280
Requested output height in pixels. Use a dimension supported by the selected model.
768
Requested output image format supported by the selected model. The examples use png.
"png"
응답
FLUX task submission response. Save the top-level id and poll the CometAPI result endpoint.
Task ID to pass to GET /flux/v1/get_result?id=....
Submission state. An accepted task can return processing.
Task result. It can be empty or null at submission time.
Response-supplied convenience URL when returned. Clients should poll the documented CometAPI result route by the top-level id.
Numeric billing coefficient when returned. This field is not documented as a currency or credit amount.
Input image megapixels when returned.
Output image megapixels when returned.
Task progress when returned.
Additional task details when returned.
Task preview data when returned.