ChatGPT Image Generation
Generate images using ChatGPT's DALL-E integration through OpenClaw browser automation.
Prerequisites
- 1. Chrome Extension Installation:
- Install OpenClaw Browser Relay from Chrome Web Store
- Or use the extension that comes with OpenClaw
- 2. Initial Setup (one-time):
- Open ChatGPT (chatgpt.com) in Chrome/Brave
- Login to your ChatGPT account (Pro subscription recommended for best quality)
- Click the OpenClaw extension icon on the ChatGPT tab to attach it
- The badge should show "ON" when attached
How It Works
This skill uses OpenClaw's built-in browser tool with Chrome extension relay (profile="chrome") to control an already-logged-in ChatGPT tab. This bypasses ChatGPT's bot detection because it uses your real browser session.
CLI Command Reference
IMPORTANT: There is NO browser act subcommand. Each action is a direct subcommand.
| Action | CLI Syntax |
|---|
| List tabs | INLINECODE3 |
| Snapshot |
openclaw browser snapshot --target-id <ID> |
| Click |
openclaw browser click <ref> --target-id <ID> |
| Type |
openclaw browser type <ref> "<text>" --target-id <ID> |
| Press key |
openclaw browser press <key> --target-id <ID> |
| Navigate |
openclaw browser navigate <url> --target-id <ID> |
| Screenshot |
openclaw browser screenshot --target-id <ID> |
- -
<ref> and <text> are positional arguments (no --ref flag) - INLINECODE13 accepts a full ID or unique prefix (e.g.
77CB instead of 77CB8A574E8A44861C5FE49388EF6ABC) - INLINECODE16 is a parent option on
openclaw browser, not on subcommands
Workflow
1. List Attached Tabs
CODEBLOCK0
Look for a tab with URL containing chatgpt.com. Note the targetId.
2. Get Snapshot (find element refs)
CODEBLOCK1
This outputs a tree with refs like e23, e589, etc. Always run snapshot before interacting.
3. Click an Element
CODEBLOCK2
4. Type Text
CODEBLOCK3
Add --submit to press Enter after typing:
CODEBLOCK4
5. Press a Key
CODEBLOCK5
6. Wait for Generation
Use sleep to wait for DALL-E to generate (30-60 seconds):
CODEBLOCK6
Then take a new snapshot to check the result:
CODEBLOCK7
Complete Example Session
CODEBLOCK8
Troubleshooting
"Can't reach the OpenClaw browser control service":
- - Gateway restart needed: INLINECODE24
- Or restart via OpenClaw menu bar app
"Chrome extension relay is running, but no tab is connected":
- - ChatGPT tab is not attached
- Go to the ChatGPT tab and click the OpenClaw extension icon
"ref is required" error:
- - You need to specify which element to interact with
- Run
snapshot first to get the refs
Command not found / Unknown command:
- - Do NOT use
browser act — use direct subcommands: browser click, browser type, INLINECODE29 - ref is a positional argument:
browser click e23, NOT INLINECODE31
Image generation timeout:
- - DALL-E generation takes 30-60 seconds
- Use
sleep 45 then re-snapshot to check
Bot detection / Login issues:
- - The tab must be already logged in via your real browser
- Use the Chrome extension relay (attached tab), not the isolated browser
Tips
- 1. Keep ChatGPT tab open: Once attached, keep the tab open for future use
- Check targetId: The targetId changes if you close/reopen the tab — always run
tabs first - Use
--submit: The type command supports --submit to press Enter automatically - Unique prefix:
--target-id accepts a unique prefix, no need for the full 32-char ID - Pro subscription: ChatGPT Pro gives better image quality and faster generation
Security Note
This approach uses your actual Chrome browser session, so it inherits all your ChatGPT permissions and settings. No credentials are stored or transmitted - everything happens in your existing browser session.
ChatGPT 图像生成
通过 OpenClaw 浏览器自动化,利用 ChatGPT 的 DALL-E 集成生成图像。
前置条件
- 1. Chrome 扩展安装:
- 从 Chrome 网上应用店安装 OpenClaw Browser Relay
- 或使用 OpenClaw 自带的扩展
- 2. 初始设置(一次性):
- 在 Chrome/Brave 中打开 ChatGPT(chatgpt.com)
- 登录你的 ChatGPT 账户(推荐使用 Pro 订阅以获得最佳质量)
- 在 ChatGPT 标签页上点击 OpenClaw 扩展图标进行附加
- 附加成功后徽章应显示ON
工作原理
此技能使用 OpenClaw 内置的 browser 工具,配合 Chrome 扩展中继(profile=chrome)来控制已登录的 ChatGPT 标签页。由于使用的是真实浏览器会话,因此可以绕过 ChatGPT 的机器人检测。
CLI 命令参考
重要提示: 没有 browser act 子命令。每个操作都是直接子命令。
| 操作 | CLI 语法 |
|---|
| 列出标签页 | openclaw browser tabs |
| 快照 |
openclaw browser snapshot --target-id
|
| 点击 | openclaw browser click [ --target-id |]
| 输入 | openclaw browser type [ --target-id |]
| 按键 | openclaw browser press --target-id |
| 导航 | openclaw browser navigate --target-id |
| 截图 | openclaw browser screenshot --target-id |
- -
[ 和 是位置参数(无 --ref 标志)] - --target-id 接受完整 ID 或唯一前缀(例如,使用 77CB 代替 77CB8A574E8A44861C5FE49388EF6ABC)
- --profile 是 openclaw browser 的父选项,而非子命令
工作流程
1. 列出已附加的标签页
bash
openclaw browser tabs
查找 URL 包含 chatgpt.com 的标签页。记下 targetId。
2. 获取快照(查找元素引用)
bash
openclaw browser snapshot --target-id --format ai --efficient
这将输出一个包含 e23、e589 等引用的树结构。在交互前务必先运行快照。
3. 点击元素
bash
openclaw browser click e23 --target-id
4. 输入文本
bash
openclaw browser type e589 生成一张图片:日落时的未来城市 --target-id
添加 --submit 可在输入后按回车:
bash
openclaw browser type e589 生成一张图片:一只猫在玩滑板 --target-id --submit
5. 按键
bash
openclaw browser press Enter --target-id
6. 等待生成
使用 sleep 等待 DALL-E 生成(30-60 秒):
bash
sleep 45
然后拍摄新的快照检查结果:
bash
openclaw browser snapshot --target-id --format ai --efficient
完整示例会话
bash
1. 列出标签页,找到 ChatGPT 标签页的 targetId
openclaw browser tabs
2. 拍摄快照查找元素引用
openclaw browser snapshot --target-id 4535E --format ai --efficient
3. 点击输入框(从快照中检查引用,通常标记为Ask anything)
openclaw browser click e589 --target-id 4535E
4. 输入提示词并提交
openclaw browser type e589 生成一张图片:日落时的未来城市 --target-id 4535E --submit
5. 等待 DALL-E 生成
sleep 45
6. 拍摄新快照查看结果并找到下载按钮
openclaw browser snapshot --target-id 4535E --format ai --efficient
7. 点击下载按钮(引用来自新快照)
openclaw browser click e745 --target-id 4535E
故障排除
无法访问 OpenClaw 浏览器控制服务:
- - 需要重启网关:openclaw gateway restart
- 或通过 OpenClaw 菜单栏应用重启
Chrome 扩展中继正在运行,但没有标签页连接:
- - ChatGPT 标签页未附加
- 转到 ChatGPT 标签页并点击 OpenClaw 扩展图标
需要 ref 错误:
- - 需要指定要交互的元素
- 先运行 snapshot 获取引用
命令未找到 / 未知命令:
- - 不要使用 browser act — 使用直接子命令:browser click、browser type、browser press
- ref 是位置参数:browser click e23,而不是 browser click --ref e23
图像生成超时:
- - DALL-E 生成需要 30-60 秒
- 使用 sleep 45 然后重新快照检查
机器人检测 / 登录问题:
- - 标签页必须已通过真实浏览器登录
- 使用 Chrome 扩展中继(已附加的标签页),而非隔离浏览器
提示
- 1. 保持 ChatGPT 标签页打开: 附加后,保持标签页打开以备后续使用
- 检查 targetId: 关闭/重新打开标签页时 targetId 会变化 — 始终先运行 tabs
- 使用 --submit: type 命令支持 --submit 自动按回车
- 唯一前缀: --target-id 接受唯一前缀,无需完整的 32 位 ID
- Pro 订阅: ChatGPT Pro 提供更好的图像质量和更快的生成速度
安全说明
此方法使用你实际的 Chrome 浏览器会话,因此继承了你所有的 ChatGPT 权限和设置。不会存储或传输任何凭据——一切都在你现有的浏览器会话中进行。