← Back to Skills Marketplace
zwcih

FLUX.2-pro Image Generation

by zwcih · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
415
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install azure-flux-image-gen
Description
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...
README (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.

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install azure-flux-image-gen
  3. After installation, invoke the skill by name or use /azure-flux-image-gen
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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
Metadata
Slug azure-flux-image-gen
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 415 downloads so far.

How do I install FLUX.2-pro Image Generation?

Run "/install azure-flux-image-gen" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is FLUX.2-pro Image Generation free?

Yes, FLUX.2-pro Image Generation is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does FLUX.2-pro Image Generation support?

FLUX.2-pro Image Generation is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created FLUX.2-pro Image Generation?

It is built and maintained by zwcih (@zwcih); the current version is v1.1.0.

💬 Comments