360 Secure SkillHub
360 安全技能中心

Cloudflare Image Generation

通过 scripts/generate_image.py 调用 Cloudflare Workers AI 的 flux-1-schnell 模型,把文本提示词生成 PNG 图片并返回文件路径;需使用 SKILL.md 中硬编码的 Account ID 与 Token 访问 api.cloudflare.com,图片需由调用方发送给用户(原文提到 Telegram)。

expysf98
expysf98
热度 91.55
最近更新 2026-05-18 12:06:28
分类:创作依赖:代码执行 / 第三方 API应用场景:图像生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cloudflare-image-gen
Metadata
name
cloudflare-image-gen
description
Generate images using Cloudflare Workers AI flux-1-schnell model. Use when user requests image generation with text-to-image using Cloudflare Workers API.

Cloudflare Image Generation

This skill generates images using Cloudflare Workers AI @cf/black-forest-labs/flux-1-schnell model.

Credentials

  • Account ID: 1e89d3ce76cbfef3b5c340e3984b7a52
  • Token: aCTA2KaKa1n3ayFDL-LPmZ-JgUC0HHgA5Msy18Bk
  • Model: @cf/black-forest-labs/flux-1-schnell

Usage

Run the script directly:

python3 /home/ubuntu/.openclaw/workspace/skills/cloudflare-image-gen/scripts/generate_image.py "your prompt here" -o output.png

Or use the Python function:

import sys
sys.path.insert(0, '/home/ubuntu/.openclaw/workspace/skills/cloudflare-image-gen/scripts')
from generate_image import generate_image

output_path = generate_image("a black horse")

Output

The script saves the generated image as PNG and returns the file path. Send the image to the user via Telegram.