{"_id":"@cheeseandcereal/openclaw-bedrock-images","name":"@cheeseandcereal/openclaw-bedrock-images","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@cheeseandcereal/openclaw-bedrock-images","version":"0.1.0","description":"OpenClaw image generation plugin for Amazon Bedrock (InvokeModel with Bedrock API keys or AWS credentials)","type":"module","license":"Unlicense","repository":{"type":"git","url":"git+https://github.com/cheeseandcereal/openclaw-bedrock-images.git"},"keywords":["openclaw","openclaw-plugin","amazon-bedrock","stability-ai","image-generation"],"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","check":"tsc -p tsconfig.json --noEmit","prepack":"npm run build"},"openclaw":{"extensions":["./dist/index.js"],"compat":{"pluginApi":">=2026.7.1","minGatewayVersion":"2026.7.1"},"build":{"openclawVersion":"2026.7.1","pluginSdkVersion":"2026.7.1"}},"peerDependencies":{"openclaw":">=2026.7.1"},"dependencies":{"@aws-sdk/client-bedrock-runtime":"^3.1087.0"},"devDependencies":{"@types/node":"^22.20.1","openclaw":"2026.7.1","typescript":"^5.9.0","vitest":"^3.2.0"},"_id":"@cheeseandcereal/openclaw-bedrock-images@0.1.0","gitHead":"2e405cb867bbcff8b4d1b90d3563b15f3668fdd4","bugs":{"url":"https://github.com/cheeseandcereal/openclaw-bedrock-images/issues"},"homepage":"https://github.com/cheeseandcereal/openclaw-bedrock-images#readme","_nodeVersion":"22.17.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-SaDUb2DAU13KPQS0mxgaxBC/R7fnGtI//LqceaCIVDElPURJH9Gw8qv+p5jjeZts5PKPuo67bZgkI9Vdi80y6A==","shasum":"3781a6e0e53c4955342887f48c8c14822a3ed465","tarball":"https://registry.npmjs.org/@cheeseandcereal/openclaw-bedrock-images/-/openclaw-bedrock-images-0.1.0.tgz","fileCount":16,"unpackedSize":49018,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDRLopNVljyMWpzOIClq7/l8uIWx6x7USIfq9wdmJuuuAiEA9ii5uKuo7LV/qx2H7QYyXRcNh1NZOO/I0cNpJF78iVk="}]},"_npmUser":{"name":"cheeseandcereal","email":"mail@adamcrowder.net"},"directories":{},"maintainers":[{"name":"cheeseandcereal","email":"mail@adamcrowder.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openclaw-bedrock-images_0.1.0_1784090873296_0.2004949859341365"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-15T04:47:53.154Z","0.1.0":"2026-07-15T04:47:53.441Z","modified":"2026-07-15T04:47:53.626Z"},"maintainers":[{"name":"cheeseandcereal","email":"mail@adamcrowder.net"}],"description":"OpenClaw image generation plugin for Amazon Bedrock (InvokeModel with Bedrock API keys or AWS credentials)","homepage":"https://github.com/cheeseandcereal/openclaw-bedrock-images#readme","keywords":["openclaw","openclaw-plugin","amazon-bedrock","stability-ai","image-generation"],"repository":{"type":"git","url":"git+https://github.com/cheeseandcereal/openclaw-bedrock-images.git"},"bugs":{"url":"https://github.com/cheeseandcereal/openclaw-bedrock-images/issues"},"license":"Unlicense","readme":"# openclaw-bedrock-images\n\n[OpenClaw](https://openclaw.ai) image generation plugin for **Amazon Bedrock**, using the Bedrock runtime `InvokeModel` API.\n\n- Text-to-image with SD3.5 Large, Stable Image Core, and Stable Image Ultra\n- Image editing with the Stability AI Image Services (inpaint, erase, remove background, search & replace, outpaint, upscales, control sketch/structure, style guide/transfer)\n- Auth with an [Amazon Bedrock API key](https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started-api-keys.html) (bearer token), or optionally the standard AWS SDK credential chain (SigV4)\n\nThe [currently supported models](#supported-models) are the Stability AI family — the current-generation image output models on Bedrock. The plugin itself is not Stability-specific: as Bedrock gains image models, new request-schema families can be added.\n\n## Install\n\n```bash\nopenclaw plugins install @cheeseandcereal/openclaw-bedrock-images\nopenclaw gateway restart\n```\n\n## Setup\n\n1. Create a Bedrock API key and export it (the standard AWS env var):\n\n   ```bash\n   export AWS_BEARER_TOKEN_BEDROCK=\"your-bedrock-api-key\"\n   ```\n\n2. Configure the region and (optionally) a default image model:\n\n   ```json5\n   {\n     plugins: {\n       entries: {\n         \"bedrock-images\": {\n           config: {\n             region: \"us-west-2\",\n           },\n         },\n       },\n     },\n     agents: {\n       defaults: {\n         imageGenerationModel: {\n           primary: \"bedrock-images/stability.sd3-5-large-v1:0\",\n         },\n       },\n     },\n   }\n   ```\n\n3. Make sure your AWS account has [model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) enabled for the models you want, in the region you configured.\n\nThat's it — the `image_generate` tool becomes available to your agent, and you can also test from the CLI:\n\n```bash\nopenclaw infer image generate \\\n  --model bedrock-images/stability.sd3-5-large-v1:0 \\\n  --prompt \"A lighthouse on a rocky coast at sunset, oil painting style\" \\\n  --output lighthouse.png --json\n```\n\n## Configuration reference\n\nAll settings live under `plugins.entries.bedrock-images.config`:\n\n| Key | Default | Description |\n| --- | --- | --- |\n| `region` | AWS SDK region chain (`AWS_REGION`, `~/.aws/config`, ...) | AWS region for the `bedrock-runtime` endpoint |\n| `auth` | `\"api-key\"` | `\"api-key\"` uses a Bedrock API key (bearer token); `\"aws-sdk\"` uses the AWS SDK default credential chain (SigV4) |\n| `apiKey` | unset | Bedrock API key as a literal string, `\"${ENV_VAR}\"` shorthand, or a [SecretRef](#api-key-as-a-secret) object |\n| `defaultModel` | `stability.sd3-5-large-v1:0` | Model used when a request doesn't specify one |\n| `models` | `{}` | Per-model settings map, see below |\n\nAPI key resolution order: `apiKey` plugin config → stored OpenClaw auth profile → `AWS_BEARER_TOKEN_BEDROCK` env var. With `auth: \"aws-sdk\"`, no API key is used and the normal AWS credential chain (env keys, `~/.aws/credentials`, SSO, IMDS, ...) signs requests instead.\n\n### API key as a secret\n\n`apiKey` accepts any OpenClaw *SecretInput*, so you never have to put the raw key in your config file:\n\n```json5\n{\n  plugins: {\n    entries: {\n      \"bedrock-images\": {\n        config: {\n          // Env var (shorthand form):\n          apiKey: \"${MY_BEDROCK_KEY}\",\n\n          // ... or an explicit SecretRef. Sources: \"env\", \"file\" (mounted\n          // secret files), or \"exec\" (secret manager CLIs like vault/pass),\n          // configured under OpenClaw's `secrets.providers`:\n          // apiKey: { source: \"exec\", provider: \"vault\", id: \"bedrock/api-key\" },\n          // apiKey: { source: \"file\", provider: \"mounted-json\", id: \"/bedrock/apiKey\" },\n        },\n      },\n    },\n  },\n}\n```\n\nA configured `apiKey` that fails to resolve is a hard error (with the SecretRef named in the message) rather than a silent fallback to other sources. A literal string also works but is discouraged for anything beyond local experiments.\n\n### Per-model settings (`models`)\n\n```json5\n{\n  plugins: {\n    entries: {\n      \"bedrock-images\": {\n        config: {\n          models: {\n            // Static fields merged into the InvokeModel request body:\n            \"us.stability.stable-image-search-replace-v1:0\": {\n              options: { search_prompt: \"the main subject\" },\n            },\n            \"us.stability.stable-outpaint-v1:0\": {\n              options: { left: 512, right: 512 },\n            },\n            // Advertise an extra/new model id and/or force its request schema:\n            \"eu.stability.stable-image-inpaint-v2:0\": { family: \"inpaint\" },\n          },\n        },\n      },\n    },\n  },\n}\n```\n\n- `options` — static fields merged into the request body (e.g. `negative_prompt`, `seed`, `style_preset`, `strength`, outpaint directions, `search_prompt`). Per-request values (prompt, images, aspect ratio, output format) win on conflict.\n- `family` — overrides request-schema auto-detection. Auto-detection matches the service slug in the model id and ignores region prefixes (`us.`, `eu.`, ...) and version suffixes, so new versions and regions work without configuration. Valid families: `text-to-image`, `inpaint`, `erase`, `remove-background`, `search-replace`, `search-recolor`, `outpaint`, `creative-upscale`, `conservative-upscale`, `fast-upscale`, `control-sketch`, `control-structure`, `style-guide`, `style-transfer`.\n\nAny model id works even if it isn't listed anywhere — unknown ids use the standard text-to-image schema.\n\n## Supported models\n\nThe current model table covers the Stability AI family, Bedrock's current-generation image output models. Support for other model families can be added as Bedrock gains image models.\n\nModel selection is per request: the agent can pass `model` to `image_generate`, or you set `agents.defaults.imageGenerationModel`. There is no automatic routing to edit services — to use one, select its model id explicitly.\n\n### Text-to-image\n\n| Model | Notes |\n| --- | --- |\n| `stability.sd3-5-large-v1:0` | Default. Also supports image-to-image (pass a reference image) |\n| `stability.stable-image-ultra-v1:1` | Highest quality. Also supports image-to-image |\n| `stability.stable-image-core-v1:1` | Fastest/cheapest. Text-to-image only |\n\nSupported aspect ratios: `1:1`, `16:9`, `21:9`, `2:3`, `3:2`, `4:5`, `5:4`, `9:16`, `9:21`. Output formats: `png`, `jpeg`, `webp`. One image per request.\n\n### Image services (editing)\n\nThese use cross-region inference-profile ids (note the `us.` prefix) per the [AWS docs](https://docs.aws.amazon.com/bedrock/latest/userguide/stable-image-services.html):\n\n| Model | Inputs |\n| --- | --- |\n| `us.stability.stable-image-inpaint-v1:0` | prompt + image (+ optional mask as 2nd image) |\n| `us.stability.stable-image-erase-object-v1:0` | image (+ optional mask as 2nd image) |\n| `us.stability.stable-image-remove-background-v1:0` | image |\n| `us.stability.stable-image-search-replace-v1:0` | prompt + image + `search_prompt` via config `options` |\n| `us.stability.stable-image-search-recolor-v1:0` | prompt + image + `select_prompt` via config `options` |\n| `us.stability.stable-outpaint-v1:0` | image + directions (`left`/`right`/`up`/`down`) via config `options` |\n| `us.stability.stable-creative-upscale-v1:0` | prompt + image |\n| `us.stability.stable-conservative-upscale-v1:0` | prompt + image |\n| `us.stability.stable-fast-upscale-v1:0` | image |\n| `us.stability.stable-image-control-sketch-v1:0` | prompt + image |\n| `us.stability.stable-image-control-structure-v1:0` | prompt + image |\n| `us.stability.stable-image-style-guide-v1:0` | prompt + image (style reference) |\n| `us.stability.stable-style-transfer-v1:0` | 2 images: `images[0]` = image to restyle, `images[1]` = style reference |\n\nInput conventions:\n\n- **Mask**: for inpaint/erase, pass the mask as the second reference image (`images[1]`). Without a mask, the image's alpha channel is used.\n- **Extra fields** (`search_prompt`, `select_prompt`, outpaint directions, `grow_mask`, `creativity`, ...) are not part of OpenClaw's shared `image_generate` tool, so they come from the per-model `options` config shown above. Requests fail with a config-pointing error when a required field is missing.\n\nExample (CLI):\n\n```bash\nopenclaw infer image edit \\\n  --model bedrock-images/us.stability.stable-image-remove-background-v1:0 \\\n  --file photo.jpg --prompt \"remove the background\" \\\n  --output subject.png --json\n```\n\n## Region availability\n\nBedrock image models are only available in certain AWS regions (Stability text-to-image models commonly in `us-west-2`; the `us.stability.*` image services via US inference profiles). Check [model support by region](https://docs.aws.amazon.com/bedrock/latest/userguide/models-regions.html) and set `plugins.entries.bedrock-images.config.region` accordingly. Access/not-found errors from this plugin include the region used to make misconfiguration obvious.\n\n## Development\n\n```bash\nnpm install\nnpm test          # vitest unit tests\nnpm run build     # tsc -> dist/\n```\n\nTo test a local build against a real OpenClaw install:\n\n```bash\nnpm pack\nopenclaw plugins install npm-pack:./cheeseandcereal-openclaw-bedrock-images-<version>.tgz --force\nopenclaw plugins inspect bedrock-images --runtime --json\n```\n\n## License\n\n[Unlicense](./UNLICENSE) — public domain.\n","readmeFilename":"README.md","_rev":"1-ae0ef5bc6616d532f6e5f359aec216e8"}