This script uses Puppeteer to interact with the sora.com website. It automates the process of entering prompts and generating images. The script requires Chromium to run.
- Chromium installed on your system.
- You must be logged into the sora.com website.
- Navigate to the My Media page and select a generated image (URL such as: https://sora.chatgpt.com/t/task_01jsw4zeykft8b36de9d73vfag).
Run the following command to start Chromium with remote debugging enabled:
chromium-browser \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/rpi-puppeteer-profile \
--no-first-run \
--no-default-browser-check \
--disable-features=TranslateUI \
--no-sandbox \
--disable-dev-shm-usage \
--disable-gpuEnsure Node.js is installed, then run:
yarn install- Start Chromium with the command above.
- Log in to sora.com and navigate to the My Media page.
- Open a generated image.
- Run the script with:
yarn startThe application will start both the generator script and a web server on port 6699.
Access the web interface at http://localhost:6699 to manage your playbook configuration and control the generator:
Features:
- 🚀 Generator Control: Start and stop the image generation process with real-time status monitoring
- 📋 Live Logs: View generation logs in real-time with automatic updates via Server-Sent Events (SSE)
- 📝 Prompt Management: Add, edit, enable/disable, and remove prompts dynamically
- 🔧 Variable Management: Configure variables with multiple values for prompt randomization
- ⚙️ Parameters: Adjust wait times (min/max) between generation cycles
- 💾 Playbook Management: Load and save your configuration to
playbook.json - 📚 Multiple Playbooks: Save, load, and manage multiple playbook configurations in the
playbooks/folder
The web interface provides a user-friendly way to manage your automation without editing JSON files manually. All changes are validated before being saved to ensure configuration integrity.
- Prompts and variables used by the script are configured in the
playbook.jsonfile. - Ensure the
playbook.jsonfile is correctly set up before running the script. - Logs of operations are saved in the
logs.logfile.
The application exposes the following REST API endpoints:
GET /api/playbook- Retrieve current playbook configurationPOST /api/playbook- Update playbook configuration (with validation)GET /api/playbooks- List all saved playbooksGET /api/playbooks/:name- Load a specific playbookPOST /api/playbooks/:name- Save a playbook with custom nameDELETE /api/playbooks/:name- Delete a playbookGET /api/generator/status- Check if generator is runningPOST /api/generator/start- Start the generatorPOST /api/generator/stop- Stop the generatorGET /api/logs- Get recent logsGET /api/logs/stream- Real-time log stream (SSE)