メインコンテンツへスキップ

スプライト作成 V1

Purpose

アップロードした画像を基にスプライトアニメーションを生成します。ピクセルアートスタイルまたは一般スタイルでスプライトシートを作成できます。

Method and Path

POST /public/v1/sprite/make-sprite/v1

Authentication

認証ページを参照してください。Bearerトークンが必要です。

必須ヘッダー:

Authorization: Bearer {your_api_key}

Request Fields

フィールド名タイプ必須説明
imagefileはいスプライト生成の基盤となる画像ファイル
textstringはいスプライト生成のためのテキストプロンプト
frameintegerはい生成するフレーム数。必ず25, 36, 49, 64, 81, 100, 121, 144, 169のいずれかである必要があります
is_pixelbooleanはい画像がピクセルアートスタイルか。true または false

Response

成功レスポンス (200 OK):

{
"job_id": "uuid-string"
}
フィールドタイプ説明
job_idstring作成されたジョブの一意識別子。Get Job Statusで結果を照会します

Error / Validation Rules

状況HTTP状態エラーメッセージ
Invalid image file400"Invalid image file"
frame値が許可された値でない400"frame should be one of 25, 36, 49, 64, 81, 100, 121, 144, 169"
認証失敗401無効なAPIキー

許可されたフレーム値:

  • 25, 36, 49, 64, 81, 100, 121, 144, 169

Async Job Behavior

このエンドポイントは非同期ジョブを作成します。リクエスト即座にjob_idを返し、実際のスプライト生成はバックグラウンドで進行します。

ポーリング方法:

  1. レスポンスで受け取ったjob_idを保存します
  2. GET /public/v1/job/{job_id}をポーリングして状態を確認します
  3. 状態がSucceedになるとimage_urlsで結果を確認します (GIFおよび個別フレーム画像)

状態フロー: PendingSucceed または Failed

Example Request

cURL (ピクセルアートスタイル):

curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/make-sprite/v1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/character.png" \
-F "text=walking animation" \
-F "frame=64" \
-F "is_pixel=true"

cURL (一般スタイル):

curl -X POST "https://api.aetherforgeai.com/public/v1/sprite/make-sprite/v1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/character.png" \
-F "text=running animation cycle" \
-F "frame=36" \
-F "is_pixel=false"