Sprite Pulsar
목적
Pulsar 파이프라인으로 36프레임 스프라이트 애니메이션을 생성합니다. 웹 앱의 "Sprite Pulsar" 페이지와 동일한 기능입니다. Sprite Zenith와 동일한 입력과 모드를 사용하지만, 길이는 36프레임으로 고정되어 있고 프롬프트 보정 옵션이 없습니다.
| mode | 웹 탭 | 입력 |
|---|---|---|
image_to_video | 단일 이미지 | 이미지 1장 |
first_last_frame | 시작/끝 참조 이미지 | 이미지 2장: 시작 프레임과 끝 참조 이미지, 순서대로 |
video_restyle | Sprite To Sprite | 기존 스프라이트 1개 (PNG 스프라이트 시트 + 그리드, 또는 GIF)와 선택적인 레퍼런스 이미지 |
크레딧 비용: 3 (image_to_video, first_last_frame), 4 (video_restyle)
메서드 및 경로
POST /public/v1/sprite/pulsar
인증
인증 페이지를 참고하세요. Bearer 토큰이 필요합니다.
필수 헤더:
Authorization: Bearer {your_api_key}
요청 필드
요청은 multipart/form-data로 전송합니다. images 필드는 파일마다 한 번씩 반복합니다.
| 필드명 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
| mode | string | 예 | 허용 값: image_to_video, first_last_frame, video_restyle | |
| images | file[] | 예 | image_to_video: PNG/JPEG 정확히 1장. first_last_frame: PNG/JPEG 정확히 2장 (시작, 끝). video_restyle: 소스 정확히 1개, PNG 스프라이트 시트 또는 GIF | |
| text | string | 예, 레퍼런스 이미지가 있는 경우 제외 | "" | 움직임을 설명하는 프롬프트. 공백은 제거됩니다. video_restyle에서는 reference_image가 주어진 경우에만 비어 있을 수 있습니다 |
| is_pixel | boolean | 아니오 | false | 픽셀아트. 첨부한 이미지가 픽셀아트 기반의 이미지라면 켜주세요. video_restyle에서는 무시됩니다 (강제로 false) |
| reference_image | file | 아니오 (video_restyle 전용) | 레퍼런스 이미지 (선택). PNG만 가능. 소스 스프라이트의 대상이 이 이미지로 교체됩니다 | |
| sprite_grid | string | PNG 시트를 사용하는 video_restyle | PNG 시트를 자르는 방식을 설명하는 JSON 객체, 예: {"columns": 6, "rows": 6}. 각 값은 1–32, 최대 120프레임. GIF 소스에서는 허용되지 않습니다 |
Sprite To Sprite(video_restyle) 소스 규칙은 Sprite Zenith와 동일합니다: PNG 시트 + sprite_grid, 또는 최대 120프레임·10초의 GIF. frame 필드는 없으며, 출력은 항상 36프레임입니다.
응답
성공 응답 (200 OK):
{
"job_id": "uuid-string"
}
| 필드 | 타입 | 설명 |
|---|---|---|
| job_id | string | 생 성된 작업의 고유 식별자. 작업 상태 조회로 결과를 조회합니다 |
오류 / 유효성 검사 규칙
| 상황 | HTTP 상태 | 에러 메시지 |
|---|---|---|
| 파일이 유효한 이미지가 아니거나 허용되지 않는 형식임 | 400 | "Invalid image file" |
| 모드에 맞지 않는 이미지 개수 | 400 | "image_to_video requires exactly one image" / "first_last_frame requires exactly two images (start, end)" / "video_restyle requires exactly one source image (PNG sprite sheet or GIF)" |
| text가 비어 있음 (이미지 모드) | 400 | "text must not be empty" |
text가 비어 있고 레퍼런스 이미지 없음 (video_restyle) | 400 | "video_restyle requires text when no reference_image is given" |
video_restyle 외에서 reference_image 또는 sprite_grid 전송 | 400 | "reference_image is only supported for video_restyle" / "sprite_grid is only supported for video_restyle" |
| sprite_grid 없는 PNG 시트 | 400 | "sprite_grid is required for a PNG sprite sheet" |
| sprite_grid가 있는 GIF | 400 | "sprite_grid is not allowed for a GIF source" |
| sprite_grid 형식 오류 또는 범위 초과 | 400 | sprite_grid must be a JSON object like {"columns": 6, "rows": 6} (1-32 each, at most 120 frames) |
| GIF가 120프레임을 초과함 | 400 | "GIF must have at most 120 frames" |
| GIF가 10초보다 김 | 400 | "GIF must be at most 10 seconds long" |
| 유효하지 않은 API 키 | 401 | "Invalid API key" |
| 필드 누락 또는 알 수 없는 mode | 422 | Validation error |
모든 유효성 검사는 파일이 업로드되기 전에 실행됩니다.
비동기 작업 동작
이 엔드포인트는 비동기 작업을 생성합니다. 요청 즉시 job_id를 반환하고, 실제 스프라이트 생성은 백그라운드에서 진행됩니다.
폴링 방법:
- 응답으로 받은
job_id를 저장합니다 GET /public/v1/job/{job_id}를 폴링하여 상태를 확인합니다- 상태가
Succeed가 되면image_urls에서 결과를 확인합니다 (스프라이트 시트 및 GIF)
상태 흐름: Pending → Succeed 또는 Failed
요청 예시
cURL (단일 이미지):
curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/pulsar" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "mode=image_to_video" \
-F "images=@/path/to/character.png" \
-F "text=idle breathing" \
-F "is_pixel=true"
cURL (시작/끝 참조 이미지):
curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/pulsar" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "mode=first_last_frame" \
-F "images=@/path/to/start.png" \
-F "images=@/path/to/end.png" \
-F "text=draw the sword"
cURL (Sprite To Sprite, 레퍼런스 이미지가 있는 GIF):
curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/pulsar" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "mode=video_restyle" \
-F "images=@/path/to/sprite.gif" \
-F "reference_image=@/path/to/new_character.png"