emaki

Official SDK for emaki (emaki.ai), the Japanese-language AI video generator for Seedance 2.5 and Seedance 2.0. Generate Seedance 2.5 and Seedance 2.0 clips, and images, from R with the API key of your emaki account.

library(emaki)

clip <- emaki_generate_video("a paper lantern drifting down a night river, slow dolly-in")
clip  # URL of the finished MP4

Each generate call submits the run, waits for it and returns the URL of the finished file. Every run costs credits on your emaki account, the same price as on the website.

Install

install.packages("emaki", repos = c("https://hanshs474.r-universe.dev", "https://cloud.r-project.org"))

Imports curl and jsonlite.

API key

Sign up on emaki.ai, create a key at emaki.ai/settings/apikeys, then pass it or export it:

export EMAKI_API_KEY=sk-...

A key runs on your account exactly like the site does: same models, same credits, and every run shows up in your library on emaki.ai.

Video

The default model is seedance_2_5 (5 seconds, 480p, 16:9, with sound). Parameters go in as a named list and are passed through as-is:

# Seedance 2.5: 8 seconds, 720p, vertical
emaki_generate_video("a street drummer in the rain, handheld",
                     parameters = list(duration = 8, resolution = "720p", aspect_ratio = "9:16"))

# Seedance 2.0
emaki_generate_video("a koi pond seen from above, petals falling", model = "seedance_2",
                     parameters = list(duration = 5))
model what it is main parameters
seedance_2_5 Seedance 2.5, the default duration 4 to 30 · resolution 480p / 720p / 1080p · aspect_ratio 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive · generate_audio · image · last_frame_image
seedance_2 Seedance 2.0 duration 4 to 15 · resolution 480p / 720p / 1080p · aspect_ratio · generate_audio · image
seedance_2_fast Seedance 2.0 Fast duration 4 to 15 · resolution 480p / 720p · aspect_ratio · image
seedance_2_mini Seedance 2.0 Mini, the cheapest video model same as Fast
minimax_h3 MiniMax H3 duration 5 to 15 · aspect_ratio · image
veo_3_1 Veo 3.1 resolution 720p / 1080p / 4k · aspectRatio 16:9 / 9:16 · image

Image to video

Pass image, a public https URL, and it becomes the first frame; the prompt then describes the motion. This is the same image to video flow as on the site:

emaki_generate_video("the camera slowly orbits the statue",
                     parameters = list(image = "https://example.com/statue.jpg"))

On Seedance 2.5, last_frame_image pins the closing frame as well.

Images

The default image model is nano_banana_2_lite, the cheapest run on the site:

url <- emaki_generate_image("a ramen stall in the rain, neon reflections")
emaki_generate_image("a ukiyo-e style wave over a modern city", model = "nano_banana_2",
                     parameters = list(aspect_ratio = "16:9"))

Image models: nano_banana_2_lite, nano_banana_2 (resolution 1K / 2K / 4K), seedream_5_lite (quality basic / high / ultra), gpt_image_2 (resolution 1K / 2K / 4K). All take aspect_ratio.

Submit now, collect later

id <- emaki_submit("a fox trotting through fresh snow")
emaki_status(id)$status   # generating | completed | failed; $videoUrl when completed
emaki_credits()           # free to call

emaki_generate_video() and emaki_generate_image() take timeout_seconds (default 900) and poll_seconds (default 5).

Errors worth catching

Failures signal a condition you can catch by class (all inherit emaki_error):

Anything else (a network failure, a 5xx) comes back as emaki_other with the service's message.

More on emaki

Clips you make here can be sharpened afterwards with the AI video upscaler on the site.

日本語での使い方は シーダンス へ。

MIT licensed. Made by emaki.