SuperAPI AI 工具集

openai-image-gen

设计与创作

查看项目

更新于 10-15 21:37

技能介绍

用途:这是一个批量图像生成脚本,调用 OpenAI Images API,可自动生成“随机但结构化”的提示词并渲染为图片,适合快速产出多张概念图或素材。

主要能力:支持 DALL-E 2、DALL-E 3 以及 GPT image 模型(gpt-image-1、gpt-image-1-mini、gpt-image-1.5)。脚本会根据所选模型自动选择合适默认参数。可指定提示词、数量、尺寸、质量、输出目录等。

使用方式:运行 python3 {baseDir}/scripts/gen.py,随后打开生成的 index.html 画廊。常用参数示例:--count 16 --model gpt-image-1;--prompt "..." --count 4;--size 1536x1024 --quality high --out-dir ./out/images;--model gpt-image-1.5 --background transparent --output-format webp。DALL-E 3 示例:--model dall-e-3 --quality hd --size 1792x1024 --style vivid。DALL-E 2 示例:--model dall-e-2 --size 512x512 --count 4。

参数差异:GPT image 模型尺寸支持 1024x1024、1536x1024、1024x1536、auto,质量支持 auto/high/medium/low,另支持 --background(transparent/opaque/auto)与 --output-format(png/jpeg/webp)。dall-e-3 尺寸为 1024x1024、1792x1024、1024x1792,质量为 hd/standard,支持 --style vivid/natural,且一次仅生成 1 张,脚本会自动将 count 限制为 1。dall-e-2 尺寸为 256x256、512x512、1024x1024,仅支持 standard 质量。

输出:图片文件(png/jpeg/webp)、prompts.json(提示词到文件的映射)以及 index.html 缩略图画廊。

限制:stream 与 moderation 参数虽在 API 中可用,但脚本尚未实现。其他收费、平台与效果信息暂未提供。