feat(jimeng_video): accept a local first-frame image for image_to_video - #486
Open
hubooy wants to merge 1 commit into
Open
feat(jimeng_video): accept a local first-frame image for image_to_video#486hubooy wants to merge 1 commit into
hubooy wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jimeng_video'simage_to_videorequiresimage_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
image_pathinput: a local first-frame image, sent to the API asbinary_data_base64. No public URL or object storage needed.image_pathis validated withis_file()before the API call, so a typo fails fast instead of after a paid submission.image_pathjoinsidempotency_key_fields.Testing
python -m pytest tests/contracts/ -q— 630 passed, 7 skipped (includestest_jimeng_video.py)._build_payload:image_pathproducesbinary_data_base64, and the base64 decodes back to the exact file bytes;binary_data_base64and noimage_urls;image_url, the payload is unchanged from today (image_urls).execute(): a nonexistentimage_pathreturnsimage_path not found: ...and omitting both returns the new either/or message — both before any network call.binary_data_base64input; worth a maintainer check against your own credentials before merge.Checklist
make test-contracts/make test) where applicable.input_schema.🤖 Generated with Claude Code
https://claude.ai/code/session_01GYThSL15CujvBwD1wuUmr9