360 Secure SkillHub
360 安全技能中心

ChatGPT web image generation with domain-aware prompts

先检查 ChatGPT 网页登录状态,再用领域六轴把粗略想法扩写成 60–120 词英文提示词;加 --yes 后在 Ego Lite 浏览器中发送一次并回读保存图片。离线可只做扩写;缺 ego-browser 或未登录时退出码 2 并停止;作者注明未在真实页面验收。

分类:创作
terryso
terryso
热度 1.99
最近更新 2026-11-29 19:07:15

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add terryso/ego-chatgpt-image-gen
兼容性
Ego 专属
联网要求
需要联网
数据出网
必须出网
Metadata
name
chatgpt-image-gen
slug
ego-chatgpt-image-gen
displayName
Ego ChatGPT 生图
display_name_en
ChatGPT web image generation with domain-aware prompts
description
Expand a rough image idea with the six-axis domain engine from codex-imagegen, then create one image on the free ChatGPT website inside Ego Lite. Login-check first. Soft-fail with exit 2 when ego-browser is missing, chatgpt.com is logged out, or login cannot be proven. enrich and generate without --yes are offline. --yes sends one prompt and saves the image to --out. Flowcharts and timelines are SVG, not images. Does not call codex exec and does not use an API key. Use when the user asks to generate an image, enrich a prompt, or use ChatGPT Images without a Codex subscription.
metadata
{"version":"0.1.0","requires":{"bins":["ego-browser","node"]},"ego":{"min_skill_guide":"2.1.0"},"parity":{"upstream":"codex-imagegen 1.0.4 (MIT)"}}

chatgpt-image-gen

用 Ego Lite 里已经登录的 ChatGPT 网页生成一张图。扩写沿用 codex-imagegen 1.0.4 的领域六轴。生成不走 Codex CLI,也不读 API key。

Create one image on the logged-in ChatGPT website. Enrichment is the domain engine from codex-imagegen 1.0.4. Generation is https://chatgpt.com/ in Ego, not codex exec.

质量杠杆仍是:生图质量 = 模型 × 提示词信息密度。把粗略想法沿六个轴补足,再交给网页里的 ChatGPT Images。免费档的模型、额度和入口以 references/limitations.md 为准。

扩写

先看 references/。命中领域就用该文件的方向;没有就用通用六轴;机制、流程、对比、时间线不要生图,改画带文字的 SVG(references/diagram.md)。

  1. 主体 — 名词变成正在发生的动作或状态
  2. 环境 — 前景、中景、背景
  3. 光影 — 光源、方向、色温
  4. 细节 — 至少三个值得第二眼看的点
  5. 风格 — 一种媒介,贯穿全图
  6. 约束 — 画幅、配色、禁长句

英文提示词 60–120 词,顺序是主体、构图、环境、光影、风格、配色、约束。用户给出的主体、风格、配色只加不改。画面里不要长句子;UI 稿只允许很短的界面文字。logo 的生产文件应是 SVG,脚本仍可出一张气质探索图。

把用户的原话传给脚本。不要先扩写再当作 --idea,否则骨架会套两次。

登录

node skills/chatgpt-image-gen/scripts/check-login.mjs
node skills/chatgpt-image-gen/scripts/check-login.mjs --keep

已登录的唯一正信号是账号控件(推断的无障碍名称,见 references/login.md)。只有输入框不算登录:帮助中心写明,未登录时发送提示词仍可能要求登录。对不上就退出 2,不要猜。

退出码 含义 Agent 做什么
0 已登录 告诉用户 login_tip,继续
2 未登录、无法证明登录,或没有 ego-browser 展示 how_to_login,停
3 扩写已打印,没有发送 给人看提示词和 --out
1 参数、页面或生成失败 报告 JSON error,不要假装已保存

不要代填密码,不要粘贴 Cookie,不要导出会话。

命令

node skills/chatgpt-image-gen/scripts/enrich.mjs --idea "a ceramic cup" --domain photo
node skills/chatgpt-image-gen/scripts/generate.mjs \
  --idea "a ceramic cup" --out /absolute/path/to/image.png
node skills/chatgpt-image-gen/scripts/generate.mjs \
  --idea "a ceramic cup" --style "risograph print" --palette "olive and cream" \
  --aspect 3:2 --out /absolute/path/to/image.png --yes
node skills/chatgpt-image-gen/scripts/cleanup.mjs
命令 浏览器
enrich 不开。退出码 0 只表示本地提示词有效
generate 不加 --yes 不开。退出码 3
generate --yes 登录通过后发送一次。成功是 --out 里的图片字节
流程图 / 时间线 不开。generate 为 false,去画 SVG
--publish 没有这个开关

--yes 才是发送同意。默认等待 180 秒(--timeout-ms)。限流、拒绝、超时、下载失败都不是成功,也不会自动重试。

成功不是模型说它画好了,也不是点到了 Save。回读必须是一个新的图片元素,地址在允许的主机上,字节是 png、jpeg、webp 或 gif,并且和 --out 的扩展名一致。Save 按钮的本机下载目录观察不到,所以脚本不用它。

细节见 references/inputs.md、references/limitations.md、references/states.md。本机验收见 references/acceptance.md。这一版没有在真实 ChatGPT 页面上跑过。

测试

npm test

单测不打开 chatgpt.com,也不使用真实登录态。单测通过不能当作线上验收。

领域文稿来自 MIT 的 codex-imagegen 1.0.4。某个领域被验收通过且还没有 reference 时,同时补 references/<id>.md 和 scripts/lib/domains.mjs。