重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
generate-image by k-dense-ai/claude-scientific-skills
npx skills add https://github.com/k-dense-ai/claude-scientific-skills --skill generate-image使用 OpenRouter 的图像生成模型(包括 FLUX.2 Pro 和 Gemini 3.1 Flash Image Preview)生成和编辑高质量图像。
使用 generate-image 用于:
使用 scientific-schematics 替代用于:
使用 scripts/generate_image.py 脚本来生成或编辑图像:
# 生成新图像
python scripts/generate_image.py "山上的美丽日落"
# 编辑现有图像
python scripts/generate_image.py "让天空变成紫色" --input photo.jpg
这将在当前目录中生成/编辑图像并将其保存为 generated_image.png。
重要:脚本需要 OpenRouter API 密钥。运行前,请检查用户是否已配置其 API 密钥:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.env 文件.env 文件中是否有 OPENROUTER_API_KEY=<key>OPENROUTER_API_KEY=your-api-key-here 的 .env 文件export OPENROUTER_API_KEY=your-api-key-here脚本将自动检测 .env 文件,并在 API 密钥缺失时提供清晰的错误信息。
默认模型:google/gemini-3.1-flash-image-preview(高质量,推荐)
可用于生成和编辑的模型:
google/gemini-3.1-flash-image-preview - 高质量,支持生成 + 编辑black-forest-labs/flux.2-pro - 快速,高质量,支持生成 + 编辑仅用于生成:
black-forest-labs/flux.2-flex - 快速且便宜,但质量不如 pro 版根据以下条件选择:
python scripts/generate_image.py "您的提示词"
python scripts/generate_image.py "太空中的猫" --model "black-forest-labs/flux.2-pro"
python scripts/generate_image.py "抽象艺术" --output artwork.png
python scripts/generate_image.py "让背景变成蓝色" --input photo.jpg
python scripts/generate_image.py "给人添加太阳镜" --input portrait.png --model "black-forest-labs/flux.2-pro"
python scripts/generate_image.py "移除图像中的文字" --input screenshot.png --output cleaned.png
使用不同的提示词或输出路径多次运行脚本:
python scripts/generate_image.py "图像 1 描述" --output image1.png
python scripts/generate_image.py "图像 2 描述" --output image2.png
prompt(必需):要生成的图像的文本描述,或编辑指令--input 或 -i:用于编辑的输入图像路径(启用编辑模式)--model 或 -m:OpenRouter 模型 ID(默认:google/gemini-3.1-flash-image-preview)--output 或 -o:输出文件路径(默认:generated_image.png)--api-key:OpenRouter API 密钥(覆盖 .env 文件)# 为论文生成概念插图
python scripts/generate_image.py "免疫治疗剂攻击癌细胞的显微视图,科学插图风格" --output figures/immunotherapy_concept.png
# 为演示文稿创建视觉内容
python scripts/generate_image.py "DNA 双螺旋结构,突出显示突变位点,现代科学可视化" --output slides/dna_mutation.png
# 标题幻灯片背景
python scripts/generate_image.py "抽象蓝白背景,带有微妙的分子图案,专业演示风格" --output slides/background.png
# 海报主图
python scripts/generate_image.py "配备现代设备的实验室环境,逼真,光线良好" --output poster/hero.png
# 网站或文档图像
python scripts/generate_image.py "专业团队围绕数字白板协作,现代办公室" --output docs/team_collaboration.png
# 营销材料
python scripts/generate_image.py "未来主义 AI 大脑概念,带有发光的神经网络" --output marketing/ai_concept.png
脚本为以下情况提供清晰的错误信息:
如果脚本失败,请阅读错误信息并在重试前解决问题。
images 和 content 响应格式每周安装数
56
代码仓库
GitHub 星标数
17.3K
首次出现
2026 年 1 月 20 日
安全审计
已安装于
opencode49
codex48
gemini-cli47
claude-code45
cursor45
github-copilot44
Generate and edit high-quality images using OpenRouter's image generation models including FLUX.2 Pro and Gemini 3.1 Flash Image Preview.
Use generate-image for:
Use scientific-schematics instead for:
Use the scripts/generate_image.py script to generate or edit images:
# Generate a new image
python scripts/generate_image.py "A beautiful sunset over mountains"
# Edit an existing image
python scripts/generate_image.py "Make the sky purple" --input photo.jpg
This generates/edits an image and saves it as generated_image.png in the current directory.
CRITICAL : The script requires an OpenRouter API key. Before running, check if the user has configured their API key:
.env file in the project directory or parent directoriesOPENROUTER_API_KEY=<key> in the .env file.env file with OPENROUTER_API_KEY=your-api-key-hereexport OPENROUTER_API_KEY=your-api-key-hereThe script will automatically detect the .env file and provide clear error messages if the API key is missing.
Default model : google/gemini-3.1-flash-image-preview (high quality, recommended)
Available models for generation and editing :
google/gemini-3.1-flash-image-preview - High quality, supports generation + editingblack-forest-labs/flux.2-pro - Fast, high quality, supports generation + editingGeneration only :
black-forest-labs/flux.2-flex - Fast and cheap, but not as high quality as proSelect based on:
python scripts/generate_image.py "Your prompt here"
python scripts/generate_image.py "A cat in space" --model "black-forest-labs/flux.2-pro"
python scripts/generate_image.py "Abstract art" --output artwork.png
python scripts/generate_image.py "Make the background blue" --input photo.jpg
python scripts/generate_image.py "Add sunglasses to the person" --input portrait.png --model "black-forest-labs/flux.2-pro"
python scripts/generate_image.py "Remove the text from the image" --input screenshot.png --output cleaned.png
Run the script multiple times with different prompts or output paths:
python scripts/generate_image.py "Image 1 description" --output image1.png
python scripts/generate_image.py "Image 2 description" --output image2.png
prompt (required): Text description of the image to generate, or editing instructions--input or -i: Input image path for editing (enables edit mode)--model or -m: OpenRouter model ID (default: google/gemini-3.1-flash-image-preview)--output or -o: Output file path (default: generated_image.png)--api-key: OpenRouter API key (overrides .env file)# Generate a conceptual illustration for a paper
python scripts/generate_image.py "Microscopic view of cancer cells being attacked by immunotherapy agents, scientific illustration style" --output figures/immunotherapy_concept.png
# Create a visual for a presentation
python scripts/generate_image.py "DNA double helix structure with highlighted mutation site, modern scientific visualization" --output slides/dna_mutation.png
# Title slide background
python scripts/generate_image.py "Abstract blue and white background with subtle molecular patterns, professional presentation style" --output slides/background.png
# Poster hero image
python scripts/generate_image.py "Laboratory setting with modern equipment, photorealistic, well-lit" --output poster/hero.png
# Website or documentation images
python scripts/generate_image.py "Professional team collaboration around a digital whiteboard, modern office" --output docs/team_collaboration.png
# Marketing materials
python scripts/generate_image.py "Futuristic AI brain concept with glowing neural networks" --output marketing/ai_concept.png
The script provides clear error messages for:
If the script fails, read the error message and address the issue before retrying.
images and content response formats from different OpenRouter modelsWeekly Installs
56
Repository
GitHub Stars
17.3K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode49
codex48
gemini-cli47
claude-code45
cursor45
github-copilot44
AI界面设计评审工具 - 全面评估UI/UX设计质量、检测AI生成痕迹与优化用户体验
58,500 周安装