Repository navigation
feat: codemode-imagegen package, create, edit and models across seven providers (SHFT-2966) - #103
Merged
Merged
Conversation
… providers (SHFT-2966)
…eir bytes (SHFT-2966)
…b addresses and bounds (SHFT-2966)
…ng it inline (SHFT-2966)
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.
Adds
@shiftlabs/codemode-imagegen: one plugin,imagegen, that makes and edits images through the image provider the connection chooses.Actions
imagegen.create({ prompt, model?, width?, height?, numImages? })imagegen.edit({ prompt, images, model?, width?, height?, numImages? })imagegen.models({ query?, limit? })createandeditwrite each image to the host's output directory and return{ provider, model, images: [{ path, mimeType, byteLength, width?, height? }] }. The size reported is read from the bytes.Design
provider, else the first with a key). No action has a provider input.generate, and a host adds its own withimagegen([mine, ...PROVIDERS]).Providers
openai, google, xai, recraft, together, fal, replicate, in that order.
Checked against each provider's own docs on 23 Nov 2026. Corrections from that check are in this PR: retired OpenAI and Together models, Together's address and side range, OpenAI's 1:3 to 3:1 aspect bound, fal's
status_url/response_url, Replicate'sabortedstate and search tags, Recraft's utility models.Also in this PR
readLocalFilemoves fromcodemode-plugins/_sharedto@shiftlabs/codemodeso a package can use it. The nine bundled callers import it from there.Not proven
No image has been made with a working key. Request shapes come from provider docs and stubbed hosts. Least certain:
GET /v1/modelsis not in its docs or SDK (a failure falls back to the built-in list), and its docs do not say whether edits accept data URLs.urls.get) is taken from its JavaScript client, not its HTTP reference.The bundled
togetherandopenaiplugins carry the same stale models: SHFT-2983.Tests
46 in the package; all repository gates pass.