Skip to content

feat(jimeng_video): accept a local first-frame image for image_to_video - #486

Open
hubooy wants to merge 1 commit into
calesthio:mainfrom
hubooy:feat/jimeng-local-first-frame
Open

feat(jimeng_video): accept a local first-frame image for image_to_video#486
hubooy wants to merge 1 commit into
calesthio:mainfrom
hubooy:feat/jimeng-local-first-frame

Conversation

@hubooy

@hubooy hubooy commented Aug 8, 2026

Copy link
Copy Markdown

Summary

jimeng_video's image_to_video requires image_url — a publicly reachable URL — so the first frame has to be uploaded to public hosting before it can be animated. For unreleased client artwork that is an avoidable exposure, and it adds an object-storage dependency to an otherwise self-contained local workflow.

The Jimeng API already accepts inline image bytes, so this adds a local-file path.

Related issue

None — filing the fix directly.

Changes

  • New image_path input: a local first-frame image, sent to the API as binary_data_base64. No public URL or object storage needed.
  • When both are supplied, the local file wins — it is the path that needs no hosting.
  • image_path is validated with is_file() before the API call, so a typo fails fast instead of after a paid submission.
  • Validation now accepts either input; the error message names both.
  • image_path joins idempotency_key_fields.

Testing

  • python -m pytest tests/contracts/ -q — 630 passed, 7 skipped (includes test_jimeng_video.py).
  • Payload construction verified directly against _build_payload:
    • local image_path produces binary_data_base64, and the base64 decodes back to the exact file bytes;
    • with both inputs supplied, the payload carries binary_data_base64 and no image_urls;
    • with only image_url, the payload is unchanged from today (image_urls).
  • Validation verified through execute(): a nonexistent image_path returns image_path not found: ... and omitting both returns the new either/or message — both before any network call.
  • Not verified: a live submission to the Jimeng API. The base64 field name follows the provider's documented binary_data_base64 input; worth a maintainer check against your own credentials before merge.

Checklist

  • The change is focused on a single logical concern.
  • I ran the relevant tests locally (make test-contracts / make test) where applicable.
  • I updated docs/README if behavior or usage changed. — the new input is documented in the tool's input_schema.
  • No unrelated files (build artifacts, local config) are included in the diff.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GYThSL15CujvBwD1wuUmr9

image_to_video required image_url — a publicly reachable URL — so the
first frame had to be uploaded to public hosting before it could be
animated. For unreleased client artwork that is an avoidable exposure.

Add image_path, sent to the API as binary_data_base64, needing no public
URL or object storage. A local file takes precedence over image_url when
both are given, and its existence is checked before the API call.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYThSL15CujvBwD1wuUmr9
@hubooy
hubooy requested a review from calesthio as a code owner August 8, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant