Skip to article

Direction animation

Animate selected character directions as a batch.

Integration status: the web workflow is available. API/MCP submission for this business is not enabled yet; batch persistence setup is still pending. The contract below documents the planned integration.

What you can create

Animate one character action in one to eight compass directions. Each selected direction is a separate media task. For example, a four-direction walk produces independent N, E, S and W results, so one failure does not discard successful directions.

Prepare the request

Choose one ready full-body character image, a motion and unique directions. Supported actions are idle, walk, run, dash, roll, crouch, punch, hit, interact and death. Directions are N, NE, E, SE, S, SW, W and NW. The service selects the action template and reads input dimensions.

Generate in the workspace

  1. Open the Direction animation workflow from the character or generation workspace.
  2. Choose the character image and one motion.
  3. Select the required directions and review the total cost.
  4. Start the batch and inspect the individual direction results.
  5. Download successful files even if another direction failed. Inspect failed results before a deliberate retry.

Choices, limits and cost

All new direction animations use Pro video generation and Fal video background removal. Each selected direction costs 10 credits. Four directions cost 40; eight cost 80. Every action produces 32 transparent frames at 8 FPS from a 4-second video. Failed directions can be retried in Pro at 10 credits each; successful directions are retained. Historical basic-mode results keep their original frame counts.

Saving to a character action requires an existing compatible action and its current directional reference. A terminal partial success is distinct from a batch still processing. Do not resubmit the complete batch to recover one failed direction; a deliberate retry should select only the failed directions and use a new request identity.

Parameters

These fields are generated from the same input Schema used by REST and MCP. Nested required fields apply when their parent object or selected variant is present. Business conditions described above are validated before submission.

FieldTypeRequiredDefault and limits
modestringNoMust be "pro"; Default: "pro"
characterIdstringNominLength: 1; maxLength: 255
characterTargetobject / objectNoSee the workflow requirements above.
retryOfBatchIdstringNoSee the workflow requirements above.
projectIdstringNominLength: 1; maxLength: 255
folderIdstring / nullNoSee the workflow requirements above.
motionstringYes"idle", "walk", "run", "dash", "roll", "crouch", "punch", "hit", "interact", "death"
directionsarrayYesminItems: 1; maxItems: 8
inputAssetIdstringYesSee the workflow requirements above.

API example

This example costs 40 credits. A quote does not reserve balance or bypass subscription requirements. Set SPRITEFLOW_API_KEY in your shell. Replace the placeholder asset ID 00000000-0000-4000-8000-000000000001 with a ready asset you own when present. Use a new idempotency key for each intentional generation; keep it unchanged when retrying.

bash

# Use the same BASE_URL for credentials, uploads and generation.
BASE_URL="https://spriteflow.io"
IDEMPOTENCY_KEY="example-workflow-001"

cat > request.json <<'JSON'
{
  "operation": "generate_direction_animation",
  "input": {
    "inputAssetId": "00000000-0000-4000-8000-000000000001",
    "motion": "walk",
    "directions": [
      "N",
      "E",
      "S",
      "W"
    ]
  }
}
JSON

curl --fail-with-body "$BASE_URL/api/v1/estimates" \
  -H "Authorization: Bearer $SPRITEFLOW_API_KEY" \
  -H "Content-Type: application/json" --data-binary @request.json

curl --fail-with-body "$BASE_URL/api/v1/tasks" \
  -H "Authorization: Bearer $SPRITEFLOW_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" --data-binary @request.json

An accepted request returns HTTP 202, Location and Retry-After headers. Example response (IDs are illustrative):

json
{"taskId":"00000000-0000-4000-8000-000000000002","status":"accepted","statusUrl":"/api/v1/tasks/00000000-0000-4000-8000-000000000002","pollAfterSeconds":10,"replayed":false}

MCP example

Call estimate_cost with the same operation and input, then call generate_direction_animation. The following is a tools/call params object:

json
{
  "name": "generate_direction_animation",
  "arguments": {
    "input": {
      "inputAssetId": "00000000-0000-4000-8000-000000000001",
      "motion": "walk",
      "directions": [
        "N",
        "E",
        "S",
        "W"
      ]
    },
    "idempotencyKey": "example-workflow-001"
  }
}

The tool returns the same task receipt in structuredContent and a JSON text result. Pass taskId to get_task. Tool annotations describe behavior; permissions are still checked on the server.

Completion, download and reuse

Poll the returned statusUrl after pollAfterSeconds. Continue while terminal is false. Read items for per-task results, progress for batch counts and assets for ready files. A batch can be partially_completed: use its successful assets and review each failed item before deciding whether to create a separate retry.

For each returned asset ID, call get_download_url or GET /api/v1/assets/{assetId}/download. Download the temporary URL before it expires. Image assets can be passed into a compatible operation as inputAssetId or a style reference. Do not pass provider task IDs, download URLs or local filesystem paths as asset IDs.

Failures and recovery

  • INVALID_PARAMETERS: fix the field errors before submitting. Check the business conditions and defaults above.
  • INPUT_ASSET_UNAVAILABLE: confirm the upload, check ownership and ensure the asset is ready and not trashed.
  • INSUFFICIENT_CREDITS: add credits before a new request; a cost estimate does not reserve them.
  • A timeout or lost response: resend the identical request with the original idempotency key. Never invent a new key just because the response was lost.
  • A terminal generation failure: inspect the item error and refund information. Refund handling uses the existing generation workflow. Do not assume an in-progress or unknown submission is safe to repeat.

Uploads · Tasks · Credits · Idempotency · Save destinations · Download and export