generate-image by richardanaya/agent-skills
npx skills add https://github.com/richardanaya/agent-skills --skill generate-image除非另有明确说明,否则生成 1K 分辨率图像
不要创建 bash 脚本,只需按如下方式执行 curl 调用
我们的 FAL_KEY 应该位于 .env 文件中,如果不存在,请向用户询问
始终记得安全使用环境变量以防止泄露
source .env && curl --request POST
--url https://fal.run/fal-ai/nano-banana-pro
--header "Authorization: Key $FAL_KEY"
--header "Content-Type: application/json"
--data '{ "prompt": "" }'
如果需要编辑图像(使用参考图像和提示词)
source .env && curl --request POST
--url https://fal.run/fal-ai/nano-banana-pro/edit
--header "Authorization: Key $FAL_KEY"
--header "Content-Type: application/json"
--data '{ "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] }'
如果需要上传图像以获取 FAL.AI 可以访问的正确 URL,最好运行一些临时的 Python 代码
端点: https://rest.alpha.fal.ai/storage/auth/token?storage_type=fal-cdn-v3
POST https://rest.alpha.fal.ai/storage/auth/token?storage_type=fal-cdn-v3
:
:
// 空的 JSON 对象
:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Authorization: Key ${falKey}Accept: application/jsonContent-Type: application/json{}{
"base_upload_url": "https://v3.fal.media",
"token": "upload_token_here"
}
端点: ${base_upload_url}/files/upload (默认为 https://v3.fal.media/files/upload)
POST ${base_upload_url}/files/upload
请求头:
Authorization: Bearer ${upload_token}
Content-Type: image/png
X-Fal-File-Name: ${fileName}
请求体:
<raw file buffer>
响应示例:
{
"access_url": "https://...", // 或者
"url": "https://..."
}
prompt string 用于生成图像的文本提示词。
num_images integer 要生成的图像数量。默认值: 1
seed integer 随机数生成器的种子。
aspect_ratio AspectRatioEnum 生成图像的宽高比。默认值: "1:1" 可能的枚举值: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16
output_format OutputFormatEnum 生成图像的格式。默认值: "png" 可能的枚举值: jpeg, png, webp
sync_mode boolean 如果为 True,媒体将作为数据 URI 返回,并且输出数据将不会在请求历史记录中可用。
resolution ResolutionEnum 要生成的图像分辨率。默认值: "1K" 可能的枚举值: 1K, 2K, 4K
limit_generations boolean 实验性参数,用于将每轮提示的生成数量限制为 1。设置为 True 以忽略提示词中关于生成图像数量的任何指令。
enable_web_search boolean 为图像生成任务启用网络搜索。这将允许模型使用来自网络的最新信息来生成图像。
{
"prompt": "An action shot of a black lab swimming in an inground suburban swimming pool. The camera is placed meticulously on the water line, dividing the image in half, revealing both the dogs head above water holding a tennis ball in it's mouth, and it's paws paddling underwater.",
"num_images": 1,
"aspect_ratio": "1:1",
"output_format": "png",
"resolution": "1K"
}
81
1
2026年1月20日
opencode75
gemini-cli74
cursor72
codex72
github-copilot69
cline67
generate 1K unless explicitly told otherwise
don't make a bash script, just execute the curl call as follows
our FAL_KEY should be in .env , if it's not there, ask the user for it
always remember to safely utilize environment variables to prevent exposure
source .env && curl --request POST
--url https://fal.run/fal-ai/nano-banana-pro
--header "Authorization: Key $FAL_KEY"
--header "Content-Type: application/json"
--data '{ "prompt": "" }'
IF YOU NEED to edit an image (using reference images along with prompt)
source .env && curl --request POST
--url https://fal.run/fal-ai/nano-banana-pro/edit
--header "Authorization: Key $FAL_KEY"
--header "Content-Type: application/json"
--data '{ "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] }'
IF YOU NEED TO UPLOAD AN IMAGE TO GET A PROPER URL FAL.AI can see, it's probably best to run some ad hoc python
Two-Step Upload Process
Step 1: Get Upload Token
Endpoint: https://rest.alpha.fal.ai/storage/auth/token?storage_type=fal-cdn-v3
POST https://rest.alpha.fal.ai/storage/auth/token?storage_type=fal-cdn-v3
Headers:
Authorization: Key ${falKey}
Accept: application/json
Content-Type: application/json
Body:
{} // Empty JSON object
Response:
{
base_upload_url: https://v3.fal.media,
token: upload_token_here
}
Step 2: Upload File
Endpoint: ${base_upload_url}/files/upload (defaults to https://v3.fal.media/files/upload)
POST ${base_upload_url}/files/upload
Headers:
Authorization: Bearer ${upload_token}
Content-Type: image/png
X-Fal-File-Name: ${fileName}
Body:
<raw file buffer>
Response:
{
access_url: https://..., // or
url: https://...
}
Other properties
prompt string The text prompt to generate an image from.
num_images integer The number of images to generate. Default value: 1
seed integer The seed for the random number generator.
aspect_ratio AspectRatioEnum The aspect ratio of the generated image. Default value: "1:1"
Possible enum values: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16
output_format OutputFormatEnum The format of the generated image. Default value: "png"
Possible enum values: jpeg, png, webp
sync_mode boolean If True, the media will be returned as a data URI and the output data won't be available in the request history.
resolution ResolutionEnum The resolution of the image to generate. Default value: "1K"
Possible enum values: 1K, 2K, 4K
limit_generations boolean Experimental parameter to limit the number of generations from each round of prompting to 1. Set to True to to disregard any instructions in the prompt regarding the number of images to generate.
enable_web_search boolean Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image.
{ "prompt": "An action shot of a black lab swimming in an inground suburban swimming pool. The camera is placed meticulously on the water line, dividing the image in half, revealing both the dogs head above water holding a tennis ball in it's mouth, and it's paws paddling underwater.", "num_images": 1, "aspect_ratio": "1:1", "output_format": "png", "resolution": "1K" }
Weekly Installs
81
Repository
GitHub Stars
1
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
opencode75
gemini-cli74
cursor72
codex72
github-copilot69
cline67
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
67,500 周安装