● nureta
Docs
Video

Save a character

Generate a character once, save it in your library and use it in any video by its id, so the person looks the same every time.

This page uses NURETA_URL, NURETA_KEY and the wait_task helper from Get started.

Generate a character once, save it in your Library, and use it in any video by its id. A generation costs $0.10 and makes 2 candidates. Saving is free.

  1. Generate:
GEN_ID=$(curl -s -X POST "$NURETA_URL/api/v3/library/generations" \
  -H "Authorization: Bearer $NURETA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "character",
       "spec": {"sex": "female", "age_group": "30s", "hair": "short red hair", "outfit": "green raincoat"},
       "prompt": "freckles, a calm smile"}' | jq -r .id)
  1. Wait until status is done (usually under a minute):
until S=$(curl -s "$NURETA_URL/api/v3/library/generations/$GEN_ID" -H "Authorization: Bearer $NURETA_KEY" | jq -r .status); \
      [ "$S" = done ] || [ "$S" = rejected ] || [ "$S" = failed ]; do sleep 5; done; echo "$S"
curl -s "$NURETA_URL/api/v3/library/generations/$GEN_ID" -H "Authorization: Bearer $NURETA_KEY" | jq '.candidates'

Open the two thumb_url links (they work for 15 minutes) and pick one.

  1. Save it, by its ref:
CHR_ID=$(curl -s -X POST "$NURETA_URL/api/v3/library/items" \
  -H "Authorization: Bearer $NURETA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Mira", "from": "'"$GEN_ID"'#0"}' | jq -r .id)
echo "$CHR_ID"   # chr_...
  1. Use it in a video. With a cast, bind it to its person with person:
curl -s -X POST "$NURETA_URL/api/v3/contents/generations/tasks" \
  -H "Authorization: Bearer $NURETA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "seahorse-480p", "duration": 5,
       "content": [
         {"type": "text", "text": "Mira waits by the window, rain outside."},
         {"type": "library_item", "library_item": {"id": "'"$CHR_ID"'"}, "person": "p1"}
       ],
       "cast": {"members": [{"id": "p1", "sex": "female", "name": "Mira"}]}}' | jq '{id, status}'

A generation that ends rejected or failed is refunded. A library item does not work with the direct Seedance models (422 library_ref_unsupported) or as a first or last frame.