image-to-video

Generate a video from a still image using video_generate. Use when the user asks to animate a reference image, turn a rendering into motion, or produce a short motion clip.

Install

openclaw skills install @leonrard/image-to-video

Image-to-Video

Workflow

  1. Identify the reference image.

    • Prefer the most recent image attachment in the session from image_generate.
    • If no local image exists, ask the user for one or generate it first with the image-generator skill.
    • Done when: the absolute path to the reference image is known.
  2. Confirm motion + lighting intent with the user.

    • Extract: camera motion (orbit / dolly-in / static / pan), scene progression (time-of-day change, weather shift, action), and any audio constraints.
    • Done when: the prompt describes one continuous motion and one lighting/state transition in concrete terms.
  3. Call video_generate with these defaults.

    • image: the path from step 1.
    • imageRoles: ["reference_image"] (use as visual reference, not strict first frame). Use ["first_frame"] only when the user wants the exact frame preserved.
    • aspectRatio: 16:9 for cinematic / drone shots, 9:16 for vertical, otherwise match the source image.
    • resolution: start at 1080P; fall back to 720P if the provider rejects the resolution/duration combo.
    • durationSeconds: 10 for time-lapse / orbit, 6 for action-heavy clips, 8 as a balanced default.
    • watermark: omit (provider ignores it on MiniMax-Hailuo-2.3).
    • timeoutMs: 300000.
    • Done when: the tool returns a task id and the run is backgrounded.
  4. Recover from known incompatibilities.

    • If the failure mentions "duration Xs and resolution YP" → drop to the next-lower resolution at the same duration (1080P → 720P, 720P → 540P).
    • If the failure mentions "invalid api key" → retry; the tool auto-selects the alternate provider path.
    • Done when: a successful generation task id is returned, or the user is told the combo is impossible and asked to choose another.
  5. Deliver the result.

    • Wait for the completion event; do not poll manually.
    • Reply with a short caption and the MEDIA: directive on its own line, using the absolute mp4 path the completion event returns.
    • Done when: the user can see and play the video inline.

Pitfalls

  • Don't combine a custom aspectRatio and a non-default size for MiniMax-Hailuo-2.3 — pick one.
  • 1080P + 10s is rejected on MiniMax-Hailuo-2.3. Use 1080P + 6s or 720P + 10s.
  • reference_image lets the model reinterpret lighting/composition; first_frame locks the start. Match the role to the user's intent.