Auto Midjourney
Use the user's own Midjourney Alpha web session to submit imagine jobs and optionally poll for results.
This skill is intended for conservative, user-triggered assistance rather than unattended bulk automation.
What this skill does
- - Submits prompts to INLINECODE1
- Defaults to Midjourney v8 for new prompts unless the user explicitly requests another version
- Keeps credentials in environment variables instead of hardcoding them into the skill
- Supports a one-command flow through INLINECODE2
- Can read
https://alpha.midjourney.com/api/user-mutable-state to inspect current web settings - Can infer
user_id and singleplayer_<midjourney_id> from the authenticated cookie - Applies local conservative throttling to reduce accidental request bursts
- Includes
scripts/mj_doctor.py for setup validation - Includes an experimental recent-jobs reader
- Supports
browser transport backed by Chrome DevTools Protocol, with Playwright-over-CDP preferred when installed - Supports optional polling once a job-status endpoint has been confirmed
- Includes prompt-craft guidance and reusable scenario presets for better prompt writing
- Includes a structured prompt builder and opt-in quality profiles
- Includes dedicated guidance for character sheets, split-view turnarounds, and reusable design assets
Current scope
This version focuses on:
- 1. INLINECODE8
- Midjourney v8 as the default version
- Alpha web flow, not Discord bot flow
- Safe local configuration via INLINECODE9
- Easier operation through inferred IDs, presets, and doctor checks
Implemented:
- -
imagine submit through the Alpha web flow - browser-backed verification using low-impact CDP network watching plus page asset fallback
- local download of the 4 returned image assets
- optional browser-side conversion from
webp to png during download - sequential batch generation
Not implemented yet:
- - Upscale / variation / reroll button actions
- Image upload / reference-image workflow
- Automatic result download from a confirmed final image endpoint
Those should be added only after capturing stable request samples from the browser.
Safety posture
Do not optimize this skill for bypassing restrictions, hiding automation, rotating accounts, or mass unattended generation.
Use these guardrails instead:
- - trigger requests manually
- keep request frequency low
- leave local throttling enabled
- validate config with INLINECODE13
- prefer one human action to one live submit
The goal is risk reduction through conservative usage, not evasion.
Trigger rules
Use this skill proactively when the user asks to:
- - “用 Midjourney / MJ 出图”
- “用 Midjourney v8 生成”
- “帮我提交 imagine”
- “优化 Midjourney prompt”
- “做角色设定稿 / 四视图 / 角色资产图”
- “抓 Midjourney Alpha 网站请求”
- “轮询 Midjourney job 状态”
- “把网页版 Midjourney 做成自动化能力”
Required configuration
Read these values from .env or shell environment:
| Variable | Required | Purpose |
|---|
| INLINECODE15 | Yes | Full authenticated Cookie header copied from browser |
| INLINECODE16 |
Yes | Alpha web singleplayer channel ID |
|
MJ_STATUS_URL_TEMPLATE | No | Job status endpoint template containing
{job_id} |
|
MJ_USER_STATE_PATH | No | Defaults to
/api/user-mutable-state |
|
MJ_RECENT_JOBS_URL | No | Experimental recent-jobs endpoint |
|
MJ_MODE | No |
fast by default |
|
MJ_PRIVATE | No |
true by default |
|
MJ_MIN_SUBMIT_INTERVAL_SECONDS | No | Local minimum spacing between submits. Default is
3 seconds |
|
MJ_MAX_SUBMITS_PER_HOUR | No | Local hourly cap. Set
0 to disable, which is now the default |
|
MJ_MAX_SUBMITS_PER_DAY | No | Local daily cap. Set
0 to disable, which is now the default |
|
MJ_USER_ID | No | Usually inferred from the auth cookie |
|
MJ_METRICS_TOKEN | No | Optional token observed on telemetry requests |
|
MJ_BROWSER_BACKEND | No |
auto by default. Set
playwright or
cdp to force a backend |
Never write real cookies or tokens into SKILL.md, reference files, git-tracked scripts, or user-facing summaries.
System requirements
For platform and device requirements, read system-requirements.md.
Workflow
Scenario 0: Check config first
Run:
CODEBLOCK0
This shows:
- - whether the cookie exists
- inferred INLINECODE39
- inferred INLINECODE40
- current server-side speed and visibility
- current local safe-limit settings
Scenario 1: Submit one prompt
Run:
CODEBLOCK1
Default behavior:
- - Appends
--v 8 if the prompt does not already specify a version - Appends
--raw by default unless the user disables it - Uses
MJ_MODE and MJ_PRIVATE from the environment - Can sync server-side defaults before submitting
- Records the submit locally and enforces conservative pacing
- Prints structured JSON with the request payload, submission response, and extracted INLINECODE45
For simplest live use:
CODEBLOCK2
When --wait-page-assets is enabled, the browser transport now prefers watching Midjourney's existing in-page network traffic for the submitted job_id. It falls back to page asset probing only if the low-impact watcher does not yield 4 images.
Scenario 2: Submit and wait
If a working status endpoint has been captured and stored in MJ_STATUS_URL_TEMPLATE, run:
CODEBLOCK3
Scenario 3: Low-risk debugging
Use dry-run first when changing payload structure:
CODEBLOCK4
This validates prompt normalization and payload generation without sending a live request.
Scenario 3b: Use a preset
Run:
CODEBLOCK5
Preset definitions live in config/presets.example.json.
When the user wants better prompt wording, templates, or parameter tradeoffs, read prompt-craft.md.
Scenario 3c: Build a prompt from a template
Run:
CODEBLOCK6
This produces a V8-friendly prompt string and a ready-to-run run_imagine.py command.
Scenario 4: Read current web settings
Run:
CODEBLOCK7
This reads the same user-mutable-state endpoint the web app uses and returns values such as:
- - INLINECODE52
- INLINECODE53
- INLINECODE54
- saved INLINECODE55
Command reference
Submit only
CODEBLOCK8
Poll one job
CODEBLOCK9
Inspect current server-side settings
CODEBLOCK10
Validate config and inferred identity
CODEBLOCK11
Experimental recent jobs lookup
CODEBLOCK12
Submit, verify, and download locally
CODEBLOCK13
Batch generate and store PNGs
CODEBLOCK14
Use conservative fixed spacing and batch cooldowns when needed:
CODEBLOCK15
Apply an opt-in quality profile to the whole batch:
CODEBLOCK16
Convert existing WEBP downloads to PNG
CODEBLOCK17
Or write converted files into a separate directory:
CODEBLOCK18
If you want to rebuild PNGs from a saved result manifest instead of local files:
CODEBLOCK19
This waits for the submitted job_id to appear in the browser page resource list, verifies that 4 Midjourney CDN image URLs exist, and downloads the returned image files into outputs/<job_id>/.
Batch generate sequentially
Create a text file with one prompt per line, then run:
CODEBLOCK20
This submits prompts one by one, waits for each job_id to produce page resource URLs, and downloads the returned image files before moving to the next prompt.
Full flow
CODEBLOCK21
Prompt defaults
When the user does not specify MJ flags:
- - Default to INLINECODE59
- Default to INLINECODE60
- Preserve any explicit aspect ratio or style flags already present
- Do not auto-add INLINECODE61
- Treat
--q 4 as an opt-in final-pass override rather than a default for the current V8-focused flow
Do not silently override explicit user flags.
Output format
When you use this skill, report back in this structure:
CODEBLOCK22
Simpler usage model
For day-to-day use, prefer this sequence:
- 1. INLINECODE63
- INLINECODE64
- INLINECODE65
This reduces manual mistakes and keeps you in a low-frequency workflow. On this machine, browser transport is the preferred live path because raw HTTP requests are blocked by Cloudflare.
Success criteria for a usable generation
Treat a generation as verified only when all of these are true:
- 1. submit response contains a INLINECODE67
- page resource entries contain 4 CDN image URLs for the same INLINECODE68
- the image files are downloaded successfully to local disk
Normal Midjourney imagine behavior is a 4-image grid. Depending on the endpoint response, you may get one grid image file rather than four separately cropped files. This skill currently verifies and downloads the returned image assets as provided by Midjourney.
Extension path
After the user captures more browser requests, extend in this order:
- 1. Confirm job-status endpoint and final-image fields
- Add result downloader
- Add button-action support for upscale / variation
- Add reference image upload flow
- Add prompt-template helpers for common MJ styles
Confirmed non-status endpoints
- -
POST https://proxima.midjourney.com/ is currently treated as telemetry ingestion - INLINECODE71 is currently treated as tracing/observability data
- INLINECODE72 is useful for reading current speed and visibility defaults
Do not mistake telemetry endpoints for job-status APIs.
GitHub-informed but experimental path
The skill includes an experimental recent-jobs reader based on public GitHub reverse-engineering notes. Treat it as best-effort support rather than a stable API contract.
Auto Midjourney
使用用户自己的 Midjourney Alpha 网页会话来提交 imagine 任务,并可选择轮询获取结果。
本技能旨在提供保守的、用户触发的辅助功能,而非无人值守的批量自动化。
技能功能
- - 向 https://alpha.midjourney.com/api/submit-jobs 提交提示词
- 除非用户明确要求其他版本,否则新提示词默认使用 Midjourney v8
- 将凭据保存在环境变量中,而非硬编码到技能中
- 通过 scripts/runimagine.py 支持单命令流程
- 可读取 https://alpha.midjourney.com/api/user-mutable-state 以检查当前网页设置
- 可从经过身份验证的 Cookie 推断 userid 和 singleplayerid>
- 应用本地保守限流以减少意外请求爆发
- 包含 scripts/mj_doctor.py 用于设置验证
- 包含实验性的近期任务读取器
- 支持基于 Chrome DevTools 协议的 browser 传输方式,安装 Playwright-over-CDP 时优先使用
- 在确认任务状态端点后支持可选轮询
- 包含提示词编写指导和可复用的场景预设,以优化提示词编写
- 包含结构化提示词构建器和可选质量配置文件
- 包含针对角色设定表、分视角旋转图和可复用设计资产的专门指导
当前范围
本版本专注于:
- 1. imagine 功能
- Midjourney v8 作为默认版本
- Alpha 网页流程,而非 Discord 机器人流程
- 通过 .env 进行安全的本地配置
- 通过推断 ID、预设和医生检查实现更简便的操作
已实现:
- - 通过 Alpha 网页流程提交 imagine
- 使用低影响的 CDP 网络监控加页面资源回退的浏览器验证
- 本地下载返回的 4 个图像资源
- 下载时可选择将 webp 转换为 png
- 顺序批量生成
尚未实现:
- - 放大/变体/重新生成按钮操作
- 图像上传/参考图像工作流
- 从确认的最终图像端点自动下载结果
这些功能应在从浏览器捕获稳定的请求样本后再添加。
安全立场
不要优化本技能以绕过限制、隐藏自动化、轮换账户或进行大规模无人值守生成。
请使用以下防护措施:
- - 手动触发请求
- 保持低请求频率
- 保持本地限流启用
- 使用 mj_doctor.py 验证配置
- 每次人工操作对应一次实时提交
目标是通过保守使用降低风险,而非规避限制。
触发规则
当用户要求以下内容时,主动使用本技能:
- - 用 Midjourney / MJ 出图
- 用 Midjourney v8 生成
- 帮我提交 imagine
- 优化 Midjourney prompt
- 做角色设定稿 / 四视图 / 角色资产图
- 抓 Midjourney Alpha 网站请求
- 轮询 Midjourney job 状态
- 把网页版 Midjourney 做成自动化能力
必需配置
从 .env 或 shell 环境读取以下值:
| 变量 | 必需 | 用途 |
|---|
| MJCOOKIE | 是 | 从浏览器复制的完整经过身份验证的 Cookie 头 |
| MJCHANNEL_ID |
是 | Alpha 网页单人频道 ID |
| MJ
STATUSURL
TEMPLATE | 否 | 包含 {jobid} 的任务状态端点模板 |
| MJ
USERSTATE_PATH | 否 | 默认为 /api/user-mutable-state |
| MJ
RECENTJOBS_URL | 否 | 实验性的近期任务端点 |
| MJ_MODE | 否 | 默认为 fast |
| MJ_PRIVATE | 否 | 默认为 true |
| MJ
MINSUBMIT
INTERVALSECONDS | 否 | 提交之间的本地最小间隔。默认为 3 秒 |
| MJ
MAXSUBMITS
PERHOUR | 否 | 本地每小时上限。设为 0 可禁用,现为默认值 |
| MJ
MAXSUBMITS
PERDAY | 否 | 本地每日上限。设为 0 可禁用,现为默认值 |
| MJ
USERID | 否 | 通常从身份验证 Cookie 推断 |
| MJ
METRICSTOKEN | 否 | 在遥测请求中观察到的可选令牌 |
| MJ
BROWSERBACKEND | 否 | 默认为 auto。设为 playwright 或 cdp 以强制指定后端 |
切勿将真实的 Cookie 或令牌写入 SKILL.md、参考文件、Git 跟踪的脚本或面向用户的摘要中。
系统要求
关于平台和设备要求,请阅读 system-requirements.md。
工作流程
场景 0:先检查配置
运行:
bash
python3 scripts/mj_doctor.py --fetch-user-state --transport browser
这将显示:
- - Cookie 是否存在
- 推断的 midjourneyid
- 推断的 channelid
- 当前服务器端速度和可见性
- 当前本地安全限制设置
场景 1:提交一个提示词
运行:
bash
python3 scripts/run_imagine.py 1 girl --ar 16:9 --transport browser
默认行为:
- - 如果提示词未指定版本,则附加 --v 8
- 除非用户禁用,否则默认附加 --raw
- 使用环境中的 MJMODE 和 MJPRIVATE
- 可在提交前同步服务器端默认值
- 本地记录提交并强制执行保守的节奏控制
- 打印包含请求负载、提交响应和提取的 job_id 的结构化 JSON
最简单的实时使用方式:
bash
python3 scripts/run_imagine.py cinematic portrait of a fox astronaut --transport browser --sync-user-state --wait-page-assets --download --convert-to png
启用 --wait-page-assets 时,浏览器传输方式现在优先监控 Midjourney 现有页面内网络流量中已提交的 job_id。仅当低影响监控器未产生 4 张图像时,才回退到页面资源探测。
场景 2:提交并等待
如果已捕获有效的状态端点并存储在 MJSTATUSURL_TEMPLATE 中,运行:
bash
python3 scripts/run_imagine.py cinematic portrait of a fox astronaut --ar 16:9 --wait
场景 3:低风险调试
在更改负载结构时,先使用试运行:
bash
python3 scripts/run_imagine.py robot barista in tokyo alley --dry-run
这将验证提示词规范化和负载生成,而不发送实时请求。
场景 3b:使用预设
运行:
bash
python3 scripts/run_imagine.py silver perfume bottle on black glass --preset product --sync-user-state
预设定义位于 config/presets.example.json 中。
当用户需要更好的提示词措辞、模板或参数权衡时,请阅读 prompt-craft.md。
场景 3c:从模板构建提示词
运行:
bash
python3 scripts/mjprompthelper.py --template product --subject premium silver perfume bottle --camera front three-quarter angle --surface black glass surface --lighting controlled softbox rim light --background dark charcoal background --mood minimal luxury beauty campaign --preset productcleansquare --quality-profile finalv8q4 --json
这将生成一个 V8 友好的提示词字符串和一个可直接运行的 run_imagine.py 命令。
场景 4:读取当前网页设置
运行:
bash
python3 scripts/getuserstate.py --transport browser
这将读取网页应用使用的相同 user-mutable-state 端点,并返回以下值:
- - settings.speed
- settings.visibility
- abilities
- 保存的 macros
命令参考
仅提交
bash
python3 scripts/submit_job.py minimalist glass monolith --ar 16:9 --v 8
轮询一个任务
bash
python3 scripts/polljob.py id>
检查当前服务器端设置
bash
python3 scripts/getuserstate.py --transport browser
验证配置和推断的身份
bash
python3 scripts/mj_doctor.py --fetch-user-state --transport browser
###