fal-image-gen
使用fal.ai Nano Banana Pro模型生成AI图像。当(1)用户请求图像生成或创作,(2)用户需要AI生成的视觉内容用于网站、产品或营销,(3)用户要求用AI创建插图、照片或艺术品,(4)用户提及生成图像、创建图片、AI图像等类似请求时使用此技能。支持多种宽高比,最高分辨率可达4K,并支持多种输出格式。
📖 中文导读:使用fal.ai Nano Banana Pro模型生成AI图像。当(1)用户请求图像生成或创作,(2)用户需要AI生成的视觉内容用于网站、产品或营销,(3)用户要求用AI创建插图、照片或艺术品,(4)用户提及生成图像、创建图片、AI图像等类似请求时使用此技能。支持多种宽高比,最高分辨率可达4K,并支持多种输出格式。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: fal-image-gen description: "Generate AI images using fal.ai Nano Banana Pro model. Use this skill when (1) User requests image generation or creation, (2) User wants AI-generated visuals for websites, products, or marketing, (3) User asks to create illustrations, photos, or artwork with AI, (4) User mentions generate image, create picture, AI image, or similar requests. Supports various aspect ratios, resolutions up to 4K, and multiple output formats."
fal.ai Image Generation (Nano Banana Pro)
Generate high-quality AI images using fal.ai's Nano Banana Pro model.
Prerequisites
Requires FALAI_KEY environment variable with valid fal.ai API key (also supports FAL_KEY as fallback).
Quick Start
node scripts/generate_image.js "Your prompt here" -o output.png
Script Usage
Basic:
node scripts/generate_image.js "A sunset over mountains" -o sunset.png
With options:
node scripts/generate_image.js "Product photo" -o product.png \
--aspect-ratio 4:3 \
--resolution 2K \
--format png
Multiple images:
node scripts/generate_image.js "Abstract art" -o art.png --num-images 4
Parameters
| Parameter | Values | Default | Description |
|---|---|---|---|
--aspect-ratio |
21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 | 1:1 | Image dimensions |
--resolution |
1K, 2K, 4K | 1K | Output resolution |
--format |
png, jpeg, webp | png | File format |
--num-images |
1-4 | 1 | Images per request |
Recommended Aspect Ratios by Use Case
- Website hero/banner: 16:9 or 21:9
- Social media post: 1:1 or 4:5
- Product image: 4:3 or 1:1
- Portrait/Story: 9:16
- Print material: 3:2 or 4:3
Prompting Tips
- Be specific: Include details about subject, style, lighting, composition
- Photography style: Add "professional photo", "studio lighting", "product photography"
- Art style: Specify "oil painting", "watercolor", "digital art", "minimalist"
- Quality modifiers: "high detail", "sharp focus", "4K", "professional"
Example prompts:
"Professional product photo of wireless headphones on white background, studio lighting, sharp focus""Modern minimalist logo design for tech startup, clean lines, blue and white color scheme""Hero image for e-commerce website, lifestyle photo of person using laptop, warm natural lighting"
Programmatic Usage
const { generateImage } = require("./scripts/generate_image.js");
const result = await generateImage({
prompt: "Your description",
outputPath: "image.png",
aspectRatio: "16:9",
resolution: "2K",
});
if (result.success) {
console.log(`Saved to: ${result.images}`);
} else {
console.log(`Error: ${result.error}`);
}
Output
- Images saved to specified path
- Multiple images:
name_1.png,name_2.png, etc. - Returns object with
success,images(paths),description