用途:通过 Frevana 的 AI Factory OpenAI 图像端点生成或编辑图像,返回校验后的 API 响应 JSON,主图地址取 data[0].image_url。
模型选择:用户显式指定 gpt-image-2.5-flare 或 gpt-image-2.5-sunburst 时遵从;否则多数请求用 Flare,适合快速迭代、社交/创作者内容、原型、视觉搜索、产品体验或大批量生成;当请求更看重精度而非延迟时用 Sunburst,如严格保留参考、受控或重复编辑、成品级营销素材、精修产品图、复杂版式或精确文字/细节。请求未明显需要 Sunburst 时用 Flare,除非速度与精度的取舍会实质影响结果,否则不要求用户选择。脚本省略 --model 时默认 Flare;代理选定 Sunburst 时应显式传入。
所需条件:用户提供的提示词或内容;可选参考输入 --image、--image-url、--image-dir、--mask;可选图像设置 n、size、quality、background、output_format、output_compression、moderation、input_fidelity;FREVANA_TOKEN 或单次 --token;可选 FREVANA_AGENT_APP_INSTANCE_ID,非空时作为 x-frevana-agent-app-instance-id 请求头发送;需要 curl、bash、python3。
执行:确认已提供提示词;按规则选模型并优先使用随附脚本;本地图用 --image,远程 URL 用 --image-url,目录用 --image-dir;--input-fidelity 仅用于编辑/参考图请求,需精确保留人脸、产品、文字等细节时用 high,否则省略;--moderation 仅用于无参考图的文生图;优先使用 FREVANA_TOKEN,非交互运行缺 token 时直接报告;返回原始 JSON,或用户只要首个托管 URL 时仅返回该 URL,可用 --output 保存 JSON。
选项:--model 为 gpt-image-2.5-flare 或 gpt-image-2.5-sunburst,默认 Flare;--n 为 1-10;--size 为 auto 或 WIDTHxHEIGHT,每边不超过 3840 且可被 16 整除,宽高比不超过 3:1,总像素 655360 至 8294400;--quality 为 auto、low、medium、high、xhigh、max;--background 为 auto、opaque、transparent,透明输出需 PNG 或 WebP;--output-format 为 png、jpeg、webp;--output-compression 为 1-100,仅 JPEG/WebP;--moderation 为 auto、low,仅生成;--input-fidelity 为 low、high,仅编辑/参考图;--image 可重复,本地 .png/.jpg/.jpeg/.webp 且小于 50MB;--image-url 可重复,远程 HTTP(S) 图,下载后上传且小于 50MB;--image-dir 可重复,递归加载本地目录,参考图总数最多 16;--mask 为可选本地 PNG 且小于 4MB,仅与参考图同用。超过 3686400 像素的分辨率为实验性,建议常用尺寸如 1024x1024、1536x1024、1024x1536、2048x2048、2048x1152、3840x2160、2160x3840。
命令示例:bash <skill-path>/scripts/generate_image.sh --prompt "A cinematic product photo of a matte black espresso machine on travertine" --size 2048x1152 --quality high --output-format png --output ./out/gpt-image-2.5-result.json;编辑示例:bash <skill-path>/scripts/generate_image.sh --model gpt-image-2.5-sunburst --prompt "Change only the label typography and preserve the product exactly" --image ./refs/product.png --input-fidelity high --quality xhigh --background transparent --output-format webp --output ./out/gpt-image-2.5-edit-result.json。
限制:后端路由固定为 POST /openai/image/generate,仅两个 GPT Image 2.5 模型 ID 可选;生成与编辑均必须提供提示词;不要改写、代理或转换返回的 Frevana 图像 URL,除非用户要求;脚本不实现流式或 partial_images,因为该端点当前只返回一个完成的 JSON 响应。