Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/SKILL.md
+42-13Lines changed: 42 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,17 +12,19 @@ Generates or edits images for the current project (for example website assets, g
12
12
This skill has exactly two top-level modes:
13
13
14
14
-**Default built-in tool mode (preferred):** built-in `image_gen` tool for normal image generation and editing. Does not require `OPENAI_API_KEY`.
15
-
-**Fallback CLI mode (explicit-only):**`scripts/image_gen.py` CLI. Use only when the user explicitly asks for the CLI path. Requires `OPENAI_API_KEY`.
15
+
-**Fallback CLI mode:**`scripts/image_gen.py` CLI. Use when the user explicitly asks for the CLI/API/model path, or when they explicitly require a transparent background that needs `gpt-image-1.5`. Requires `OPENAI_API_KEY`.
16
16
17
-
Within the explicit CLI fallback only, the CLI exposes three subcommands:
17
+
Within CLI fallback, the CLI exposes three subcommands:
18
18
19
19
-`generate`
20
20
-`edit`
21
21
-`generate-batch`
22
22
23
23
Rules:
24
-
- Use the built-in `image_gen` tool by default for all normal image generation and editing requests.
25
-
- Never switch to CLI fallback automatically.
24
+
- Use the built-in `image_gen` tool by default for normal image generation and editing requests.
25
+
- Do not switch to CLI fallback for ordinary quality, size, or file-path control.
26
+
- If the user explicitly asks for a transparent image/background, use CLI fallback with `gpt-image-1.5` and explain briefly that transparent backgrounds are not supported in `gpt-image-2`, the latest model.
27
+
- The word `batch` by itself does not mean CLI fallback. If the user asks for many assets or says to batch-generate assets without explicitly asking for CLI/API/model controls, stay on the built-in path and issue one built-in call per requested asset or variant.
26
28
- If the built-in tool fails or is unavailable, tell the user the CLI fallback exists and that it requires `OPENAI_API_KEY`. Proceed only if the user explicitly asks for that fallback.
27
29
- If the user explicitly asks for CLI mode, use the bundled `scripts/image_gen.py` workflow. Do not create one-off SDK runners.
28
30
- Never modify `scripts/image_gen.py`. If something is missing, ask the user before doing anything else.
@@ -79,12 +81,13 @@ Built-in edit semantics:
79
81
80
82
Execution strategy:
81
83
- In the built-in default path, produce many assets or variants by issuing one `image_gen` call per requested asset or variant.
82
-
- In the explicit CLI fallback path, use the CLI `generate-batch` subcommand only when the user explicitly chose CLI mode and needs many prompts/assets.
84
+
- In the CLI fallback path, use the CLI `generate-batch` subcommand only when the user explicitly chose CLI mode and needs many prompts/assets.
85
+
- For many distinct assets, do not use `n` as a substitute for separate prompts. `n` is for variants of one prompt; distinct assets need distinct built-in calls or distinct CLI `generate-batch` jobs.
83
86
84
87
Assume the user wants a new image unless they clearly ask to change an existing one.
85
88
86
89
## Workflow
87
-
1. Decide the top-level mode: built-in by default, fallback CLI only if explicitly requested.
90
+
1. Decide the top-level mode: built-in by default; fallback CLI if explicitly requested or if the user explicitly needs transparent output.
88
91
2. Decide the intent: `generate` or `edit`.
89
92
3. Decide whether the output is preview-only or meant to be consumed by the current project.
90
93
4. Decide the execution strategy: single asset vs repeated built-in calls vs CLI `generate-batch`.
@@ -99,13 +102,13 @@ Assume the user wants a new image unless they clearly ask to change an existing
99
102
- If the user's prompt is already specific and detailed, normalize it into a clear spec without adding creative requirements.
100
103
- If the user's prompt is generic, add tasteful augmentation only when it materially improves output quality.
101
104
10. Use the built-in `image_gen` tool by default.
102
-
11. If the user explicitly chooses the CLI fallback, then and only then use the fallback-only docs for quality, `input_fidelity`, masks, output format, output paths, and network setup.
105
+
11. If the user explicitly chooses the CLI fallback, or explicitly asks for transparent output, then use the fallback-only docs for model, quality, size, `input_fidelity`, masks, output format, output paths, and network setup.
103
106
12. Inspect outputs and validate: subject, style, composition, text accuracy, and invariants/avoid items.
104
107
13. Iterate with a single targeted change, then re-check.
105
108
14. For preview-only work, render the image inline; the underlying file may remain at the default `$CODEX_HOME/generated_images/...` path.
106
109
15. For project-bound work, move or copy the selected artifact into the workspace and update any consuming code or references. Never leave a project-referenced asset only at the default `$CODEX_HOME/generated_images/...` path.
107
-
16. For batches, persist only the selected finals in the workspace unless the user explicitly asked to keep discarded variants.
108
-
17. Always report the final saved path for any workspace-bound asset, plus the final prompt and whether the built-in tool or fallback CLI mode was used.
110
+
16. For batches or multi-asset requests, persist every requested deliverable final in the workspace unless the user explicitly asked to keep outputs preview-only. Discarded variants do not need to be kept unless requested.
111
+
17. Always report the final saved path(s) for any workspace-bound asset(s), plus the final prompt or prompt set and whether the built-in tool or fallback CLI mode was used.
-`Asset type` and `Input images` are prompt scaffolding, not dedicated CLI flags.
181
187
-`Scene/backdrop` refers to the visual setting. It is not the same as the fallback CLI `background` parameter, which controls output transparency behavior.
182
-
- Fallback-only execution notes such as `Quality:`, `Input fidelity:`, masks, output format, and output paths belong in the explicit CLI path only. Do not treat them as built-in `image_gen` tool arguments.
188
+
- Fallback-only execution notes such as `Quality:`, `Input fidelity:`, masks, output format, and output paths belong in the CLI path only. Do not treat them as built-in `image_gen` tool arguments.
183
189
184
190
Augmentation rules:
185
191
- Keep it short.
@@ -220,18 +226,41 @@ Constraints: change only the background; keep the product and its edges unchange
220
226
- Iterate with single-change follow-ups.
221
227
- If the prompt is generic, add only the extra detail that will materially help.
222
228
- If the prompt is already detailed, normalize it instead of expanding it.
223
-
- For explicit CLI fallback only, see `references/cli.md` and `references/image-api.md` for `quality`, `input_fidelity`, masks, output format, and output-path guidance.
229
+
- For CLI fallback only, see `references/cli.md` and `references/image-api.md` for model,`quality`, `input_fidelity`, masks, output format, and output-path guidance.
224
230
225
231
More principles shared by both modes: `references/prompting.md`.
226
232
Copy/paste specs shared by both modes: `references/sample-prompts.md`.
227
233
228
234
## Guidance by asset type
229
235
Asset-type templates (website assets, game assets, wireframes, logo) are consolidated in `references/sample-prompts.md`.
230
236
237
+
## gpt-image-2 guidance for CLI fallback
238
+
239
+
The fallback CLI defaults to `gpt-image-2`.
240
+
241
+
- Use `gpt-image-2` for new CLI/API workflows unless the request needs transparent output.
242
+
- If the user explicitly asks for transparent output, use `gpt-image-1.5` and explain that transparent backgrounds are not supported in `gpt-image-2`, the latest model.
243
+
-`gpt-image-2` always uses high fidelity for image inputs; do not set `input_fidelity` with this model.
244
+
-`gpt-image-2` supports `quality` values `low`, `medium`, `high`, and `auto`.
245
+
- Use `quality low` for fast drafts, thumbnails, and quick iterations. Use `medium`, `high`, or `auto` for final assets, dense text, diagrams, identity-sensitive edits, or high-resolution outputs.
246
+
- Square images are typically fastest to generate. Use `1024x1024` for fast square drafts.
247
+
- If the user asks for 4K-style output, use `3824x2160` for landscape or `2160x3824` for portrait. Do not use `3840x2160`, because the maximum edge length must be less than `3840px`.
248
+
-`gpt-image-2` size may be `auto` or `WIDTHxHEIGHT` if all constraints hold: max edge `< 3840px`, both edges multiples of `16px`, long-to-short ratio `<= 3:1`, total pixels between `655,360` and `8,294,400`.
249
+
250
+
Popular `gpt-image-2` sizes:
251
+
-`1024x1024` square
252
+
-`1536x1024` landscape
253
+
-`1024x1536` portrait
254
+
-`2048x2048` 2K square
255
+
-`2048x1152` 2K landscape
256
+
-`3824x2160` near-4K landscape
257
+
-`2160x3824` near-4K portrait
258
+
-`auto`
259
+
231
260
## Fallback CLI mode only
232
261
233
262
### Temp and output conventions
234
-
These conventions apply only to the explicit CLI fallback. They do not describe built-in `image_gen` output behavior.
263
+
These conventions apply only to the CLI fallback. They do not describe built-in `image_gen` output behavior.
235
264
- Use `tmp/imagegen/` for intermediate files (for example JSONL batches); delete them when done.
236
265
- Write final artifacts under `output/imagegen/`.
237
266
- Use `--out` or `--out-dir` to control output paths; keep filenames stable and descriptive.
@@ -276,4 +305,4 @@ If installation is not possible in this environment, tell the user which depende
276
305
-`references/cli.md`: fallback-only CLI usage via `scripts/image_gen.py`.
277
306
-`references/image-api.md`: fallback-only API/CLI parameter reference.
278
307
-`references/codex-network.md`: fallback-only network/sandbox troubleshooting for CLI mode.
279
-
-`scripts/image_gen.py`: fallback-only CLI implementation. Do not load or use it unless the user explicitly chooses CLI mode.
308
+
-`scripts/image_gen.py`: fallback-only CLI implementation. Do not load or use it unless the user explicitly chooses CLI mode or explicitly asks for transparent output.
Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/agents/openai.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,4 @@ interface:
3
3
short_description: "Generate or edit images for websites, games, and more"
4
4
icon_small: "./assets/imagegen-small.svg"
5
5
icon_large: "./assets/imagegen.png"
6
-
default_prompt: "Generate or edit the visual assets for this task with the built-in `image_gen` tool by default. First confirm that the task actually calls for a raster image; if the project already has SVG/vector/code-native assets and the user wants to extend or match those, do not use this skill. If the task includes reference images, treat them as references unless the user clearly wants an existing image modified. For multi-asset requests, loop built-in calls rather than treating batch as a separate top-level mode. Only use the fallback CLI if the user explicitly asks for it, and keep CLI-only controls such as `generate-batch`, `quality`, `input_fidelity`, masks, and output paths on that fallback path."
6
+
default_prompt: "Generate or edit the visual assets for this task with the built-in `image_gen` tool by default. First confirm that the task actually calls for a raster image; if the project already has SVG/vector/code-native assets and the user wants to extend or match those, do not use this skill. If the task includes reference images, treat them as references unless the user clearly wants an existing image modified. For multi-asset requests, loop built-in calls; the word `batch` alone is not CLI opt-in. Use the fallback CLI only if the user explicitly asks for CLI/API/model controls or explicitly needs transparent output; for transparent output use `gpt-image-1.5` and explain that transparent backgrounds are not supported in `gpt-image-2`, the latest model. Keep CLI-only controls such as `generate-batch`, `quality`, `input_fidelity`, masks, and output paths on that fallback path."
Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/references/cli.md
+82-9Lines changed: 82 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,14 @@
1
1
# CLI reference (`scripts/image_gen.py`)
2
2
3
-
This file is for the fallback CLI mode only. Read it only after the user explicitly asks to use `scripts/image_gen.py`instead of the built-in `image_gen` tool.
3
+
This file is for the fallback CLI mode only. Read it when the user explicitly asks to use `scripts/image_gen.py`/ CLI / API / model controls, or when the user explicitly asks for transparent output that requires the `gpt-image-1.5` fallback path.
4
4
5
5
`generate-batch` is a CLI subcommand in this fallback path. It is not a top-level mode of the skill.
6
+
The word `batch` in a user request is not CLI opt-in by itself.
6
7
7
8
## What this CLI does
8
9
-`generate`: generate a new image from a prompt
9
10
-`edit`: edit one or more existing images
10
-
-`generate-batch`: run many generation jobs from a JSONL file
11
+
-`generate-batch`: run many generation jobs from a JSONL file after the user explicitly chooses CLI/API/model controls
11
12
12
13
Real API calls require **network access** + `OPENAI_API_KEY`. `--dry-run` does not.
13
14
@@ -16,7 +17,7 @@ Set a stable path to the skill CLI (default `CODEX_HOME` is `~/.codex`):
- Background: unspecified unless `--background` is set
70
71
72
+
## gpt-image-2 size and model guidance
73
+
74
+
`gpt-image-2` is the default model for new CLI fallback work.
75
+
76
+
- Use `--quality low` for fast drafts, thumbnails, and quick iterations.
77
+
- Use `--quality medium`, `--quality high`, or `--quality auto` for final assets, dense text, diagrams, identity-sensitive edits, and high-resolution outputs.
78
+
- Square images are typically fastest. Use `--size 1024x1024` for quick square drafts.
79
+
- If the user asks for 4K-style output, use `--size 3824x2160` for landscape or `--size 2160x3824` for portrait.
80
+
- Do not pass `--input-fidelity` with `gpt-image-2`; this model always uses high fidelity for image inputs.
81
+
- Do not use `--background transparent` with `gpt-image-2`; use `gpt-image-1.5` for transparent output.
82
+
83
+
Popular `gpt-image-2` sizes:
84
+
-`1024x1024`
85
+
-`1536x1024`
86
+
-`1024x1536`
87
+
-`2048x2048`
88
+
-`2048x1152`
89
+
-`3824x2160`
90
+
-`2160x3824`
91
+
-`auto`
92
+
93
+
`gpt-image-2` size constraints:
94
+
- max edge `< 3840px`
95
+
- both edges multiples of `16px`
96
+
- long edge to short edge ratio `<= 3:1`
97
+
- total pixels between `655,360` and `8,294,400`
98
+
99
+
Fast draft:
100
+
101
+
```bash
102
+
python "$IMAGE_GEN" generate \
103
+
--prompt "A product thumbnail of a matte ceramic mug on a stone surface" \
104
+
--quality low \
105
+
--size 1024x1024 \
106
+
--out output/imagegen/mug-draft.png
107
+
```
108
+
109
+
Final 2K landscape:
110
+
111
+
```bash
112
+
python "$IMAGE_GEN" generate \
113
+
--prompt "A polished landing-page hero image of a matte ceramic mug on a stone surface" \
114
+
--quality high \
115
+
--size 2048x1152 \
116
+
--out output/imagegen/mug-hero.png
117
+
```
118
+
119
+
Near-4K landscape:
120
+
121
+
```bash
122
+
python "$IMAGE_GEN" generate \
123
+
--prompt "A detailed architectural visualization at golden hour" \
124
+
--size 3824x2160 \
125
+
--quality high \
126
+
--out output/imagegen/architecture-near-4k.png
127
+
```
128
+
129
+
Transparent background request:
130
+
131
+
```bash
132
+
python "$IMAGE_GEN" generate \
133
+
--model gpt-image-1.5 \
134
+
--prompt "A clean product cutout on a transparent background" \
135
+
--background transparent \
136
+
--output-format png \
137
+
--out output/imagegen/product-cutout.png
138
+
```
139
+
140
+
When using this path, explain briefly that transparent backgrounds are not supported in `gpt-image-2`, the latest model, so `gpt-image-1.5` is required.
141
+
71
142
## Quality, input fidelity, and masks (CLI fallback only)
72
143
These are explicit CLI controls. They are not built-in `image_gen` tool arguments.
73
144
74
145
-`--quality` works for `generate`, `edit`, and `generate-batch`: `low|medium|high|auto`
75
-
-`--input-fidelity` is **edit-only** and validated as `low|high`
146
+
-`--input-fidelity` is **edit-only** and validated as `low|high`; it is not supported for `gpt-image-2`
76
147
-`--mask` is **edit-only**
77
148
78
149
Example:
79
150
80
151
```bash
81
152
python "$IMAGE_GEN" edit \
153
+
--model gpt-image-1.5 \
82
154
--image input.png \
83
155
--prompt "Change only the background" \
84
156
--quality high \
@@ -147,10 +219,11 @@ Notes:
147
219
- Per-job overrides are supported in JSONL (for example `size`, `quality`, `background`, `output_format`, `output_compression`, `moderation`, `n`, `model`, `out`, and prompt-augmentation fields).
148
220
-`--n` generates multiple variants for a single prompt; `generate-batch` is for many different prompts.
149
221
- In batch mode, per-job `out` is treated as a filename under `--out-dir`.
222
+
- For many requested deliverable assets, provide one prompt/job per distinct asset and use semantic filenames when possible.
150
223
151
224
## CLI notes
152
-
- Supported sizes:`1024x1024`, `1536x1024`, `1024x1536`, or `auto`.
153
-
- Transparent backgrounds require `output_format` to be `png` or `webp`.
225
+
- Supported sizes depend on the model. `gpt-image-2` supports flexible constrained sizes; older GPT Image models support`1024x1024`, `1536x1024`, `1024x1536`, or `auto`.
226
+
- Transparent backgrounds require `output_format` to be `png` or `webp` and are not supported by `gpt-image-2`.
154
227
-`--prompt-file`, `--output-compression`, `--moderation`, `--max-attempts`, `--fail-fast`, `--force`, and `--no-augment` are supported.
155
228
- This CLI is intended for GPT Image models. Do not assume older non-GPT image-model behavior applies here.
Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/references/codex-network.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Codex network approvals / sandbox notes
2
2
3
-
This file is for the fallback CLI mode only. Read it only after the user explicitly asks to use `scripts/image_gen.py`.
3
+
This file is for the fallback CLI mode only. Read it when the user explicitly asks to use `scripts/image_gen.py` / CLI / API / model controls, or when the user explicitly asks for transparent output that requires the `gpt-image-1.5` fallback path.
4
4
5
5
This guidance is intentionally isolated from `SKILL.md` because it can vary by environment and may become stale. Prefer the defaults in your environment when in doubt.
Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/references/image-api.md
+45-6Lines changed: 45 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,46 @@
1
1
# Image API quick reference
2
2
3
-
This file is for the fallback CLI mode only. Use it only after the user explicitly asks to use `scripts/image_gen.py`instead of the built-in `image_gen` tool.
3
+
This file is for the fallback CLI mode only. Use it when the user explicitly asks to use `scripts/image_gen.py`/ CLI / API / model controls, or when the user explicitly asks for transparent output that requires the `gpt-image-1.5` fallback path.
4
4
5
5
These parameters describe the Image API and bundled CLI fallback surface. Do not assume they are normal arguments on the built-in `image_gen` tool.
6
6
7
7
## Scope
8
-
- This fallback CLI is intended for GPT Image models (`gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`).
8
+
- This fallback CLI is intended for GPT Image models (`gpt-image-2`, `gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`).
9
9
- The built-in `image_gen` tool and the fallback CLI do not expose the same controls.
10
10
11
+
## Model summary
12
+
13
+
| Model | Quality | Input fidelity | Resolutions | Recommended use |
14
+
| --- | --- | --- | --- | --- |
15
+
|`gpt-image-2`|`low`, `medium`, `high`, `auto`| Always high fidelity for image inputs; do not set `input_fidelity`|`auto` or flexible sizes that satisfy the constraints below | Default for new CLI/API workflows: high-quality generation and editing, text-heavy images, photorealism, compositing, identity-sensitive edits, and workflows where fewer retries matter |
`gpt-image-2` accepts `auto` or any `WIDTHxHEIGHT` size that satisfies all constraints:
23
+
24
+
- Maximum edge length must be less than `3840px`.
25
+
- Both edges must be multiples of `16px`.
26
+
- Long edge to short edge ratio must not exceed `3:1`.
27
+
- Total pixels must be at least `655,360` and no more than `8,294,400`.
28
+
29
+
Popular sizes:
30
+
31
+
| Label | Size | Notes |
32
+
| --- | --- | --- |
33
+
| Square |`1024x1024`| Typical fast default |
34
+
| Landscape |`1536x1024`| Standard landscape |
35
+
| Portrait |`1024x1536`| Standard portrait |
36
+
| 2K square |`2048x2048`| Larger square output |
37
+
| 2K landscape |`2048x1152`| Widescreen output |
38
+
| Near-4K landscape |`3824x2160`| Use instead of `3840x2160`|
39
+
| Near-4K portrait |`2160x3824`| Use instead of `2160x3840`|
40
+
| Auto |`auto`| Default size |
41
+
42
+
Square images are typically fastest to generate. For 4K-style output, use `3824x2160` or `2160x3824`, not `3840x2160`, because the maximum edge length must be less than `3840px`.
@@ -16,7 +49,7 @@ These parameters describe the Image API and bundled CLI fallback surface. Do not
16
49
-`prompt`: text prompt
17
50
-`model`: image model
18
51
-`n`: number of images (1-10)
19
-
-`size`: `1024x1024`, `1536x1024`, `1024x1536`, or `auto`
52
+
-`size`: `auto` by default for `gpt-image-2`; flexible `WIDTHxHEIGHT` sizes are allowed only for `gpt-image-2`; older GPT Image models use `1024x1024`, `1536x1024`, `1024x1536`, or `auto`
20
53
-`quality`: `low`, `medium`, `high`, or `auto`
21
54
-`background`: output transparency behavior (`transparent`, `opaque`, or `auto`) for generated output; this is not the same thing as the prompt's visual scene/backdrop
22
55
-`output_format`: `png` (default), `jpeg`, `webp`
@@ -26,12 +59,17 @@ These parameters describe the Image API and bundled CLI fallback surface. Do not
26
59
## Edit-specific parameters
27
60
-`image`: one or more input images. For GPT Image models, you can provide up to 16 images.
28
61
-`mask`: optional mask image
29
-
-`input_fidelity`: `low`(default) or `high`
62
+
-`input_fidelity`: `low` or `high` only for models that support it; do not set this for `gpt-image-2`
30
63
31
64
Model-specific note for `input_fidelity`:
65
+
-`gpt-image-2` always uses high fidelity for image inputs and does not support setting `input_fidelity`.
32
66
-`gpt-image-1` and `gpt-image-1-mini` preserve all input images, but the first image gets richer textures and finer details.
33
67
-`gpt-image-1.5` preserves the first 5 input images with higher fidelity.
34
68
69
+
## Transparent backgrounds
70
+
71
+
`gpt-image-2` does not currently support transparent backgrounds. If the user explicitly asks for a transparent image or transparent background, use `gpt-image-1.5` with `background=transparent` and a transparent-capable output format such as `png` or `webp`.
72
+
35
73
## Output
36
74
-`data[]` list with `b64_json` per image
37
75
- The bundled `scripts/image_gen.py` CLI decodes `b64_json` and writes output files for you.
@@ -41,8 +79,9 @@ Model-specific note for `input_fidelity`:
41
79
- Use the edits endpoint when the user requests changes to an existing image.
42
80
- Masking is prompt-guided; exact shapes are not guaranteed.
43
81
- Large sizes and high quality increase latency and cost.
44
-
- High `input_fidelity` can materially increase input token usage.
45
-
- If a request fails because a specific option is unsupported by the selected GPT Image model, retry manually without that option.
82
+
- Use `quality=low` for fast drafts, thumbnails, and quick iterations. Use `medium` or `high` for final assets, dense text, diagrams, identity-sensitive edits, or high-resolution outputs.
83
+
- High `input_fidelity` can materially increase input token usage on models that support it.
84
+
- If a request fails because a specific option is unsupported by the selected GPT Image model, retry manually without that option only when the option is not required by the user. If transparent output is required, switch to `gpt-image-1.5` instead of dropping `background=transparent`.
46
85
47
86
## Important boundary
48
87
-`quality`, `input_fidelity`, explicit masks, `background`, `output_format`, and related parameters are fallback-only execution controls.
Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/references/prompting.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ This file is about prompt structure, specificity, and iteration. Fallback-only e
28
28
- If the user prompt is already specific and detailed, normalize it into a clean spec without adding creative requirements.
29
29
- If the prompt is generic, you may add tasteful detail when it materially improves the output.
30
30
- Treat examples in `sample-prompts.md` as fully-authored recipes, not as the default amount of augmentation to add to every request.
31
+
- For photorealism, include `photorealistic` directly when that is the goal, plus concrete real-world texture such as pores, wrinkles, fabric wear, material grain, or imperfect everyday detail.
31
32
32
33
## Allowed and disallowed augmentation
33
34
@@ -46,6 +47,7 @@ Do not add:
46
47
- Specify framing and viewpoint (close-up, wide, top-down) and placement only when it materially helps.
47
48
- Call out negative space if the asset clearly needs room for UI or copy.
48
49
- Avoid making left/right layout decisions unless the user or surrounding layout supports them.
50
+
- For people, describe body framing, scale, gaze, and object interactions when they matter (`full body visible`, `looking down at the book`, `hands naturally gripping the handlebars`).
49
51
50
52
## Constraints and invariants
51
53
- State what must not change (`keep background unchanged`).
@@ -55,6 +57,7 @@ Do not add:
55
57
- Put literal text in quotes or ALL CAPS and specify typography (font style, size, color, placement).
56
58
- Spell uncommon words letter-by-letter if accuracy matters.
57
59
- For in-image copy, require verbatim rendering and no extra characters.
60
+
- In CLI fallback mode, use `medium` or `high` quality for small text, dense infographics, data-heavy slides, multi-font layouts, legends, axes, and footnotes.
58
61
59
62
## Input images and references
60
63
- Do not assume that every provided image is an edit target.
@@ -71,15 +74,22 @@ Do not add:
71
74
## Fallback-only execution controls
72
75
-`quality`, `input_fidelity`, explicit masks, output format, and output paths are fallback-only execution controls.
73
76
- Do not assume they are built-in `image_gen` tool arguments.
74
-
- If the user explicitly chooses CLI fallback, see `references/cli.md` and `references/image-api.md` for those controls.
77
+
- If the user explicitly chooses CLI fallback or explicitly asks for transparent output, see `references/cli.md` and `references/image-api.md` for those controls.
78
+
- In CLI fallback mode, `gpt-image-2` is the default. It supports `quality=low|medium|high|auto`; use `low` for fast drafts and thumbnails, and move to `medium`, `high`, or `auto` for final assets.
79
+
-`gpt-image-2` always uses high fidelity for image inputs, so do not set `input_fidelity` with that model.
80
+
- If the user explicitly asks for transparent output, use `gpt-image-1.5` and explain that transparent backgrounds are not supported in `gpt-image-2`, the latest model.
81
+
- If the user asks for 4K-style output with `gpt-image-2`, use `3824x2160` for landscape or `2160x3824` for portrait.
75
82
76
83
## Use-case tips
77
84
Generate:
78
85
- photorealistic-natural: Prompt as if a real photo is captured in the moment; use photography language (lens, lighting, framing); call for real texture; avoid over-stylized polish unless requested.
79
86
- product-mockup: Describe the product/packaging and materials; ensure clean silhouette and label clarity; if in-image text is needed, require verbatim rendering and specify typography.
80
87
- ui-mockup: Describe the target fidelity first (shippable mockup or low-fi wireframe), then focus on layout, hierarchy, and practical UI elements; avoid concept-art language.
81
-
- infographic-diagram: Define the audience and layout flow; label parts explicitly; require verbatim text.
88
+
- infographic-diagram: Define the audience and layout flow; label parts explicitly; require verbatim text; prefer higher quality in CLI mode for dense labels.
82
89
- logo-brand: Keep it simple and scalable; ask for a strong silhouette and balanced negative space; avoid decorative flourishes unless requested.
90
+
- ads-marketing: Write like a creative brief; include brand positioning, audience, desired vibe, scene, and exact tagline if text must appear.
91
+
- productivity-visual: Name the exact artifact (slide, chart, workflow diagram), define the canvas and hierarchy, provide real labels/data, and ask for readable typography and polished spacing.
Copy file name to clipboardExpand all lines: codex-rs/skills/src/assets/samples/imagegen/references/sample-prompts.md
+58-2Lines changed: 58 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
These prompt recipes are shared across both top-level modes of the skill:
4
4
- built-in `image_gen` tool (default)
5
-
-explicit `scripts/image_gen.py` CLI fallback
5
+
-`scripts/image_gen.py` CLI fallback for explicit CLI/API/model requests or explicit transparent-output requests
6
6
7
7
Use these as starting points. They are intentionally complete prompt recipes, not the default amount of augmentation to add to every user request.
8
8
@@ -13,7 +13,14 @@
13
13
14
14
The labeled lines are prompt scaffolding, not a closed schema. `Asset type` and `Input images` are prompt-only scaffolding; the CLI does not expose them as dedicated flags.
15
15
16
-
Execution details such as explicit CLI flags, `quality`, `input_fidelity`, masks, output formats, and local output paths depend on mode. Use the built-in tool by default; only apply CLI-specific controls after the user explicitly opts into fallback mode.
16
+
Execution details such as explicit CLI flags, `quality`, `input_fidelity`, masks, output formats, and local output paths depend on mode. Use the built-in tool by default; only apply CLI-specific controls when the user explicitly opts into fallback mode or explicitly asks for transparent output.
17
+
18
+
CLI model notes:
19
+
-`gpt-image-2` is the fallback CLI default for new workflows.
20
+
-`gpt-image-2` supports `quality` values `low`, `medium`, `high`, and `auto`.
21
+
- For 4K-style `gpt-image-2` output, use `3824x2160` or `2160x3824` instead of `3840x2160`.
22
+
- If transparent output is explicitly required, use `gpt-image-1.5` and explain that transparent backgrounds are not supported in `gpt-image-2`, the latest model.
23
+
- Do not set `input_fidelity` with `gpt-image-2`; image inputs already use high fidelity.
17
24
18
25
For prompting principles (structure, specificity, invariants, iteration), see `references/prompting.md`.
19
26
@@ -68,6 +75,18 @@
68
75
Constraints: clear labels, strong contrast, no logos or trademarks, no watermark
69
76
```
70
77
78
+
### scientific-educational
79
+
```
80
+
Use case: scientific-educational
81
+
Primary request: biology diagram titled "Cellular Respiration at a Glance" for high school students
82
+
Scene/backdrop: clean white classroom handout background
83
+
Subject: glucose turns into energy inside a cell; include glycolysis, Krebs cycle, and electron transport chain
84
+
Style/medium: flat scientific diagram with consistent icons, arrows, and readable labels
85
+
Composition/framing: landscape slide-style layout with clear hierarchy and generous whitespace
86
+
Text (verbatim): "Cellular Respiration at a Glance", "Glucose", "Pyruvate", "ATP", "NADH", "FADH2", "CO2", "O2", "H2O"
87
+
Constraints: scientifically plausible; avoid tiny text; no extra decoration; no watermark
88
+
```
89
+
71
90
### logo-brand
72
91
```
73
92
Use case: logo-brand
@@ -100,6 +119,30 @@
100
119
Constraints: no logos or trademarks; no watermark
101
120
```
102
121
122
+
### ads-marketing
123
+
```
124
+
Use case: ads-marketing
125
+
Primary request: campaign image for a streetwear brand called Thread
126
+
Subject: group of friends hanging out together in a stylish urban setting
0 commit comments