chatgpt-image-generation
// Generate and download images from chatgpt.com using Playwright automation. Opens chatgpt.com in a new chat, types prompts, waits for bulletproof generation completion detection, downloads via hover+download button, then processes next or stops.
$ git log --oneline --stat
stars:1,933
forks:367
updated:March 4, 2026
SKILL.mdreadonly
SKILL.md Frontmatter
namechatgpt-image-generation
descriptionGenerate images from ChatGPT using Playwright browser automation. Opens ChatGPT, sends prompts, waits for generation, and saves the resulting images.
ChatGPT Image Generation Skill
Use Playwright to automate ChatGPT web UI for image generation.
Prerequisites
npm install playwright
npx playwright install chromium
Usage
# Generate images from prompts file
node generate.js --prompts prompts.json --output ./images
# Resume from a specific index
node generate.js --prompts prompts.json --output ./images --start 5
# Run in headless mode
node generate.js --prompts prompts.json --output ./images --headless
Prompt File Format
["prompt 1", "prompt 2"]
or
{ "prompts": ["prompt 1", "prompt 2"] }
How It Works
- Opens ChatGPT in a Chrome browser
- Sends each prompt from the prompts file
- Waits for the response to be generated
- Finds the generated image in the page
- Saves the image to the output directory
- Repeats for all prompts
Output
- Numbered image files:
001.png,002.png, etc. results.jsonl— log of results per prompt
Login (One-Time)
If not logged into ChatGPT:
- Run the script (browser will open visible)
- Sign into ChatGPT
- Session is saved for future runs