codex-images
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex Images
Codex 图片生成
Images made by Codex's built-in image tool, run from the terminal: one per image, several at once. It uses their ChatGPT plan (Plus or Pro), no API key.
codex execTalk to them in their language. = the output folder: for a video, else .
<out>video-agent/edits/<slug>/images/video-agent/images/<name>/通过 terminal 运行 Codex 内置的 image tool 生成图片:每张图片运行一次 ,可同时运行多个。它使用用户的 ChatGPT 套餐(Plus 或 Pro),无需 API key。
codex exec始终使用用户所用的语言进行沟通。 = 输出文件夹:视频使用 ,其他情况使用 。
<out>video-agent/edits/<slug>/images/video-agent/images/<name>/1. Codex (once)
1. Codex(一次性操作)
bash
codex --version
codex login status- Not installed: (needs Node 20+), or
npm i -g @openai/codexon macOS.brew install codex - Not logged in: they run themselves (it opens the browser, "Sign in with ChatGPT"). Never ask for an OpenAI key or password in the chat.
codex login
bash
codex --version
codex login status- 未安装:运行 (需要 Node 20+),或在 macOS 上运行
npm i -g @openai/codex。brew install codex - 未登录:由用户自行运行 (这会打开浏览器并显示“Sign in with ChatGPT”)。切勿在聊天中索要 OpenAI key 或密码。
codex login
2. The brief
2. 创作简报
One image = one prompt. Never pack several ideas into one job.
Ask only what is missing, in one message:
- What for: thumbnail (1280x720, 16:9), short cover (1080x1920, 9:16), square post (1:1), a still for a callout or B-roll (the video's format).
- How many: 1 by default; 3 variants for a thumbnail (a different idea each, not the same one three times).
- Their face: a thumbnail with them in it needs 1 to 3 clear photos (a frame of a take works: ). Pass the absolute paths.
ffmpeg -v error -y -ss <t> -i <take> -frames:v 1 -q:v 2 <out>/ref-face.jpg
Write each prompt in English, concrete: the subject, the framing, the background, the light, the colors, the text on the image (3 words at most, written exactly in quotes, in the video's language), and the format. For a thumbnail: one subject, big readable text, strong contrast, a face with a clear emotion, nothing in the bottom right corner (YouTube puts the duration there). Every claim on the image comes from the video.
Show the prompts in a numbered list and wait for a yes (each image uses some of their Codex usage limit).
一张图片 = 一个 prompt。绝不要把多个创意塞进同一个 job。
只询问缺失的信息,并且集中在一个消息中:
- 用途:缩略图(1280x720,16:9)、竖版封面(1080x1920,9:16)、方形帖子(1:1)、callout 或 B-roll 用的静帧(采用视频的画幅格式)。
- 数量:默认 1 张;缩略图默认生成 3 个变体(每个变体采用不同创意,而不是将同一个创意重复三次)。
- 创作者面部:缩略图中出现创作者本人时,需要 1 到 3 张清晰照片(也可以从一条 take 中截取一帧:)。传入绝对路径。
ffmpeg -v error -y -ss <t> -i <take> -frames:v 1 -q:v 2 <out>/ref-face.jpg
每个 prompt 都用英文编写,并具体说明:主体、构图、背景、光线、颜色、图片上的文字(最多 3 个词,必须用引号原样写出,并使用视频的语言)以及格式。对于缩略图:只保留一个主体、使用大而清晰的文字、采用强烈对比度、面部表情鲜明,右下角不要放置任何内容(YouTube 会在那里显示时长)。图片上的每一项信息都必须有视频内容作为依据。
以编号列表展示 prompts,并等待用户明确同意(每张图片都会消耗一部分 Codex 使用额度)。
3. Generate
3. 生成
One job per prompt, at most 3 at a time, each in the background. Always end with (without it waits for input forever), and keep the last message in a file:
< /dev/nullcodex execbash
mkdir -p <out>/logs
codex exec --skip-git-repo-check -s workspace-write -C "$PWD" \
--output-last-message <out>/logs/<n>-<name>.txt \
"Use your built-in image_gen tool to generate exactly one raster image for the prompt below. Do not edit any file. Do not ask questions. No SVG, no HTML, no placeholder.
Reference images (pass them to image_gen as referenced_image_paths): <absolute paths, or none>
When done, reply with exactly these two lines:
ASSET_NAME: <kebab-case-name>
IMAGE_PATH: <absolute path of the generated image>
Image prompt:
<the prompt>" \
< /dev/null > <out>/logs/<n>-<name>.log 2>&1A job takes about 1 to 3 minutes. When it ends, read its , take and copy the image:
.txtIMAGE_PATHbash
cp "<IMAGE_PATH>" <out>/<n>-<name>.pngNo in the answer: the newest file in () created after the job started. Nothing new there: the job failed, show the end of its (often a usage limit, or needed) and run that one again once.
IMAGE_PATH~/.codex/generated_images/ls -t ~/.codex/generated_images/*/* | head -3.logcodex login每个 prompt 对应一个 job,最多同时运行 3 个,每个都在后台运行。命令末尾始终加上 (否则 会一直等待输入),并将最后一条消息保存在文件中:
< /dev/nullcodex execbash
mkdir -p <out>/logs
codex exec --skip-git-repo-check -s workspace-write -C "$PWD" \
--output-last-message <out>/logs/<n>-<name>.txt \
"Use your built-in image_gen tool to generate exactly one raster image for the prompt below. Do not edit any file. Do not ask questions. No SVG, no HTML, no placeholder.
Reference images (pass them to image_gen as referenced_image_paths): <absolute paths, or none>
When done, reply with exactly these two lines:
ASSET_NAME: <kebab-case-name>
IMAGE_PATH: <absolute path of the generated image>
Image prompt:
<the prompt>" \
< /dev/null > <out>/logs/<n>-<name>.log 2>&1一个 job 大约需要 1 到 3 分钟。结束后,读取对应的 ,取出 并复制图片:
.txtIMAGE_PATHbash
cp "<IMAGE_PATH>" <out>/<n>-<name>.png如果回答中没有 :查找 job 启动后创建的 中最新文件()。如果那里没有新文件,说明 job 失败;展示其 末尾内容(常见原因是达到使用限额,或需要运行 ),然后仅重跑该 job 一次。
IMAGE_PATH~/.codex/generated_images/ls -t ~/.codex/generated_images/*/* | head -3.logcodex login4. Check and hand over
4. 检查与交付
- One image per prompt, and no two identical ().
shasum <out>/*.png - The size: (macOS) or
sips -g pixelWidth -g pixelHeight <file>. A thumbnail must be 16:9: crop or scale it to 1280x720 with ffmpeg (ffprobe -v error -show_entries stream=width,height -of csv=p=0 <file>), under 2 MB as JPG.-vf "scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720" - Look at each image: the text spelled right, the face like them, nothing odd (hands, extra letters). A wrong one: fix the prompt and run that one again.
Write : one entry per image with , , , . Show the images, then:
<out>/manifest.jsonfilepromptrefsdate- A thumbnail or cover: uses
/video-publish(they pick one, it is copied as<edit>/images/, the cover and the YouTube thumbnail).<edit>/cover.jpg - A still for a video: can place it as a callout image (copy it into
/video-edit).video-agent/studio/public/
Delete once everything is fine.
<out>/logs/- 每个 prompt 只对应一张图片,且任意两张都不得相同()。
shasum <out>/*.png - 尺寸:使用 (macOS)或
sips -g pixelWidth -g pixelHeight <file>检查。缩略图必须为 16:9:使用 ffmpeg 将其裁剪或缩放至 1280x720(ffprobe -v error -show_entries stream=width,height -of csv=p=0 <file>),并保存为小于 2 MB 的 JPG。-vf "scale=1280:720:force_original_aspect_ratio=increase,crop=1280:720" - 逐张检查图片:文字拼写正确、面部与创作者相似、没有异常内容(手指、多余字母等)。如果某张图片有误:修改 prompt,并只重跑该图片对应的 job。
编写 :每张图片一个条目,包含 、、、。展示图片,然后:
<out>/manifest.jsonfilepromptrefsdate- 缩略图或封面:使用
/video-publish(用户会挑选一张,挑选的图片会被复制为<edit>/images/,用作封面和 YouTube 缩略图)。<edit>/cover.jpg - 视频静帧:可以将其作为 callout 图片放置(复制到
/video-edit)。video-agent/studio/public/
确认一切无误后,删除 。
<out>/logs/Honest limits
实际限制
- The image tool is OpenAI's, inside Codex: the result depends on it, and it changes. Text on the image can come out misspelled: always check it.
- A face from reference photos looks close, rarely perfect. Real photos of them stay the safest for a thumbnail.
- Each image counts against their ChatGPT plan's Codex limits; a limit reached means waiting or a bigger plan.
- Only use photos of people who agreed, and no logos or characters they don't own.
- image tool 是 Codex 内置的 OpenAI 工具:生成结果取决于该工具,而且输出会发生变化。图片中的文字可能会拼写错误,因此必须始终检查。
- 基于参考照片生成的面孔通常比较接近,但很少完全一样。对于缩略图,使用创作者本人的真实照片仍是最稳妥的方案。
- 每张图片都会计入用户 ChatGPT 套餐的 Codex 使用限额;达到限额后,只能等待或升级套餐。
- 仅使用已获得同意的人物照片;不要使用创作者不拥有的 logo 或角色。