2.5k
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
3 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill openclaw/skills --skill ms-foundry-image-gen- _meta.json489 B
- SKILL.md2.9 KB
Overview
This skill generates images by calling an Azure Foundry images deployment and returns either raw image bytes (PNG/JPEG) or a URL depending on the deployment response. It is designed for automated workflows that need programmatic image generation with a configurable deployment, API key, and endpoint. The skill expects network access to your Foundry endpoint and a valid API key.
How this skill works
The skill constructs a POST to the Foundry images endpoint for a specified deployment, sending a JSON payload with prompt, size, format, and count. It accepts the Foundry response and either extracts base64 image data and decodes it to bytes or returns any URL provided by the service. Environment variables drive the endpoint, API key, deployment name, and API version so the same code works across accounts and environments.
When to use it
- Generate single or batch images programmatically from text prompts.
- Integrate image creation into content pipelines, chatbots, or automation tasks.
- Produce PNG or JPEG assets without running a local model.
- Work within CI/CD or serverless workflows where credentials and endpoints are provided via env vars.
- Automate fallback image generation for UIs or notifications.
Best practices
- Store FOUNDRY_API_KEY securely in environment variables or a secret manager; never hard-code keys.
- Validate FOUNDRY_ENDPOINT format before use to reduce injection or misconfiguration risks.
- Stream base64 payloads to files rather than loading large images into shell variables to avoid memory/exposure issues.
- Specify explicit output_format and size in the request to control image type and dimensions.
- Handle authentication errors and rate limits gracefully; retry with exponential backoff for transient failures.
Example use cases
- A chatbot that creates illustrative images on user request and returns downloadable files.
- A content pipeline that generates thumbnails or visual assets from textual descriptions.
- An automated report generator that embeds freshly generated visuals into PDFs.
- A serverless endpoint that accepts prompts and returns image bytes to clients.
- Batch image creation for A/B testing visual concepts.
FAQ
FOUNDRY_ENDPOINT, FOUNDRY_API_KEY, and FOUNDRY_DEPLOYMENT are required. FOUNDRY_API_VERSION is optional and defaults to 2025-04-01-preview.
How do I get the image bytes?
The response includes base64 image data under data[0].b64_json for inline bytes; decode that base64 stream to produce a PNG/JPEG file. Some deployments may instead return a URL.
How do I reduce security risks when invoking the endpoint?
Validate the endpoint URL format, avoid passing untrusted shell input into requests, use jq --arg for safe JSON building, and stream base64 payloads to files rather than storing them in shell variables.