360 Secure SkillHub
360 安全技能中心

Image Generator

核心功能:支持调用DALL-E、Stable Diffusion等多AI模型,实现文本生图、图像变体、AI蒙版编辑,还可搭配风格预设优化效果。典型场景:生成插画/缩略图、修改现有图像、创建同款变体。通过命令行传参,输出图像文件及含路径的JSON结果,使用前需配置对应平台API密钥。

jpengcheng523-netizen
jpengcheng523-netizen
热度 41.77
最近更新 2026-05-11 17:35:58
分类:创作依赖:代码执行 / 第三方 API应用场景:图像生成

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add jpeng-image-generator
Metadata
name
jpeng-image-generator
description
AI image generation skill using DALL-E, Stable Diffusion, or Midjourney API. Generate, edit, and vary images from text prompts.
version
1.0.0
author
jpeng
tags
["image","ai","dalle","stable-diffusion","generation"]

Image Generator

Generate AI images using DALL-E, Stable Diffusion, or other providers.

When to Use

  • User wants to generate an image from text
  • Create variations of existing images
  • Edit images with AI inpainting
  • Generate thumbnails or illustrations

Configuration

# OpenAI DALL-E
export OPENAI_API_KEY="sk-xxx"

# Stability AI
export STABILITY_API_KEY="sk-xxx"

# Replicate (for SDXL, etc.)
export REPLICATE_API_TOKEN="r8_xxx"

Usage

Generate image

python3 scripts/generate_image.py \
  --prompt "A serene mountain landscape at sunset" \
  --size "1024x1024" \
  --output "./output.png"

Generate variations

python3 scripts/generate_image.py \
  --vary "./input.png" \
  --count 4 \
  --output-dir "./variations"

Edit image (inpainting)

python3 scripts/generate_image.py \
  --edit "./input.png" \
  --mask "./mask.png" \
  --prompt "Add a rainbow in the sky"

With style presets

python3 scripts/generate_image.py \
  --prompt "A futuristic city" \
  --style "cyberpunk" \
  --negative "blurry, low quality"

Output

{
  "success": true,
  "image_path": "./output.png",
  "revised_prompt": "A serene mountain landscape..."
}