← 返回 Skills 市场
zwcih

FLUX.2-pro Image Generation

作者 zwcih · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
415
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install azure-flux-image-gen
功能描述
Generate images using Black Forest Labs FLUX.2-pro via Azure AI Foundry. Use when asked to create, generate, or produce images, illustrations, photos, artwor...
使用说明 (SKILL.md)

FLUX.2-pro Image Generation

Generate high-quality images from text prompts using FLUX.2-pro on Azure AI Foundry.

Setup

Set environment variables (typically in OpenClaw config or shell profile):

export FLUX_ENDPOINT="https://\x3Cresource>.services.ai.azure.com/providers/blackforestlabs/v1/flux-2-pro?api-version=preview"
export FLUX_API_KEY="YOUR_KEY_HERE"

Quick Generation

Use the bundled script:

node scripts/generate.mjs --prompt "a red fox in autumn forest" --output fox.png
node scripts/generate.mjs --prompt "cute robot" --width 1440 --height 816 --output robot.png

Direct API Call

When the script isn't suitable, call the API directly:

curl -s -X POST "$FLUX_ENDPOINT" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $FLUX_API_KEY" \
  -d '{"prompt":"a cat","width":1024,"height":1024,"n":1,"model":"FLUX.2-pro"}' \
  | node -e "process.stdin.on('data',d=>{const j=JSON.parse(d);require('fs').writeFileSync('out.png',Buffer.from(j.data[0].b64_json,'base64'))})"

Critical parameters: "n": 1 and "model": "FLUX.2-pro" are mandatory. Omitting them causes HTTP 500.

Chinese Text Overlay

FLUX cannot render CJK characters. Overlay text with Node.js Canvas:

import { createCanvas, loadImage, registerFont } from "canvas";
registerFont("NotoSansCJK-Bold.otf", { family: "NotoSansCJK" });

const img = await loadImage("base.png");
const canvas = createCanvas(img.width, img.height);
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
ctx.font = 'bold 48px "NotoSansCJK"';
ctx.fillStyle = "#ffffff";
ctx.fillText("你好世界", 100, 100);

Requires: npm install canvas + a CJK font file (e.g., NotoSansCJK-Bold.otf).

Best Practices

  • Serialize requests — avoid parallel API calls; use sequential generation
  • Set 180s timeout — generation can take 30–120 seconds
  • Prompt in English — FLUX works best with English prompts
  • Content filter — avoid violent, sexual, or otherwise filtered content in prompts
  • Print quality — use 1240×1754 for A3, scale up as needed

API Reference

See references/api.md for full request/response schema and size options.

安全使用建议
This skill appears to do what it claims. Before installing: ensure the FLUX_ENDPOINT you supply is the intended Azure Foundry resource and the FLUX_API_KEY is scoped/rotated appropriately (treat it like any API secret). The local script writes image files to disk — confirm you are comfortable with that output path. If you need Chinese text overlay, you'll have to install the 'canvas' package and provide a CJK font file locally. Also confirm your Node runtime supports fetch and AbortSignal.timeout (or run with a compatible Node version). Finally, follow content-policy guidance for prompts and avoid sharing your API key in public contexts.
功能分析
Type: OpenClaw Skill Name: azure-flux-image-gen Version: 1.1.0 The skill bundle provides a legitimate implementation for generating images via the Azure AI Foundry FLUX.2-pro API. The Node.js script (scripts/generate.mjs) and documentation (SKILL.md) correctly handle API authentication via environment variables and perform standard file I/O to save generated images without any signs of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
Name/description, SKILL.md, references/api.md, and scripts/generate.mjs all describe the same capability: calling a FLUX.2-pro endpoint to generate one image. The only required secrets (FLUX_ENDPOINT, FLUX_API_KEY) are appropriate for that purpose.
Instruction Scope
Runtime instructions and the bundled script only read the declared env vars and perform image generation and optional Canvas overlay. They write the generated image to disk (expected) and log output. There are no steps that read unrelated files, scan system state, or post data to other endpoints.
Install Mechanism
No install spec is provided (instruction-only), and included code is a small local Node script. The SKILL.md suggests optionally installing the 'canvas' npm package and a CJK font for text overlay — those are reasonable, explicit developer/user actions and not automatically fetched by the skill.
Credentials
Only FLUX_ENDPOINT and FLUX_API_KEY are required and declared; primaryEnv is FLUX_API_KEY. The code does not access other environment variables or credential/config paths.
Persistence & Privilege
The skill is not marked always:true, is user-invocable, and does not modify other skills or system-wide configuration. Allowing autonomous invocation is the platform default and not by itself a problem here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install azure-flux-image-gen
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /azure-flux-image-gen 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Add metadata.openclaw.requires.env and primaryEnv declarations for FLUX_ENDPOINT and FLUX_API_KEY
v1.0.1
Fix: remove patterns that triggered false-positive suspicious content flag
v1.0.0
Initial release: FLUX.2-pro image generation via Azure AI Foundry with Chinese text overlay support
元数据
Slug azure-flux-image-gen
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

FLUX.2-pro Image Generation 是什么?

Generate images using Black Forest Labs FLUX.2-pro via Azure AI Foundry. Use when asked to create, generate, or produce images, illustrations, photos, artwor... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 415 次。

如何安装 FLUX.2-pro Image Generation?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install azure-flux-image-gen」即可一键安装,无需额外配置。

FLUX.2-pro Image Generation 是免费的吗?

是的,FLUX.2-pro Image Generation 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

FLUX.2-pro Image Generation 支持哪些平台?

FLUX.2-pro Image Generation 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 FLUX.2-pro Image Generation?

由 zwcih(@zwcih)开发并维护,当前版本 v1.1.0。

💬 留言讨论