← 返回
内容创作 Key 中文

Microsoft Foundry image generation

Azure Foundry image generation skill for OpenClaw; generates images via a Foundry deployment and returns image bytes or URLs.
适用于 OpenClaw 的 Azure Foundry 图像生成技能;通过 Foundry 部署生成图像并返回图像字节或 URL。
jacqueskang
内容创作 clawhub v1.0.6 1 版本 99754.3 Key: 需要
★ 2
Stars
📥 1,178
下载
💾 45
安装
1
版本
#latest

概述

Azure Foundry Image Generation

AI image generation using an Azure Foundry (Cognitive Services / OpenAI) images deployment. Returns raw image bytes (PNG/JPEG) or a URL depending on the deployment response.

Overview


  • Requires network access to your Foundry endpoint and a valid API key.

Usage


Set environment variables (example):

export FOUNDRY_ENDPOINT="https://aif-sbxe2e-ai-agent-02.cognitiveservices.azure.com/"
export FOUNDRY_API_KEY="<your_api_key>"
export FOUNDRY_DEPLOYMENT="FLUX-1.1-pro"
export FOUNDRY_API_VERSION="2025-04-01-preview"

Generate an image (safe example using jq to build JSON):

# Basic validation (reject obviously malformed endpoints)
if ! printf '%s' "${FOUNDRY_ENDPOINT:-}" | grep -Eq '^https?://[A-Za-z0-9._:-]+/?$'; then
  echo "FOUNDRY_ENDPOINT looks unsafe or is not set" >&2
  exit 1
fi

url="${FOUNDRY_ENDPOINT%/}/openai/deployments/${FOUNDRY_DEPLOYMENT}/images/generations?api-version=${FOUNDRY_API_VERSION:-2025-04-01-preview}"

PROMPT="a red fox"
jq -n --arg prompt "$PROMPT" '{prompt:$prompt, n:1, size:"1024x1024", output_format:"png"}' | \
  curl --fail --show-error --silent \
    --url "$url" \
    -H 'Content-Type: application/json' \
    -H "api-key: ${FOUNDRY_API_KEY}" \
    --data-binary @- -o /tmp/generation_result.json
  
# Stream base64 payload to avoid storing large values in shell variables
jq -r '.data[0].b64_json' /tmp/generation_result.json | base64 --decode > /tmp/generated_image.png
echo "Image saved to: /tmp/generated_image.png"

Options


  • FOUNDRY_ENDPOINT (required): Azure base URI for Foundry (include scheme, e.g. https://.cognitiveservices.azure.com/)
  • FOUNDRY_API_KEY (required): API key (primary credential)
  • FOUNDRY_DEPLOYMENT (required): Deployment name to call
  • FOUNDRY_API_VERSION (optional): API version (default: 2025-04-01-preview)

Notes


  • The skill manifest (src/manifest.json) declares the required environment variables and marks FOUNDRY_API_KEY as the primary credential.
  • This document provides a safe example using jq --arg and streaming to prevent shell interpolation and command-injection risks.

Troubleshooting


  • If you see authentication errors, verify FOUNDRY_API_KEY permissions for the deployment.
  • If jq or base64 are missing, install them via your package manager (e.g., apt install jq coreutils on Debian/Ubuntu).

License / Attribution


This skill is a minimal wrapper around the Foundry images generation REST endpoint for use in OpenClaw workflows.

版本历史

共 1 个版本

  • v1.0.6 当前
    2026-03-29 08:27 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 858 📥 199,487
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,152
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,442