Token导航 LogoToken导航TokenDH.com
图像处理external-servicegithub未标认证来源可访问clear审计通过

generate-image生成图像

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

2,060

周安装

85

GitHub Stars

1

下载量

673
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:generate-image(生成图像)
来源仓库:https://github.com/richardanaya/agent-skills
仓库路径:skills/generate-image
安装命令:
npx skills add https://github.com/richardanaya/agent-skills --skill generate-image
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/richardanaya/agent-skills --skill generate-image

简介

用于辅助图像生成与视觉素材处理,支持根据文本生成图片或编辑背景。

  • 适合在内容创作、原型设计或演示准备中调用图像模型工作流。
  • 通过 npx skills add 命令安装,需确认输入图片版权、输出格式与模型限制。
  • 涉及人物、品牌或公开展示素材时,应额外核对授权与内容合规性。
  • generate-image 属于图像处理类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Generate Image Skill

Description

Generate images using xAI's Grok Imagine through the fal.ai MCP gateway. This skill enables text-to-image generation with detailed prompts for photorealistic, artistic, and stylized outputs.

When to Use

Use this skill when the user wants to:

  • Generate images from text descriptions
  • Create illustrations, artwork, or visual content
  • Use AI image generation tools
  • Produce concept art, portraits, scenes, or abstract imagery

Prerequisites

Ensure MCP servers are connected and the fal.ai server is available:

mcp({})  // Check server status

Input Schema

ParameterTypeRequiredDefaultDescription
promptstringYes-Text description of the desired image
num_imagesintegerNo1Number of images to generate
aspect_ratioAspectRatioEnumNo"1:1"Aspect ratio of the generated image
output_formatOutputFormatEnumNo"jpeg"Format of the generated image
sync_modebooleanNofalseIf true, returns media as data URI

AspectRatioEnum Values

ValueDescription
"2:1"Ultra-wide panorama
"20:9"Cinematic ultra-wide
"19.5:9"Mobile ultra-wide
"16:9"HD widescreen (video standard)
"4:3"Classic display ratio
"3:2"Photo print ratio
"1:1"Square (default)
"2:3"Portrait photo
"3:4"Portrait display
"9:16"Mobile vertical
"9:19.5"Mobile tall
"9:20"Mobile ultra-tall
"1:2"Vertical panorama

OutputFormatEnum Values

ValueDescription
"jpeg"JPEG format (default, best compression)
"png"PNG format (lossless, transparency support)
"webp"WebP format (modern web optimized)

Output Schema

FieldTypeDescription
imageslistArray of generated image objects
revised_promptstringThe enhanced prompt used by the model

ImageFile Object

FieldTypeDescription
urlstringThe URL of the generated image

Tools

1. Search for Image Generation Models

First, verify the available image generation models:

mcp({
  search: "image generation",
  server: "fal"
})

Or specifically search for Grok:

mcp({
  search: "grok",
  server: "fal"
})

2. Generate Image

Use the fal_run_model tool with the xai/grok-imagine-image endpoint:

mcp({
  tool: "fal_run_model",
  server: "fal",
  args: {
    "endpoint_id": "xai/grok-imagine-image",
    "input": {
      "prompt": "Your detailed image description here",
      "num_images": 1,
      "aspect_ratio": "1:1",
      "output_format": "jpeg"
    }
  }
})

3. Display the Image

After generation, display the image to the user:

show_image({
  url: "https://v3b.fal.media/files/.../image.jpg"
})

Or for local files:

show_image({
  path: "/path/to/local/image.png"
})

Example Request

{
  "prompt": "Abstract human silhouette, golden particles ready to burst outward representing joy, data visualization style, emotional expression through particles, artistic scientific",
  "num_images": 1,
  "aspect_ratio": "1:1",
  "output_format": "jpeg"
}

Example Response

{
  "images": [
    {
      "url": "https://v3b.fal.media/files/b/0a8b90b7/9avg_nKJmcVinjQHJR_Ja.jpg"
    }
  ],
  "revised_prompt": ""
}

