videoeditor-genai: typed image-generation clients (Grok Imagine + Imagen) and an image subcommand#8
Merged
Conversation
… an `image` subcommand New crate videoeditor-genai: typed request/response bindings for still-image generation, built for optional episode-asset generation from the CLI: - xai module: Grok Imagine images (OpenAI-compatible endpoint) with reference-image conditioning (data-URL strings, ≤7), n≤10, aspect_ratio enum probed from the API, b64_json responses (the asset CDN 403s plain downloads; url branch kept as UA-header fallback). - google module: Imagen 4 stills via the Gemini :predict endpoint — aspect-true, no reference input (requests with refs are rejected with a pointer at grok), safety-filter rejections surfaced as such. Veo video is the module's planned next resident. - CLI: `videoeditor image "prompt" -o out.png [--provider grok|imagen] [--ref img ...] [-n N] [--aspect 1:1] [--model id]`. - guide.md pipeline/env + CLAUDE.md layout updated. Provider behavior (ref limits, CDN workaround, safety-filter routing) ported from production use in the fallout-is-real-life engine. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
New crate
videoeditor-genaiwith typed clients for still-image generation, plus avideoeditor imagesubcommand, so episodes can optionally generate assets (memes, mascots-in-costume, backdrops) without leaving the pipeline.xaimodule — Grok Imagine (XAI_API_KEY): text→image with reference-image conditioning (--ref, up to 7, encoded as data-URL strings), up to 10 variants, typedAspectRatioenum matching the values the API enumerates. Requestsb64_jsonbecause xAI's asset CDN 403s plain downloads (June 2026); a UA-headerurlfallback remains.googlemodule — Imagen 4 (AI_STUDIO/GEMINI_API_KEY): aspect-true safe stills via the Gemini:predictendpoint. Takes no reference images — such requests are rejected with a message routing to grok; emptypredictionsis reported as a probable safety-filter rejection. Veo (video) is this module's planned next resident.videoeditor image "prompt" -o out.png [--provider grok|imagen] [--ref img ...] [-n N] [--aspect 1:1] [--model id]— writes_v1.._vNsuffixes for multi-variant runs, prints revised prompts when the provider rewrites.Provider behavior (ref ceiling, CDN workaround, filter routing, b64 preference) ported from production use in the fallout-is-real-life engine's provider layer.
Testing
just checkclean; unit tests cover payload shape (refs as plain strings, omitted empty optionals, camelCase Imagen params) and aspect-ratio parsing.--ref bun.png -n 3 --aspect 1:1), including a moderation-rejection path (surfaces the API's message cleanly).🤖 Generated with Claude Code