Best Practices

Writing Effective Prompts

  1. Be specific: Include subject, style, lighting, mood, and quality descriptors
  2. Use artistic references: "cinematic lighting", "photorealistic", "oil painting", "anime style"
  3. Specify technical quality: "8k resolution", "highly detailed", "sharp focus"
  4. Describe composition: "close-up portrait", "wide landscape", "aerial view"
  5. Include mood/atmosphere: "dramatic", "serene", "futuristic", "vintage"

Example Prompts by Category

Portraits:

Portrait of a wise elderly wizard with flowing white beard, wearing intricate
blue robes embroidered with silver stars, mystical library background, warm
candlelight, highly detailed face, 8k, photorealistic

Sci-Fi:

Futuristic cyberpunk city at night, neon signs in Japanese, flying cars, rain
streets reflecting lights, towering holographic advertisements, blade runner
style, cinematic composition, 8k quality

Nature:

Majestic snow-capped mountains at golden hour, crystal clear alpine lake with
reflection, pine forest in foreground, dramatic clouds, landscape photography
style, ultra detailed, 8k resolution

Abstract:

Abstract human silhouette, golden particles ready to burst outward representing
joy, data visualization style, emotional expression through particles,
artistic scientific

Characters (e.g., Ferengi):

A Star Trek Ferengi alien, humanoid with large ears, wrinkled forehead, sharp
teeth grin, wearing traditional Ferengi business attire with dark tunic and
collared shirt, standing in a sci-fi alien marketplace, detailed facial features,
dramatic lighting, cinematic quality, 8k resolution, photorealistic

Complete Workflow Example

Here's the full workflow for generating and displaying an image:

// Step 1: Generate the image
const result = await mcp({
  tool: "fal_run_model",
  server: "fal",
  args: {
    "endpoint_id": "xai/grok-imagine-image",
    "input": {
      "prompt": "A serene Japanese zen garden with raked sand patterns, moss-covered stones, cherry blossom tree in bloom, morning mist, tranquil atmosphere, traditional wooden pagoda in background, ultra detailed, 8k, photorealistic",
      "num_images": 1,
      "aspect_ratio": "16:9",
      "output_format": "jpeg"
    }
  }
});

// Step 2: Extract the image URL
const imageUrl = result.result.images[0].url;

// Step 3: Display to user
show_image({
  url: imageUrl
});

Troubleshooting

IssueSolution
Model not foundRun mcp({search: "grok", server: "fal"}) to verify endpoint
Connection errorCheck MCP status with mcp({}) and reconnect
Poor image qualityAdd more specific descriptors to prompt
Wrong aspect ratioUse "1:1", "16:9", "9:16", "4:3", or "3:4"
Generation timeoutTry simpler prompt or check fal.ai status
Sync mode not workingSet "sync_mode": true for data URI output

Alternative Models

If Grok Imagine is unavailable, search for alternatives:

mcp({
  search: "flux",
  server: "fal"
})

Popular alternatives:

  • fal-ai/flux-2-pro - High quality, detailed images
  • fal-ai/flux/dev - Fast generation, good quality
  • fal-ai/flux-1/schnell - Fastest inference

Notes

  • Generated images are hosted temporarily on fal.media
  • Image URLs are valid for a limited time (typically 24-48 hours)
  • Save images locally if permanent storage is needed
  • Be mindful of content policies when generating images
  • The revised_prompt field may contain an enhanced version of your prompt

适合场景

01

文本生成图片

02

图片风格化

03

产品图和创意图

04

需要 FLUX 模型时

能力概览

能力 1

调用 FLUX 图像模型

能力 2

支持文本生图和图像改写

能力 3

覆盖 LoRA 或风格适配

能力 4

适合创意视觉生成

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.9%
按下载量换算194

OpenCode

25.93%
按下载量换算175

Antigravity

18.88%
按下载量换算127

Gemini CLI

12.06%
按下载量换算81

Codex

8.12%
按下载量换算55

trae

3.74%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills