Add eight RoboLab harness evaluation log snapshots

#3
by bobbma - opened
This view is limited to 50 files because it contains too many changes. See the raw diff here.
Files changed (50) hide show
  1. .gitattributes +222 -0
  2. 20261001T054755.827592Z_eval/episode-0001/events.jsonl +3 -0
  3. 20261001T054755.827592Z_eval/episode-0001/stderr.log +3 -0
  4. 20261001T054755.827592Z_eval/episode-0002/events.jsonl +3 -0
  5. 20261001T054755.827592Z_eval/episode-0002/stderr.log +2 -0
  6. 20261001T054755.827592Z_eval/episode-0003/events.jsonl +3 -0
  7. 20261001T054755.827592Z_eval/episode-0003/stderr.log +2 -0
  8. 20261001T054755.827592Z_eval/episode-0004/events.jsonl +3 -0
  9. 20261001T054755.827592Z_eval/episode-0004/stderr.log +1 -0
  10. 20261001T054755.827592Z_eval/episode-0005/events.jsonl +3 -0
  11. 20261001T054755.827592Z_eval/episode-0005/stderr.log +2 -0
  12. 20261001T054755.827592Z_eval/episode-0006/events.jsonl +3 -0
  13. 20261001T054755.827592Z_eval/episode-0006/stderr.log +2 -0
  14. 20261001T054755.827592Z_eval/episode-0007/events.jsonl +3 -0
  15. 20261001T054755.827592Z_eval/episode-0007/stderr.log +3 -0
  16. 20261001T054755.827592Z_eval/episode-0008/events.jsonl +3 -0
  17. 20261001T054755.827592Z_eval/episode-0008/stderr.log +0 -0
  18. 20261001T054755.827592Z_eval/episode-0009/events.jsonl +3 -0
  19. 20261001T054755.827592Z_eval/episode-0009/stderr.log +1 -0
  20. 20261001T054755.827592Z_eval/episode-0010/events.jsonl +3 -0
  21. 20261001T054755.827592Z_eval/episode-0010/stderr.log +2 -0
  22. 20261001T054755.827592Z_eval/episode-0011/events.jsonl +3 -0
  23. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/.sandbox_migration +1 -0
  24. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/config.toml +2 -0
  25. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite +0 -0
  26. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite-shm +0 -0
  27. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite-wal +3 -0
  28. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/installation_id +1 -0
  29. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite +3 -0
  30. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite-shm +0 -0
  31. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite-wal +3 -0
  32. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/memories_1.sqlite +0 -0
  33. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/queue_1.sqlite +0 -0
  34. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/queue_1.sqlite-shm +0 -0
  35. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/queue_1.sqlite-wal +0 -0
  36. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/sessions/2026/10/01/rollout-2026-10-01T13-16-43-01a0f79c-2ee9-7043-a46b-1bfe1743d6c7.jsonl +3 -0
  37. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/.codex-system-skills.marker +1 -0
  38. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/LICENSE.txt +201 -0
  39. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/SKILL.md +315 -0
  40. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/agents/openai.yaml +6 -0
  41. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/assets/imagegen-small.svg +5 -0
  42. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/assets/imagegen.png +3 -0
  43. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/cli.md +242 -0
  44. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/codex-network.md +33 -0
  45. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/image-api.md +90 -0
  46. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/prompting.md +112 -0
  47. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/sample-prompts.md +422 -0
  48. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/scripts/image_gen.py +1030 -0
  49. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/scripts/remove_chroma_key.py +449 -0
  50. 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/openai-docs/LICENSE.txt +201 -0
.gitattributes CHANGED
@@ -283,3 +283,225 @@ BananaInBowlTask/run_0.hdf5 filter=lfs diff=lfs merge=lfs -text
283
  2026-09-30_14-45-15_harness/FoodPacking3BoxesTask/run_7.hdf5 filter=lfs diff=lfs merge=lfs -text
284
  2026-09-30_14-45-15_harness/FoodPacking3BoxesTask/run_8.hdf5 filter=lfs diff=lfs merge=lfs -text
285
  2026-09-30_14-45-15_harness/FoodPacking3BoxesTask/run_9.hdf5 filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  2026-09-30_14-45-15_harness/FoodPacking3BoxesTask/run_7.hdf5 filter=lfs diff=lfs merge=lfs -text
284
  2026-09-30_14-45-15_harness/FoodPacking3BoxesTask/run_8.hdf5 filter=lfs diff=lfs merge=lfs -text
285
  2026-09-30_14-45-15_harness/FoodPacking3BoxesTask/run_9.hdf5 filter=lfs diff=lfs merge=lfs -text
286
+ 20261001T054755.827592Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
287
+ 20261001T054755.827592Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
288
+ 20261001T054755.827592Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
289
+ 20261001T054755.827592Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
290
+ 20261001T054755.827592Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
291
+ 20261001T054755.827592Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
292
+ 20261001T054755.827592Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
293
+ 20261001T054755.827592Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
294
+ 20261001T054755.827592Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
295
+ 20261001T054755.827592Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
296
+ 20261001T054755.827592Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
297
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
298
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
299
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
300
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/sessions/2026/10/01/rollout-2026-10-01T13-16-43-01a0f79c-2ee9-7043-a46b-1bfe1743d6c7.jsonl filter=lfs diff=lfs merge=lfs -text
301
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
302
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
303
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/thread_history_1.sqlite filter=lfs diff=lfs merge=lfs -text
304
+ 20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
305
+ 20261001T054825.295983Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
306
+ 20261001T054825.295983Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
307
+ 20261001T054825.295983Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
308
+ 20261001T054825.295983Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
309
+ 20261001T054825.295983Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
310
+ 20261001T054825.295983Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
311
+ 20261001T054825.295983Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
312
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
313
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
314
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/sessions/2026/10/01/rollout-2026-10-01T13-01-29-01a0f78e-3e48-7590-bea8-8c3c12d9c1f8.jsonl filter=lfs diff=lfs merge=lfs -text
315
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
316
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
317
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/thread_history_1.sqlite filter=lfs diff=lfs merge=lfs -text
318
+ 20261001T054825.295983Z_eval/episode-0007/runtime_bkbrzat9/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
319
+ 20261001T054855.610175Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
320
+ 20261001T054855.610175Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
321
+ 20261001T054855.610175Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
322
+ 20261001T054855.610175Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
323
+ 20261001T054855.610175Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
324
+ 20261001T054855.610175Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
325
+ 20261001T054855.610175Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
326
+ 20261001T054855.610175Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
327
+ 20261001T054855.610175Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
328
+ 20261001T054855.610175Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
329
+ 20261001T054855.610175Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
330
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
331
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
332
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
333
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/sessions/2026/10/01/rollout-2026-10-01T13-42-40-01a0f7b3-f386-7143-b537-6eb35e3d3742.jsonl filter=lfs diff=lfs merge=lfs -text
334
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
335
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
336
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/thread_history_1.sqlite filter=lfs diff=lfs merge=lfs -text
337
+ 20261001T054855.610175Z_eval/episode-0011/runtime_h28ido4s/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
338
+ 20261001T054926.055590Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
339
+ 20261001T054926.055590Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
340
+ 20261001T054926.055590Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
341
+ 20261001T054926.055590Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
342
+ 20261001T054926.055590Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
343
+ 20261001T054926.055590Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
344
+ 20261001T054926.055590Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
345
+ 20261001T054926.055590Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
346
+ 20261001T054926.055590Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
347
+ 20261001T054926.055590Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
348
+ 20261001T054926.055590Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
349
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
350
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
351
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
352
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/sessions/2026/10/01/rollout-2026-10-01T13-47-15-01a0f7b8-239e-77b1-9803-10cdf21b6ad0.jsonl filter=lfs diff=lfs merge=lfs -text
353
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
354
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
355
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/thread_history_1.sqlite filter=lfs diff=lfs merge=lfs -text
356
+ 20261001T054926.055590Z_eval/episode-0011/runtime_p9_jc14s/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
357
+ 20261001T054956.522752Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
358
+ 20261001T054956.522752Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
359
+ 20261001T054956.522752Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
360
+ 20261001T054956.522752Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
361
+ 20261001T054956.522752Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
362
+ 20261001T054956.522752Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
363
+ 20261001T054956.522752Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
364
+ 20261001T054956.522752Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
365
+ 20261001T054956.522752Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
366
+ 20261001T054956.522752Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
367
+ 20261001T054956.522752Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
368
+ 20261001T054956.522752Z_eval/episode-0012/events.jsonl filter=lfs diff=lfs merge=lfs -text
369
+ 20261001T054956.522752Z_eval/episode-0013/events.jsonl filter=lfs diff=lfs merge=lfs -text
370
+ 20261001T054956.522752Z_eval/episode-0014/events.jsonl filter=lfs diff=lfs merge=lfs -text
371
+ 20261001T054956.522752Z_eval/episode-0015/events.jsonl filter=lfs diff=lfs merge=lfs -text
372
+ 20261001T054956.522752Z_eval/episode-0016/events.jsonl filter=lfs diff=lfs merge=lfs -text
373
+ 20261001T054956.522752Z_eval/episode-0017/events.jsonl filter=lfs diff=lfs merge=lfs -text
374
+ 20261001T054956.522752Z_eval/episode-0018/events.jsonl filter=lfs diff=lfs merge=lfs -text
375
+ 20261001T054956.522752Z_eval/episode-0019/events.jsonl filter=lfs diff=lfs merge=lfs -text
376
+ 20261001T054956.522752Z_eval/episode-0020/events.jsonl filter=lfs diff=lfs merge=lfs -text
377
+ 20261001T054956.522752Z_eval/episode-0021/events.jsonl filter=lfs diff=lfs merge=lfs -text
378
+ 20261001T054956.522752Z_eval/episode-0022/events.jsonl filter=lfs diff=lfs merge=lfs -text
379
+ 20261001T054956.522752Z_eval/episode-0023/events.jsonl filter=lfs diff=lfs merge=lfs -text
380
+ 20261001T054956.522752Z_eval/episode-0024/events.jsonl filter=lfs diff=lfs merge=lfs -text
381
+ 20261001T054956.522752Z_eval/episode-0025/events.jsonl filter=lfs diff=lfs merge=lfs -text
382
+ 20261001T054956.522752Z_eval/episode-0026/events.jsonl filter=lfs diff=lfs merge=lfs -text
383
+ 20261001T054956.522752Z_eval/episode-0027/events.jsonl filter=lfs diff=lfs merge=lfs -text
384
+ 20261001T054956.522752Z_eval/episode-0028/events.jsonl filter=lfs diff=lfs merge=lfs -text
385
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
386
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
387
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
388
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/sessions/2026/10/01/rollout-2026-10-01T13-56-00-01a0f7c0-25b7-79a1-ad15-f07d2a42b169.jsonl filter=lfs diff=lfs merge=lfs -text
389
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
390
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
391
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/thread_history_1.sqlite filter=lfs diff=lfs merge=lfs -text
392
+ 20261001T054956.522752Z_eval/episode-0028/runtime_fdr2m6v1/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
393
+ 20261001T055026.396266Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
394
+ 20261001T055026.396266Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
395
+ 20261001T055026.396266Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
396
+ 20261001T055026.396266Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
397
+ 20261001T055026.396266Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
398
+ 20261001T055026.396266Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
399
+ 20261001T055026.396266Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
400
+ 20261001T055026.396266Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
401
+ 20261001T055026.396266Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
402
+ 20261001T055026.396266Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
403
+ 20261001T055026.396266Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
404
+ 20261001T055026.396266Z_eval/episode-0012/events.jsonl filter=lfs diff=lfs merge=lfs -text
405
+ 20261001T055026.396266Z_eval/episode-0013/events.jsonl filter=lfs diff=lfs merge=lfs -text
406
+ 20261001T055026.396266Z_eval/episode-0014/events.jsonl filter=lfs diff=lfs merge=lfs -text
407
+ 20261001T055026.396266Z_eval/episode-0015/events.jsonl filter=lfs diff=lfs merge=lfs -text
408
+ 20261001T055026.396266Z_eval/episode-0016/events.jsonl filter=lfs diff=lfs merge=lfs -text
409
+ 20261001T055026.396266Z_eval/episode-0017/events.jsonl filter=lfs diff=lfs merge=lfs -text
410
+ 20261001T055026.396266Z_eval/episode-0018/events.jsonl filter=lfs diff=lfs merge=lfs -text
411
+ 20261001T055026.396266Z_eval/episode-0018/runtime_9bn7qoe_/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
412
+ 20261001T055026.396266Z_eval/episode-0018/runtime_9bn7qoe_/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
413
+ 20261001T055026.396266Z_eval/episode-0018/runtime_9bn7qoe_/codex/sessions/2026/10/01/rollout-2026-10-01T14-02-46-01a0f7c6-584f-7152-9a0f-cebe5f1a3875.jsonl filter=lfs diff=lfs merge=lfs -text
414
+ 20261001T055026.396266Z_eval/episode-0018/runtime_9bn7qoe_/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
415
+ 20261001T055026.396266Z_eval/episode-0018/runtime_9bn7qoe_/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
416
+ 20261001T055056.845440Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
417
+ 20261001T055056.845440Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
418
+ 20261001T055056.845440Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
419
+ 20261001T055056.845440Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
420
+ 20261001T055056.845440Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
421
+ 20261001T055056.845440Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
422
+ 20261001T055056.845440Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
423
+ 20261001T055056.845440Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
424
+ 20261001T055056.845440Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
425
+ 20261001T055056.845440Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
426
+ 20261001T055056.845440Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
427
+ 20261001T055056.845440Z_eval/episode-0012/events.jsonl filter=lfs diff=lfs merge=lfs -text
428
+ 20261001T055056.845440Z_eval/episode-0013/events.jsonl filter=lfs diff=lfs merge=lfs -text
429
+ 20261001T055056.845440Z_eval/episode-0014/events.jsonl filter=lfs diff=lfs merge=lfs -text
430
+ 20261001T055056.845440Z_eval/episode-0015/events.jsonl filter=lfs diff=lfs merge=lfs -text
431
+ 20261001T055056.845440Z_eval/episode-0016/events.jsonl filter=lfs diff=lfs merge=lfs -text
432
+ 20261001T055056.845440Z_eval/episode-0017/events.jsonl filter=lfs diff=lfs merge=lfs -text
433
+ 20261001T055056.845440Z_eval/episode-0018/events.jsonl filter=lfs diff=lfs merge=lfs -text
434
+ 20261001T055056.845440Z_eval/episode-0019/events.jsonl filter=lfs diff=lfs merge=lfs -text
435
+ 20261001T055056.845440Z_eval/episode-0020/events.jsonl filter=lfs diff=lfs merge=lfs -text
436
+ 20261001T055056.845440Z_eval/episode-0021/events.jsonl filter=lfs diff=lfs merge=lfs -text
437
+ 20261001T055056.845440Z_eval/episode-0022/events.jsonl filter=lfs diff=lfs merge=lfs -text
438
+ 20261001T055056.845440Z_eval/episode-0023/events.jsonl filter=lfs diff=lfs merge=lfs -text
439
+ 20261001T055056.845440Z_eval/episode-0024/events.jsonl filter=lfs diff=lfs merge=lfs -text
440
+ 20261001T055056.845440Z_eval/episode-0025/events.jsonl filter=lfs diff=lfs merge=lfs -text
441
+ 20261001T055056.845440Z_eval/episode-0026/events.jsonl filter=lfs diff=lfs merge=lfs -text
442
+ 20261001T055056.845440Z_eval/episode-0027/events.jsonl filter=lfs diff=lfs merge=lfs -text
443
+ 20261001T055056.845440Z_eval/episode-0028/events.jsonl filter=lfs diff=lfs merge=lfs -text
444
+ 20261001T055056.845440Z_eval/episode-0029/events.jsonl filter=lfs diff=lfs merge=lfs -text
445
+ 20261001T055056.845440Z_eval/episode-0030/events.jsonl filter=lfs diff=lfs merge=lfs -text
446
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
447
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
448
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
449
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/sessions/2026/10/01/rollout-2026-10-01T13-39-28-01a0f7b1-03ea-7d52-8cbb-6c690c33bbe6.jsonl filter=lfs diff=lfs merge=lfs -text
450
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
451
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
452
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/thread_history_1.sqlite filter=lfs diff=lfs merge=lfs -text
453
+ 20261001T055056.845440Z_eval/episode-0030/runtime_31lwt028/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
454
+ 20261001T055127.530314Z_eval/episode-0001/events.jsonl filter=lfs diff=lfs merge=lfs -text
455
+ 20261001T055127.530314Z_eval/episode-0002/events.jsonl filter=lfs diff=lfs merge=lfs -text
456
+ 20261001T055127.530314Z_eval/episode-0003/events.jsonl filter=lfs diff=lfs merge=lfs -text
457
+ 20261001T055127.530314Z_eval/episode-0004/events.jsonl filter=lfs diff=lfs merge=lfs -text
458
+ 20261001T055127.530314Z_eval/episode-0005/events.jsonl filter=lfs diff=lfs merge=lfs -text
459
+ 20261001T055127.530314Z_eval/episode-0006/events.jsonl filter=lfs diff=lfs merge=lfs -text
460
+ 20261001T055127.530314Z_eval/episode-0007/events.jsonl filter=lfs diff=lfs merge=lfs -text
461
+ 20261001T055127.530314Z_eval/episode-0008/events.jsonl filter=lfs diff=lfs merge=lfs -text
462
+ 20261001T055127.530314Z_eval/episode-0009/events.jsonl filter=lfs diff=lfs merge=lfs -text
463
+ 20261001T055127.530314Z_eval/episode-0010/events.jsonl filter=lfs diff=lfs merge=lfs -text
464
+ 20261001T055127.530314Z_eval/episode-0011/events.jsonl filter=lfs diff=lfs merge=lfs -text
465
+ 20261001T055127.530314Z_eval/episode-0012/events.jsonl filter=lfs diff=lfs merge=lfs -text
466
+ 20261001T055127.530314Z_eval/episode-0013/events.jsonl filter=lfs diff=lfs merge=lfs -text
467
+ 20261001T055127.530314Z_eval/episode-0014/events.jsonl filter=lfs diff=lfs merge=lfs -text
468
+ 20261001T055127.530314Z_eval/episode-0015/events.jsonl filter=lfs diff=lfs merge=lfs -text
469
+ 20261001T055127.530314Z_eval/episode-0016/events.jsonl filter=lfs diff=lfs merge=lfs -text
470
+ 20261001T055127.530314Z_eval/episode-0017/events.jsonl filter=lfs diff=lfs merge=lfs -text
471
+ 20261001T055127.530314Z_eval/episode-0018/events.jsonl filter=lfs diff=lfs merge=lfs -text
472
+ 20261001T055127.530314Z_eval/episode-0019/events.jsonl filter=lfs diff=lfs merge=lfs -text
473
+ 20261001T055127.530314Z_eval/episode-0020/events.jsonl filter=lfs diff=lfs merge=lfs -text
474
+ 20261001T055127.530314Z_eval/episode-0021/events.jsonl filter=lfs diff=lfs merge=lfs -text
475
+ 20261001T055127.530314Z_eval/episode-0022/events.jsonl filter=lfs diff=lfs merge=lfs -text
476
+ 20261001T055127.530314Z_eval/episode-0023/events.jsonl filter=lfs diff=lfs merge=lfs -text
477
+ 20261001T055127.530314Z_eval/episode-0024/events.jsonl filter=lfs diff=lfs merge=lfs -text
478
+ 20261001T055127.530314Z_eval/episode-0025/events.jsonl filter=lfs diff=lfs merge=lfs -text
479
+ 20261001T055127.530314Z_eval/episode-0026/events.jsonl filter=lfs diff=lfs merge=lfs -text
480
+ 20261001T055127.530314Z_eval/episode-0027/events.jsonl filter=lfs diff=lfs merge=lfs -text
481
+ 20261001T055127.530314Z_eval/episode-0028/events.jsonl filter=lfs diff=lfs merge=lfs -text
482
+ 20261001T055127.530314Z_eval/episode-0029/events.jsonl filter=lfs diff=lfs merge=lfs -text
483
+ 20261001T055127.530314Z_eval/episode-0030/events.jsonl filter=lfs diff=lfs merge=lfs -text
484
+ 20261001T055127.530314Z_eval/episode-0031/events.jsonl filter=lfs diff=lfs merge=lfs -text
485
+ 20261001T055127.530314Z_eval/episode-0032/events.jsonl filter=lfs diff=lfs merge=lfs -text
486
+ 20261001T055127.530314Z_eval/episode-0033/events.jsonl filter=lfs diff=lfs merge=lfs -text
487
+ 20261001T055127.530314Z_eval/episode-0034/events.jsonl filter=lfs diff=lfs merge=lfs -text
488
+ 20261001T055127.530314Z_eval/episode-0035/events.jsonl filter=lfs diff=lfs merge=lfs -text
489
+ 20261001T055127.530314Z_eval/episode-0036/events.jsonl filter=lfs diff=lfs merge=lfs -text
490
+ 20261001T055127.530314Z_eval/episode-0037/events.jsonl filter=lfs diff=lfs merge=lfs -text
491
+ 20261001T055127.530314Z_eval/episode-0038/events.jsonl filter=lfs diff=lfs merge=lfs -text
492
+ 20261001T055127.530314Z_eval/episode-0039/events.jsonl filter=lfs diff=lfs merge=lfs -text
493
+ 20261001T055127.530314Z_eval/episode-0040/events.jsonl filter=lfs diff=lfs merge=lfs -text
494
+ 20261001T055127.530314Z_eval/episode-0041/events.jsonl filter=lfs diff=lfs merge=lfs -text
495
+ 20261001T055127.530314Z_eval/episode-0042/events.jsonl filter=lfs diff=lfs merge=lfs -text
496
+ 20261001T055127.530314Z_eval/episode-0043/events.jsonl filter=lfs diff=lfs merge=lfs -text
497
+ 20261001T055127.530314Z_eval/episode-0044/events.jsonl filter=lfs diff=lfs merge=lfs -text
498
+ 20261001T055127.530314Z_eval/episode-0045/events.jsonl filter=lfs diff=lfs merge=lfs -text
499
+ 20261001T055127.530314Z_eval/episode-0046/events.jsonl filter=lfs diff=lfs merge=lfs -text
500
+ 20261001T055127.530314Z_eval/episode-0047/events.jsonl filter=lfs diff=lfs merge=lfs -text
501
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/goals_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
502
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/logs_2.sqlite filter=lfs diff=lfs merge=lfs -text
503
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/logs_2.sqlite-wal filter=lfs diff=lfs merge=lfs -text
504
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/sessions/2026/10/01/rollout-2026-10-01T13-58-07-01a0f7c2-1858-7ca3-98c8-66902dc5e092.jsonl filter=lfs diff=lfs merge=lfs -text
505
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/state_5.sqlite filter=lfs diff=lfs merge=lfs -text
506
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/state_5.sqlite-wal filter=lfs diff=lfs merge=lfs -text
507
+ 20261001T055127.530314Z_eval/episode-0047/runtime_tuz2902f/codex/thread_history_1.sqlite-wal filter=lfs diff=lfs merge=lfs -text
20261001T054755.827592Z_eval/episode-0001/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a013cb9a664eef7883cf65334fd72142064c99e8b067d7b9cf955650b0fdcce
3
+ size 56508154
20261001T054755.827592Z_eval/episode-0001/stderr.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-10-01T05:55:49.635583Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
2
+ 2026-10-01T06:04:39.743152Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
3
+ 2026-10-01T06:04:49.356338Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0001/runtime_5ailebky/workspace/exterior.png`: No such file or directory (os error 2)
20261001T054755.827592Z_eval/episode-0002/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50f10623d07f34020446aa3cb7642cf915292a463db71a8d5efb53cb404d307f
3
+ size 29684816
20261001T054755.827592Z_eval/episode-0002/stderr.log ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 2026-10-01T06:40:22.532655Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
2
+ 2026-10-01T06:53:12.647591Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0002/runtime_nzwibs51/workspace/wrist_zoom.png`: No such file or directory (os error 2)
20261001T054755.827592Z_eval/episode-0003/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92bbd09c2348116c21000c557fc2360091056e32402de348940c57c6bd39d4ca
3
+ size 43186864
20261001T054755.827592Z_eval/episode-0003/stderr.log ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 2026-10-01T07:14:45.398918Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
2
+ 2026-10-01T07:15:00.180056Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0003/runtime_golgi48l/workspace/exterior.png`: No such file or directory (os error 2)
20261001T054755.827592Z_eval/episode-0004/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9932750604777f00db5f1bfff02f27eb153115f285e3dab5b23f45569015d90
3
+ size 28596945
20261001T054755.827592Z_eval/episode-0004/stderr.log ADDED
@@ -0,0 +1 @@
 
 
1
+ 2026-10-01T08:02:36.841362Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
20261001T054755.827592Z_eval/episode-0005/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36aa21bc8bafcd13d8db80f4ba59cae14ed1ed9fddd14eeff27d13207353f1d8
3
+ size 58269568
20261001T054755.827592Z_eval/episode-0005/stderr.log ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 2026-10-01T08:18:59.545140Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0005/runtime_9g5zydhw/workspace/wrist.png`: No such file or directory (os error 2)
2
+ 2026-10-01T08:31:57.113495Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
20261001T054755.827592Z_eval/episode-0006/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:086b82ec1a87c874ce22f1a3326c8dbcf5395da26b6d393384bf981a9cdac36b
3
+ size 48066651
20261001T054755.827592Z_eval/episode-0006/stderr.log ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 2026-10-01T09:19:00.162764Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0006/runtime_kojio0kb/workspace/wrist.png`: No such file or directory (os error 2)
2
+ 2026-10-01T09:19:11.921498Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
20261001T054755.827592Z_eval/episode-0007/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12764650964233784073fac2f339ce426a8427121ce0e997ca8e9ef654c9ec35
3
+ size 34482523
20261001T054755.827592Z_eval/episode-0007/stderr.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-10-01T10:07:19.624955Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
2
+ 2026-10-01T10:07:26.917030Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0007/runtime_hdghxfnw/workspace/wrist_image.png`: No such file or directory (os error 2)
3
+ 2026-10-01T10:10:20.576085Z ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message: "Rejected(\"Failed to create unified exec process: Argument list too long (os error 7)\")" }
20261001T054755.827592Z_eval/episode-0008/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d62c3815096339694084533f480771df1beea25fc715287e95bed6a10ff94ff1
3
+ size 35220571
20261001T054755.827592Z_eval/episode-0008/stderr.log ADDED
File without changes
20261001T054755.827592Z_eval/episode-0009/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:731ed8cd524bac8346e156ba2c29b858e090fec933e473fcabfb9ba58ed09213
3
+ size 43081081
20261001T054755.827592Z_eval/episode-0009/stderr.log ADDED
@@ -0,0 +1 @@
 
 
1
+ 2026-10-01T11:38:55.342113Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0009/runtime_d0oncyr8/workspace/wrist.png`: No such file or directory (os error 2)
20261001T054755.827592Z_eval/episode-0010/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a951ea392fcb1a7359093360d21d1e9e19106e43919702efe5ee1bcad2b71ebc
3
+ size 61171046
20261001T054755.827592Z_eval/episode-0010/stderr.log ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ 2026-10-01T12:28:16.595280Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0010/runtime_9edfxpjo/workspace/exterior.png`: No such file or directory (os error 2)
2
+ 2026-10-01T12:28:16.595367Z ERROR codex_core::tools::router: error=unable to locate image at `/home/myx/codebase/outputs/harness/20261001T054755.827592Z_eval/episode-0010/runtime_9edfxpjo/workspace/wrist.png`: No such file or directory (os error 2)
20261001T054755.827592Z_eval/episode-0011/events.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1559bc451911f9732c739771bd800ad5b382c769448541d82bcb1f604bf60550
3
+ size 32341715
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/.sandbox_migration ADDED
@@ -0,0 +1 @@
 
 
1
+ v1
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/config.toml ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [projects."/home/myx/codebase"]
2
+ trust_level = "trusted"
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite ADDED
Binary file (32.8 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite-shm ADDED
Binary file (32.8 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/goals_1.sqlite-wal ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8cce88043b2d61f8bf83c93291af64c79478cb93f231732752ee624a43437cb
3
+ size 131872
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/installation_id ADDED
@@ -0,0 +1 @@
 
 
1
+ 0f3cc0fa-44be-4d1a-9308-92c743964c47
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46c32d9173b1091a503fcb64dc4039eb3ff695236925d0f5a18176932475d4cd
3
+ size 13627392
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite-shm ADDED
Binary file (32.8 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/logs_2.sqlite-wal ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4e1a75c391aeb33773d2694c52d05533fc7dc10b6e84eb14aa98dc705654b67
3
+ size 4470232
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/memories_1.sqlite ADDED
Binary file (45.1 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/queue_1.sqlite ADDED
Binary file (4.1 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/queue_1.sqlite-shm ADDED
Binary file (32.8 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/queue_1.sqlite-wal ADDED
Binary file (82.4 kB). View file
 
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/sessions/2026/10/01/rollout-2026-10-01T13-16-43-01a0f79c-2ee9-7043-a46b-1bfe1743d6c7.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4cf16a02fbadb6ce848640e4e1bdc099a1828e3efb4f8d392e7dab8cc32af9e
3
+ size 32392265
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/.codex-system-skills.marker ADDED
@@ -0,0 +1 @@
 
 
1
+ 4af37f669ff79b4f
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/LICENSE.txt ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf of
171
+ any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don\'t include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/SKILL.md ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: "imagegen"
3
+ description: "Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas."
4
+ ---
5
+
6
+ # Image Generation Skill
7
+
8
+ Generates or edits images for the current project (for example website assets, game assets, UI mockups, product mockups, wireframes, logo design, photorealistic images, or infographics).
9
+
10
+ ## Top-level modes and rules
11
+
12
+ This skill has exactly two top-level modes:
13
+
14
+ - **Default built-in tool mode (preferred):** built-in `image_gen` tool for image generation, editing, and transparent-image requests. Does not require `OPENAI_API_KEY`.
15
+ - **Fallback CLI mode:** `scripts/image_gen.py` CLI. Use when the user explicitly asks for or confirms the CLI/API/model path. Requires `OPENAI_API_KEY`.
16
+
17
+ Within CLI fallback, the CLI exposes three subcommands:
18
+
19
+ - `generate`
20
+ - `edit`
21
+ - `generate-batch`
22
+
23
+ Rules:
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
+ - For transparent images, ask built-in `image_gen` for a transparent background and preserve the generated alpha.
27
+ - Never silently switch from built-in `image_gen` or CLI `gpt-image-2` to CLI `gpt-image-1.5`; ask the user first unless they explicitly requested `gpt-image-1.5`.
28
+ - 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.
29
+ - 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.
30
+ - If the user explicitly asks for CLI mode, use the bundled `scripts/image_gen.py` workflow. Do not create one-off SDK runners.
31
+ - Never modify `scripts/image_gen.py`. If something is missing, ask the user before doing anything else.
32
+
33
+ Built-in save-path policy:
34
+ - In built-in tool mode, Codex saves generated images under `$CODEX_HOME/*` by default.
35
+ - Do not describe or rely on OS temp as the default built-in destination.
36
+ - Do not describe or rely on a destination-path argument (if any) on the built-in `image_gen` tool. If a specific location is needed, generate first and then move or copy the selected output from `$CODEX_HOME/generated_images/...`.
37
+ - Save-path precedence in built-in mode:
38
+ 1. If the user names a destination, move or copy the selected output there.
39
+ 2. If the image is meant for the current project, move or copy the final selected image into the workspace before finishing.
40
+ 3. If the image is only for preview or brainstorming, render it inline; the underlying file can remain at the default `$CODEX_HOME/*` path.
41
+ - Never leave a project-referenced asset only at the default `$CODEX_HOME/*` path.
42
+ - Do not overwrite an existing asset unless the user explicitly asked for replacement; otherwise create a sibling versioned filename such as `hero-v2.png` or `item-icon-edited.png`.
43
+
44
+ Shared prompt guidance for both modes lives in `references/prompting.md` and `references/sample-prompts.md`.
45
+
46
+ Fallback-only docs/resources for CLI mode:
47
+ - `references/cli.md`
48
+ - `references/image-api.md`
49
+ - `references/codex-network.md`
50
+ - `scripts/image_gen.py`
51
+
52
+ ## When to use
53
+ - Generate a new image (concept art, product shot, cover, website hero)
54
+ - Generate a new image using one or more reference images for style, composition, or mood
55
+ - Edit an existing image (inpainting, lighting or weather transformations, background replacement, object removal, compositing, transparent background)
56
+ - Produce many assets or variants for one task
57
+
58
+ ## When not to use
59
+ - Extending or matching an existing SVG/vector icon set, logo system, or illustration library inside the repo
60
+ - Creating simple shapes, diagrams, wireframes, or icons that are better produced directly in SVG, HTML/CSS, or canvas
61
+ - Making a small project-local asset edit when the source file already exists in an editable native format
62
+ - Any task where the user clearly wants deterministic code-native output instead of a generated bitmap
63
+
64
+ ## Decision tree
65
+
66
+ Think about two separate questions:
67
+
68
+ 1. **Intent:** is this a new image or an edit of an existing image?
69
+ 2. **Execution strategy:** is this one asset or many assets/variants?
70
+
71
+ Intent:
72
+ - If the user wants to modify an existing image while preserving parts of it, treat the request as **edit**.
73
+ - If the user provides images only as references for style, composition, mood, or subject guidance, treat the request as **generate**.
74
+ - If the user provides no images, treat the request as **generate**.
75
+
76
+ Built-in edit semantics:
77
+ - Built-in edit mode is for images already visible in the conversation context, such as attached images or images generated earlier in the thread.
78
+ - If the user wants to edit a local image file with the built-in tool, first load it with built-in `view_image` tool so the image is visible in the conversation context, then proceed with the built-in edit flow.
79
+ - Do not promise arbitrary filesystem-path editing through the built-in tool.
80
+ - If a local file still needs direct file-path control, masks, or other explicit CLI-only parameters, use the explicit CLI fallback only when the user asks for it.
81
+ - For edits, preserve invariants aggressively and save non-destructively by default.
82
+
83
+ Execution strategy:
84
+ - In the built-in default path, produce many assets or variants by issuing one `image_gen` call per requested asset or variant.
85
+ - In the CLI fallback path, use the CLI `generate-batch` subcommand only when the user explicitly chose CLI mode and needs many prompts/assets.
86
+ - 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.
87
+
88
+ Assume the user wants a new image unless they clearly ask to change an existing one.
89
+
90
+ ## Workflow
91
+ 1. Decide the top-level mode: built-in by default, including transparent-output requests; fallback CLI only if explicitly requested or confirmed.
92
+ 2. Decide the intent: `generate` or `edit`.
93
+ 3. Decide whether the output is preview-only or meant to be consumed by the current project.
94
+ 4. Decide the execution strategy: single asset vs repeated built-in calls vs CLI `generate-batch`.
95
+ 5. Collect inputs up front: prompt(s), exact text (verbatim), constraints/avoid list, and any input images.
96
+ 6. For every input image, label its role explicitly:
97
+ - reference image
98
+ - edit target
99
+ - supporting insert/style/compositing input
100
+ 7. If the edit target is only on the local filesystem and you are staying on the built-in path, inspect it with `view_image` first so the image is available in conversation context.
101
+ 8. If the user asked for a photo, illustration, sprite, product image, banner, or other explicitly raster-style asset, use `image_gen` rather than substituting SVG/HTML/CSS placeholders. If the request is for an icon, logo, or UI graphic that should match existing repo-native SVG/vector/code assets, prefer editing those directly instead.
102
+ 9. Augment the prompt based on specificity:
103
+ - If the user's prompt is already specific and detailed, normalize it into a clear spec without adding creative requirements.
104
+ - If the user's prompt is generic, add tasteful augmentation only when it materially improves output quality.
105
+ 10. Use the built-in `image_gen` tool by default.
106
+ 11. For transparent-output requests, ask built-in `image_gen` for a transparent background and preserve the generated alpha channel.
107
+ 12. Inspect outputs and validate: subject, style, composition, text accuracy, and invariants/avoid items.
108
+ 13. Iterate with a single targeted change, then re-check.
109
+ 14. For preview-only work, render the image inline; the underlying file may remain at the default `$CODEX_HOME/generated_images/...` path.
110
+ 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.
111
+ 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.
112
+ 17. If the user explicitly chooses or confirms the CLI fallback, then use the fallback-only docs for model, quality, size, `input_fidelity`, masks, output format, output paths, and network setup.
113
+ 18. 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.
114
+
115
+ ## Transparent image requests
116
+
117
+ Ask built-in `image_gen` for a genuinely transparent background and preserve its alpha.
118
+
119
+ ## Prompt augmentation
120
+
121
+ Reformat user prompts into a structured, production-oriented spec. Make the user's goal clearer and more actionable, but do not blindly add detail.
122
+
123
+ Treat this as prompt-shaping guidance, not a closed schema. Use only the lines that help, and add a short extra labeled line when it materially improves clarity.
124
+
125
+ ### Specificity policy
126
+
127
+ Use the user's prompt specificity to decide how much augmentation is appropriate:
128
+
129
+ - If the prompt is already specific and detailed, preserve that specificity and only normalize/structure it.
130
+ - If the prompt is generic, you may add tasteful augmentation when it will materially improve the result.
131
+
132
+ Allowed augmentations:
133
+ - composition or framing hints
134
+ - polish level or intended-use hints
135
+ - practical layout guidance
136
+ - reasonable scene concreteness that supports the stated request
137
+
138
+ Not allowed augmentations:
139
+ - extra characters or objects that are not implied by the request
140
+ - brand names, slogans, palettes, or narrative beats that are not implied
141
+ - arbitrary side-specific placement unless the surrounding layout supports it
142
+
143
+ ## Use-case taxonomy (exact slugs)
144
+
145
+ Classify each request into one of these buckets and keep the slug consistent across prompts and references.
146
+
147
+ Generate:
148
+ - photorealistic-natural — candid/editorial lifestyle scenes with real texture and natural lighting.
149
+ - product-mockup — product/packaging shots, catalog imagery, merch concepts.
150
+ - ui-mockup — app/web interface mockups and wireframes; specify the desired fidelity.
151
+ - infographic-diagram — diagrams/infographics with structured layout and text.
152
+ - scientific-educational — classroom explainers, scientific diagrams, and learning visuals with required labels and accuracy constraints.
153
+ - ads-marketing — campaign concepts and ad creatives with audience, brand position, scene, and exact tagline/copy.
154
+ - productivity-visual — slide, chart, workflow, and data-heavy business visuals.
155
+ - logo-brand — logo/mark exploration, vector-friendly.
156
+ - illustration-story — comics, children’s book art, narrative scenes.
157
+ - stylized-concept — style-driven concept art, 3D/stylized renders.
158
+ - historical-scene — period-accurate/world-knowledge scenes.
159
+
160
+ Edit:
161
+ - text-localization — translate/replace in-image text, preserve layout.
162
+ - identity-preserve — try-on, person-in-scene; lock face/body/pose.
163
+ - precise-object-edit — remove/replace a specific element (including interior swaps).
164
+ - lighting-weather — time-of-day/season/atmosphere changes only.
165
+ - background-extraction — transparent background / clean cutout. Ask built-in `image_gen` for actual transparency.
166
+ - style-transfer — apply reference style while changing subject/scene.
167
+ - compositing — multi-image insert/merge with matched lighting/perspective.
168
+ - sketch-to-render — drawing/line art to photoreal render.
169
+
170
+ ## Shared prompt schema
171
+
172
+ Use the following labeled spec as shared prompt scaffolding for both top-level modes:
173
+
174
+ ```text
175
+ Use case: <taxonomy slug>
176
+ Asset type: <where the asset will be used>
177
+ Primary request: <user's main prompt>
178
+ Input images: <Image 1: role; Image 2: role> (optional)
179
+ Scene/backdrop: <environment>
180
+ Subject: <main subject>
181
+ Style/medium: <photo/illustration/3D/etc>
182
+ Composition/framing: <wide/close/top-down; placement>
183
+ Lighting/mood: <lighting + mood>
184
+ Color palette: <palette notes>
185
+ Materials/textures: <surface details>
186
+ Text (verbatim): "<exact text>"
187
+ Constraints: <must keep/must avoid>
188
+ Avoid: <negative constraints>
189
+ ```
190
+
191
+ Notes:
192
+ - `Asset type` and `Input images` are prompt scaffolding, not dedicated CLI flags.
193
+ - `Scene/backdrop` refers to the visual setting. It is not the same as the fallback CLI `background` parameter, which controls output transparency behavior.
194
+ - 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.
195
+
196
+ Augmentation rules:
197
+ - Keep it short.
198
+ - Add only the details needed to improve the prompt materially.
199
+ - For edits, explicitly list invariants (`change only X; keep Y unchanged`).
200
+ - If any critical detail is missing and blocks success, ask a question; otherwise proceed.
201
+
202
+ ## Examples
203
+
204
+ ### Generation example (hero image)
205
+ ```text
206
+ Use case: product-mockup
207
+ Asset type: landing page hero
208
+ Primary request: a minimal hero image of a ceramic coffee mug
209
+ Style/medium: clean product photography
210
+ Composition/framing: wide composition with usable negative space for page copy if needed
211
+ Lighting/mood: soft studio lighting
212
+ Constraints: no logos, no text, no watermark
213
+ ```
214
+
215
+ ### Edit example (invariants)
216
+ ```text
217
+ Use case: precise-object-edit
218
+ Asset type: product photo background replacement
219
+ Primary request: replace only the background with a warm sunset gradient
220
+ Constraints: change only the background; keep the product and its edges unchanged; no text; no watermark
221
+ ```
222
+
223
+ ## Prompting best practices
224
+ - Structure prompt as scene/backdrop -> subject -> details -> constraints.
225
+ - Include intended use (ad, UI mock, infographic) to set the mode and polish level.
226
+ - Use camera/composition language for photorealism.
227
+ - Only use SVG/vector stand-ins when the user explicitly asked for vector output or a non-image placeholder.
228
+ - Quote exact text and specify typography + placement.
229
+ - For tricky words, spell them letter-by-letter and require verbatim rendering.
230
+ - For multi-image inputs, reference images by index and describe how they should be used.
231
+ - For edits, repeat invariants every iteration to reduce drift.
232
+ - Iterate with single-change follow-ups.
233
+ - If the prompt is generic, add only the extra detail that will materially help.
234
+ - If the prompt is already detailed, normalize it instead of expanding it.
235
+ - 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.
236
+ - For transparent images, ask built-in `image_gen` for actual transparency and preserve its alpha.
237
+
238
+ More principles shared by both modes: `references/prompting.md`.
239
+ Copy/paste specs shared by both modes: `references/sample-prompts.md`.
240
+
241
+ ## Guidance by asset type
242
+ Asset-type templates (website assets, game assets, wireframes, logo) are consolidated in `references/sample-prompts.md`.
243
+
244
+ ## gpt-image-2 guidance for CLI fallback
245
+
246
+ The fallback CLI defaults to `gpt-image-2`.
247
+
248
+ - Use `gpt-image-2` for new CLI/API workflows unless the user confirms a different model.
249
+ - CLI `gpt-image-2` does not support `background=transparent`; ask before using `gpt-image-1.5` unless the user explicitly requested that model.
250
+ - `gpt-image-2` always uses high fidelity for image inputs; do not set `input_fidelity` with this model.
251
+ - `gpt-image-2` supports `quality` values `low`, `medium`, `high`, and `auto`.
252
+ - 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.
253
+ - Square images are typically fastest to generate. Use `1024x1024` for fast square drafts.
254
+ - If the user asks for 4K-style output, use `3840x2160` for landscape or `2160x3840` for portrait.
255
+ - `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`.
256
+
257
+ Popular `gpt-image-2` sizes:
258
+ - `1024x1024` square
259
+ - `1536x1024` landscape
260
+ - `1024x1536` portrait
261
+ - `2048x2048` 2K square
262
+ - `2048x1152` 2K landscape
263
+ - `3840x2160` 4K landscape
264
+ - `2160x3840` 4K portrait
265
+ - `auto`
266
+
267
+ ## Fallback CLI mode only
268
+
269
+ ### Temp and output conventions
270
+ These conventions apply only to the CLI fallback. They do not describe built-in `image_gen` output behavior.
271
+ - Use `tmp/imagegen/` for intermediate files (for example JSONL batches); delete them when done.
272
+ - Write final artifacts under `output/imagegen/`.
273
+ - Use `--out` or `--out-dir` to control output paths; keep filenames stable and descriptive.
274
+
275
+ ### Dependencies
276
+ Prefer `uv` for dependency management in this repo.
277
+
278
+ Required Python package:
279
+ ```bash
280
+ uv pip install openai
281
+ ```
282
+
283
+ Optional for image inspection and downscaling:
284
+ ```bash
285
+ uv pip install pillow
286
+ ```
287
+
288
+ Portability note:
289
+ - If you are using the installed skill outside this repo, install dependencies into that environment with its package manager.
290
+ - In uv-managed environments, `uv pip install ...` remains the preferred path.
291
+
292
+ ### Environment
293
+ - `OPENAI_API_KEY` must be set for live API calls.
294
+ - Do not ask the user for `OPENAI_API_KEY` when using the built-in `image_gen` tool.
295
+ - Never ask the user to paste the full key in chat. Ask them to set it locally and confirm when ready.
296
+
297
+ If the key is missing, give the user these steps:
298
+ 1. Create an API key in the OpenAI platform UI: https://platform.openai.com/api-keys
299
+ 2. Set `OPENAI_API_KEY` as an environment variable in their system.
300
+ 3. Offer to guide them through setting the environment variable for their OS/shell if needed.
301
+
302
+ If installation is not possible in this environment, tell the user which dependency is missing and how to install it into their active environment.
303
+
304
+ ### Script-mode notes
305
+ - CLI commands + examples: `references/cli.md`
306
+ - API parameter quick reference: `references/image-api.md`
307
+ - Network approvals / sandbox settings for CLI mode: `references/codex-network.md`
308
+
309
+ ## Reference map
310
+ - `references/prompting.md`: shared prompting principles for both modes.
311
+ - `references/sample-prompts.md`: shared copy/paste prompt recipes for both modes.
312
+ - `references/cli.md`: fallback-only CLI usage via `scripts/image_gen.py`.
313
+ - `references/image-api.md`: fallback-only API/CLI parameter reference.
314
+ - `references/codex-network.md`: fallback-only network/sandbox troubleshooting for CLI mode.
315
+ - `scripts/image_gen.py`: fallback-only CLI implementation. Use only when the user explicitly chooses or confirms CLI mode.
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/agents/openai.yaml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ interface:
2
+ display_name: "Image Gen"
3
+ short_description: "Generate or edit images for websites, games, and more"
4
+ icon_small: "./assets/imagegen-small.svg"
5
+ icon_large: "./assets/imagegen.png"
6
+ default_prompt: "Use $imagegen to make or edit an image for this project."
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/assets/imagegen-small.svg ADDED
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/assets/imagegen.png ADDED

Git LFS Details

  • SHA256: 95952f644064eb9e890f98d8db07216347186526e4c41ad66d3420629eb86e20
  • Pointer size: 129 Bytes
  • Size of remote file: 1.71 kB
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/cli.md ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CLI reference (`scripts/image_gen.py`)
2
+
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 after the user explicitly confirms that a transparent-output request should use the `gpt-image-1.5` true-transparency fallback path.
4
+
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.
7
+
8
+ ## What this CLI does
9
+ - `generate`: generate a new image from a prompt
10
+ - `edit`: edit one or more existing images
11
+ - `generate-batch`: run many generation jobs from a JSONL file after the user explicitly chooses CLI/API/model controls
12
+
13
+ Real API calls require **network access** + `OPENAI_API_KEY`. `--dry-run` does not.
14
+
15
+ ## Quick start (works from any repo)
16
+ Set a stable path to the skill CLI (default `CODEX_HOME` is `~/.codex`):
17
+
18
+ ```
19
+ export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
20
+ export IMAGE_GEN="$CODEX_HOME/skills/.system/imagegen/scripts/image_gen.py"
21
+ ```
22
+
23
+ Install dependencies into that environment with its package manager. In uv-managed environments, `uv pip install ...` remains the preferred path.
24
+
25
+ ## Quick start
26
+
27
+ Dry-run (no API call; no network required; does not require the `openai` package):
28
+
29
+ ```bash
30
+ python "$IMAGE_GEN" generate \
31
+ --prompt "Test" \
32
+ --out output/imagegen/test.png \
33
+ --dry-run
34
+ ```
35
+
36
+ Notes:
37
+ - One-off dry-runs print the API payload and the computed output path(s).
38
+ - Repo-local finals should live under `output/imagegen/`.
39
+
40
+ Generate (requires `OPENAI_API_KEY` + network):
41
+
42
+ ```bash
43
+ python "$IMAGE_GEN" generate \
44
+ --prompt "A cozy alpine cabin at dawn" \
45
+ --size 1024x1024 \
46
+ --out output/imagegen/alpine-cabin.png
47
+ ```
48
+
49
+ Edit:
50
+
51
+ ```bash
52
+ python "$IMAGE_GEN" edit \
53
+ --image input.png \
54
+ --prompt "Replace only the background with a warm sunset" \
55
+ --out output/imagegen/sunset-edit.png
56
+ ```
57
+
58
+ ## Guardrails
59
+ - Use the bundled CLI directly (`python "$IMAGE_GEN" ...`) after activating the correct environment.
60
+ - Do **not** create one-off runners (for example `gen_images.py`) unless the user explicitly asks for a custom wrapper.
61
+ - **Never modify** `scripts/image_gen.py`. If something is missing, ask the user before doing anything else.
62
+ - Do not silently downgrade from CLI `gpt-image-2` or built-in `image_gen` to CLI `gpt-image-1.5`; ask first unless the user explicitly requested `gpt-image-1.5`.
63
+
64
+ ## Defaults
65
+ - Model: `gpt-image-2`
66
+ - Supported model family for this CLI: GPT Image models (`gpt-image-*`)
67
+ - Size: `auto`
68
+ - Quality: `medium`
69
+ - Output format: `png`
70
+ - Default one-off output path: `output/imagegen/output.png`
71
+ - Background: unspecified unless `--background` is set
72
+
73
+ ## gpt-image-2 size and model guidance
74
+
75
+ `gpt-image-2` is the default model for new CLI fallback work.
76
+
77
+ - Use `--quality low` for fast drafts, thumbnails, and quick iterations.
78
+ - Use `--quality medium`, `--quality high`, or `--quality auto` for final assets, dense text, diagrams, identity-sensitive edits, and high-resolution outputs.
79
+ - Square images are typically fastest. Use `--size 1024x1024` for quick square drafts.
80
+ - If the user asks for 4K-style output, use `--size 3840x2160` for landscape or `--size 2160x3840` for portrait.
81
+ - Do not pass `--input-fidelity` with `gpt-image-2`; this model always uses high fidelity for image inputs.
82
+ - Do not use `--background transparent` with CLI `gpt-image-2`; ask before using `gpt-image-1.5` unless the user explicitly requested that model.
83
+
84
+ Popular `gpt-image-2` sizes:
85
+ - `1024x1024`
86
+ - `1536x1024`
87
+ - `1024x1536`
88
+ - `2048x2048`
89
+ - `2048x1152`
90
+ - `3840x2160`
91
+ - `2160x3840`
92
+ - `auto`
93
+
94
+ `gpt-image-2` size constraints:
95
+ - max edge `<= 3840px`
96
+ - both edges multiples of `16px`
97
+ - long edge to short edge ratio `<= 3:1`
98
+ - total pixels between `655,360` and `8,294,400`
99
+ - outputs above `2560x1440` total pixels are experimental
100
+
101
+ Fast draft:
102
+
103
+ ```bash
104
+ python "$IMAGE_GEN" generate \
105
+ --prompt "A product thumbnail of a matte ceramic mug on a stone surface" \
106
+ --quality low \
107
+ --size 1024x1024 \
108
+ --out output/imagegen/mug-draft.png
109
+ ```
110
+
111
+ Final 2K landscape:
112
+
113
+ ```bash
114
+ python "$IMAGE_GEN" generate \
115
+ --prompt "A polished landing-page hero image of a matte ceramic mug on a stone surface" \
116
+ --quality high \
117
+ --size 2048x1152 \
118
+ --out output/imagegen/mug-hero.png
119
+ ```
120
+
121
+ 4K landscape:
122
+
123
+ ```bash
124
+ python "$IMAGE_GEN" generate \
125
+ --prompt "A detailed architectural visualization at golden hour" \
126
+ --size 3840x2160 \
127
+ --quality high \
128
+ --out output/imagegen/architecture-4k.png
129
+ ```
130
+
131
+ True transparent fallback request:
132
+
133
+ Ask for confirmation before using this command unless the user explicitly requested `gpt-image-1.5`.
134
+
135
+ ```bash
136
+ python "$IMAGE_GEN" generate \
137
+ --model gpt-image-1.5 \
138
+ --prompt "A clean product cutout on a transparent background" \
139
+ --background transparent \
140
+ --output-format png \
141
+ --out output/imagegen/product-cutout.png
142
+ ```
143
+
144
+ Explain that CLI `gpt-image-2` does not support `background=transparent`, so transparent CLI output requires the confirmed `gpt-image-1.5` fallback.
145
+
146
+ ## Quality, input fidelity, and masks (CLI fallback only)
147
+ These are explicit CLI controls. They are not built-in `image_gen` tool arguments.
148
+
149
+ - `--quality` works for `generate`, `edit`, and `generate-batch`: `low|medium|high|auto`
150
+ - `--input-fidelity` is **edit-only** and validated as `low|high`; it is not supported for `gpt-image-2`
151
+ - `--mask` is **edit-only**
152
+
153
+ Example:
154
+
155
+ ```bash
156
+ python "$IMAGE_GEN" edit \
157
+ --model gpt-image-1.5 \
158
+ --image input.png \
159
+ --prompt "Change only the background" \
160
+ --quality high \
161
+ --input-fidelity high \
162
+ --out output/imagegen/background-edit.png
163
+ ```
164
+
165
+ Mask notes:
166
+ - For multi-image edits, pass repeated `--image` flags. Their order is meaningful, so describe each image by index and role in the prompt.
167
+ - The CLI accepts a single `--mask`.
168
+ - Image and mask must be the same size and format and each under 50MB.
169
+ - Masks must include an alpha channel.
170
+ - If multiple input images are provided, the mask applies to the first image.
171
+ - Masking is prompt-guided; do not promise exact pixel-perfect mask boundaries.
172
+ - Use a PNG mask when possible; the script treats mask handling as best-effort and does not perform full preflight validation beyond file checks/warnings.
173
+ - In the edit prompt, repeat invariants (`change only the background; keep the subject unchanged`) to reduce drift.
174
+
175
+ ## Output handling
176
+ - Use `tmp/imagegen/` for temporary JSONL inputs or scratch files.
177
+ - Use `output/imagegen/` for final outputs.
178
+ - Reruns fail if a target file already exists unless you pass `--force`.
179
+ - `--out-dir` changes one-off naming to `image_1.<ext>`, `image_2.<ext>`, and so on.
180
+ - Downscaled copies use the default suffix `-web` unless you override it.
181
+
182
+ ## Common recipes
183
+
184
+ Generate with augmentation fields:
185
+
186
+ ```bash
187
+ python "$IMAGE_GEN" generate \
188
+ --prompt "A minimal hero image of a ceramic coffee mug" \
189
+ --use-case "product-mockup" \
190
+ --style "clean product photography" \
191
+ --composition "wide product shot with usable negative space for page copy" \
192
+ --constraints "no logos, no text" \
193
+ --out output/imagegen/mug-hero.png
194
+ ```
195
+
196
+ Generate + also write a downscaled copy for fast web loading:
197
+
198
+ ```bash
199
+ python "$IMAGE_GEN" generate \
200
+ --prompt "A cozy alpine cabin at dawn" \
201
+ --size 1024x1024 \
202
+ --downscale-max-dim 1024 \
203
+ --out output/imagegen/alpine-cabin.png
204
+ ```
205
+
206
+ Generate multiple prompts concurrently (async batch):
207
+
208
+ ```bash
209
+ mkdir -p tmp/imagegen output/imagegen/batch
210
+ cat > tmp/imagegen/prompts.jsonl << 'EOF'
211
+ {"prompt":"Cavernous hangar interior with a compact shuttle parked near the center","use_case":"stylized-concept","composition":"wide-angle, low-angle","lighting":"volumetric light rays through drifting fog","constraints":"no logos or trademarks; no watermark","size":"1536x1024"}
212
+ {"prompt":"Gray wolf in profile in a snowy forest","use_case":"photorealistic-natural","composition":"eye-level","constraints":"no logos or trademarks; no watermark","size":"1024x1024"}
213
+ EOF
214
+
215
+ python "$IMAGE_GEN" generate-batch \
216
+ --input tmp/imagegen/prompts.jsonl \
217
+ --out-dir output/imagegen/batch \
218
+ --concurrency 5
219
+
220
+ rm -f tmp/imagegen/prompts.jsonl
221
+ ```
222
+
223
+ Notes:
224
+ - `generate-batch` requires `--out-dir`.
225
+ - generate-batch requires --out-dir.
226
+ - Use `--concurrency` to control parallelism (default `5`).
227
+ - Per-job overrides are supported in JSONL (for example `size`, `quality`, `background`, `output_format`, `output_compression`, `moderation`, `n`, `model`, `out`, and prompt-augmentation fields).
228
+ - `--n` generates multiple variants for a single prompt; `generate-batch` is for many different prompts.
229
+ - In batch mode, per-job `out` is treated as a filename under `--out-dir`.
230
+ - For many requested deliverable assets, provide one prompt/job per distinct asset and use semantic filenames when possible.
231
+
232
+ ## CLI notes
233
+ - Supported sizes depend on the model. `gpt-image-2` supports flexible constrained sizes; older GPT Image models support `1024x1024`, `1536x1024`, `1024x1536`, or `auto`.
234
+ - True transparent CLI outputs require `output_format` to be `png` or `webp` and are not supported by `gpt-image-2`.
235
+ - `--prompt-file`, `--output-compression`, `--moderation`, `--max-attempts`, `--fail-fast`, `--force`, and `--no-augment` are supported.
236
+ - This CLI is intended for GPT Image models. Do not assume older non-GPT image-model behavior applies here.
237
+
238
+ ## See also
239
+ - API parameter quick reference for fallback CLI mode: `references/image-api.md`
240
+ - Prompt examples shared across both top-level modes: `references/sample-prompts.md`
241
+ - Network/sandbox notes for fallback CLI mode: `references/codex-network.md`
242
+ - Built-in-first transparent image workflow: `SKILL.md`
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/codex-network.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Codex network approvals / sandbox notes
2
+
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 after the user explicitly confirms that a transparent-output request should use the `gpt-image-1.5` true-transparency fallback path.
4
+
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.
6
+
7
+ ## Why am I asked to approve image generation calls?
8
+ The fallback CLI uses the OpenAI Image API, so it needs outbound network access. In many Codex setups, network access is disabled by default and/or the approval policy requires confirmation before networked commands run.
9
+
10
+ ## Important note about approvals vs network
11
+ - `--ask-for-approval never` suppresses approval prompts.
12
+ - It does **not** by itself enable network access.
13
+ - In `workspace-write`, network access still depends on your Codex configuration (for example `[sandbox_workspace_write] network_access = true`).
14
+
15
+ ## How do I reduce repeated approval prompts?
16
+ If you trust the repo and want fewer prompts, use a configuration or profile that both:
17
+ - enables network for the sandbox mode you plan to use
18
+ - sets an approval policy that matches your risk tolerance
19
+
20
+ Example `~/.codex/config.toml` pattern:
21
+
22
+ ```toml
23
+ approval_policy = "on-request"
24
+ sandbox_mode = "workspace-write"
25
+
26
+ [sandbox_workspace_write]
27
+ network_access = true
28
+ ```
29
+
30
+ If you want quieter automation after network is enabled, you can choose a stricter approval policy, but do that intentionally and with care.
31
+
32
+ ## Safety note
33
+ Enabling network and reducing approvals lowers friction, but increases risk if you run untrusted code or work in an untrusted repository.
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/image-api.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Image API quick reference
2
+
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 after the user explicitly confirms that a transparent-output request should use the `gpt-image-1.5` true-transparency fallback path.
4
+
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
+
7
+ ## Scope
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
+ - The built-in `image_gen` tool and the fallback CLI do not expose the same controls.
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 |
16
+ | `gpt-image-1.5` | `low`, `medium`, `high`, `auto` | `low`, `high` | `1024x1024`, `1024x1536`, `1536x1024`, `auto` | True transparent-background fallback and backward-compatible workflows |
17
+ | `gpt-image-1` | `low`, `medium`, `high`, `auto` | `low`, `high` | `1024x1024`, `1024x1536`, `1536x1024`, `auto` | Legacy compatibility |
18
+ | `gpt-image-1-mini` | `low`, `medium`, `high`, `auto` | `low`, `high` | `1024x1024`, `1024x1536`, `1536x1024`, `auto` | Cost-sensitive draft batches and lower-stakes previews |
19
+
20
+ ## gpt-image-2 sizes
21
+
22
+ `gpt-image-2` accepts `auto` or any `WIDTHxHEIGHT` size that satisfies all constraints:
23
+
24
+ - Maximum edge length must be less than or equal to `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
+ | 4K landscape | `3840x2160` | Widescreen 4K output |
39
+ | 4K portrait | `2160x3840` | Vertical 4K output |
40
+ | Auto | `auto` | Default size |
41
+
42
+ Square images are typically fastest to generate. For 4K-style output, use `3840x2160` or `2160x3840`.
43
+
44
+ ## Endpoints
45
+ - Generate: `POST /v1/images/generations` (`client.images.generate(...)`)
46
+ - Edit: `POST /v1/images/edits` (`client.images.edit(...)`)
47
+
48
+ ## Core parameters for GPT Image models
49
+ - `prompt`: text prompt
50
+ - `model`: image model
51
+ - `n`: number of images (1-10)
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`
53
+ - `quality`: `low`, `medium`, `high`, or `auto`
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
55
+ - `output_format`: `png` (default), `jpeg`, `webp`
56
+ - `output_compression`: 0-100 (jpeg/webp only)
57
+ - `moderation`: `auto` (default) or `low`
58
+
59
+ ## Edit-specific parameters
60
+ - `image`: one or more input images. For GPT Image models, you can provide up to 16 images.
61
+ - `mask`: optional mask image
62
+ - `input_fidelity`: `low` or `high` only for models that support it; do not set this for `gpt-image-2`
63
+
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`.
66
+ - `gpt-image-1` and `gpt-image-1-mini` preserve all input images, but the first image gets richer textures and finer details.
67
+ - `gpt-image-1.5` preserves the first 5 input images with higher fidelity.
68
+
69
+ ## Transparent backgrounds
70
+
71
+ `gpt-image-2` does not currently support the Image API `background=transparent` parameter. In explicit CLI/API fallback mode, keep `gpt-image-2` when a flat chroma-key background plus local alpha extraction with `python "${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/scripts/remove_chroma_key.py"` is acceptable.
72
+
73
+ Use CLI `gpt-image-1.5` with `background=transparent` and a transparent-capable output format such as `png` or `webp` only after the user explicitly confirms that fallback, unless they already requested `gpt-image-1.5`, `scripts/image_gen.py`, or CLI fallback. If the user asks for true/native transparency, the subject is too complex for clean chroma-key removal, or local background removal fails validation, explain the tradeoff and ask before switching.
74
+
75
+ ## Output
76
+ - `data[]` list with `b64_json` per image
77
+ - The bundled `scripts/image_gen.py` CLI decodes `b64_json` and writes output files for you.
78
+
79
+ ## Limits and notes
80
+ - Input images and masks must be under 50MB.
81
+ - Use the edits endpoint when the user requests changes to an existing image.
82
+ - Masking is prompt-guided; exact shapes are not guaranteed.
83
+ - Large sizes and high quality increase latency and cost.
84
+ - 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.
85
+ - High `input_fidelity` can materially increase input token usage on models that support it.
86
+ - 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 true transparent CLI output is required, ask before switching to `gpt-image-1.5` instead of dropping `background=transparent`, unless the user already explicitly chose that fallback.
87
+
88
+ ## Important boundary
89
+ - `quality`, `input_fidelity`, explicit masks, `background`, `output_format`, and related parameters are fallback-only execution controls.
90
+ - Do not assume they are built-in `image_gen` tool arguments.
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/prompting.md ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Prompting best practices
2
+
3
+ These prompting principles are shared by both top-level modes of the skill:
4
+ - built-in `image_gen` tool (default)
5
+ - explicit `scripts/image_gen.py` CLI fallback
6
+
7
+ This file is about prompt structure, specificity, and iteration. Fallback-only execution controls such as `quality`, `input_fidelity`, masks, output format, and output paths live in the fallback docs.
8
+
9
+ ## Contents
10
+ - [Structure](#structure)
11
+ - [Specificity policy](#specificity-policy)
12
+ - [Allowed and disallowed augmentation](#allowed-and-disallowed-augmentation)
13
+ - [Composition and layout](#composition-and-layout)
14
+ - [Constraints and invariants](#constraints-and-invariants)
15
+ - [Text in images](#text-in-images)
16
+ - [Input images and references](#input-images-and-references)
17
+ - [Iterate deliberately](#iterate-deliberately)
18
+ - [Transparent images](#transparent-images)
19
+ - [Fallback-only execution controls](#fallback-only-execution-controls)
20
+ - [Use-case tips](#use-case-tips)
21
+ - [Where to find copy/paste recipes](#where-to-find-copypaste-recipes)
22
+
23
+ ## Structure
24
+ - Use a consistent order: scene/backdrop -> subject -> key details -> constraints -> output intent.
25
+ - Include intended use (ad, UI mock, infographic) to set the level of polish.
26
+ - For complex requests, use short labeled lines instead of one long paragraph.
27
+
28
+ ## Specificity policy
29
+ - If the user prompt is already specific and detailed, normalize it into a clean spec without adding creative requirements.
30
+ - If the prompt is generic, you may add tasteful detail when it materially improves the output.
31
+ - Treat examples in `sample-prompts.md` as fully-authored recipes, not as the default amount of augmentation to add to every request.
32
+ - 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.
33
+
34
+ ## Allowed and disallowed augmentation
35
+
36
+ Allowed augmentation for generic prompts:
37
+ - composition and framing cues
38
+ - intended-use or polish-level hints
39
+ - practical layout guidance
40
+ - reasonable scene concreteness that supports the request
41
+
42
+ Do not add:
43
+ - extra characters, props, or objects that are not implied
44
+ - brand palettes, slogans, or story beats that are not implied
45
+ - arbitrary side-specific placement unless the surrounding layout supports it
46
+
47
+ ## Composition and layout
48
+ - Specify framing and viewpoint (close-up, wide, top-down) and placement only when it materially helps.
49
+ - Call out negative space if the asset clearly needs room for UI or copy.
50
+ - Avoid making left/right layout decisions unless the user or surrounding layout supports them.
51
+ - 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`).
52
+
53
+ ## Constraints and invariants
54
+ - State what must not change (`keep background unchanged`).
55
+ - For edits, say `change only X; keep Y unchanged` and repeat invariants on every iteration to reduce drift.
56
+
57
+ ## Text in images
58
+ - Put literal text in quotes or ALL CAPS and specify typography (font style, size, color, placement).
59
+ - Spell uncommon words letter-by-letter if accuracy matters.
60
+ - For in-image copy, require verbatim rendering and no extra characters.
61
+ - In CLI fallback mode, use `medium` or `high` quality for small text, dense infographics, data-heavy slides, multi-font layouts, legends, axes, and footnotes.
62
+
63
+ ## Input images and references
64
+ - Do not assume that every provided image is an edit target.
65
+ - Label each image by index and role (`Image 1: edit target`, `Image 2: style reference`).
66
+ - If the user provides images for style, composition, or mood guidance and does not ask to modify them, treat the request as generation with references.
67
+ - If the user asks to preserve an existing image while changing specific parts, treat the request as an edit.
68
+ - For compositing, describe how the images interact (`place the subject from Image 2 into Image 1`).
69
+
70
+ ## Iterate deliberately
71
+ - Start with a clean base prompt, then make small single-change edits.
72
+ - Re-specify critical constraints when you iterate.
73
+ - Prefer one targeted follow-up at a time over rewriting the whole prompt.
74
+
75
+ ## Transparent images
76
+ - Ask built-in `image_gen` for a genuinely transparent background and preserve its alpha.
77
+
78
+ ## Fallback-only execution controls
79
+ - `quality`, `input_fidelity`, explicit masks, output format, and output paths are fallback-only execution controls.
80
+ - Do not assume they are built-in `image_gen` tool arguments.
81
+ - If the user explicitly chooses CLI fallback, see `references/cli.md` and `references/image-api.md` for those controls.
82
+ - 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.
83
+ - `gpt-image-2` always uses high fidelity for image inputs, so do not set `input_fidelity` with that model.
84
+ - CLI `gpt-image-2` does not support `background=transparent`; ask before using `gpt-image-1.5` unless the user explicitly requested that model.
85
+ - If the user asks for 4K-style output with `gpt-image-2`, use `3840x2160` for landscape or `2160x3840` for portrait.
86
+
87
+ ## Use-case tips
88
+ Generate:
89
+ - 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.
90
+ - 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.
91
+ - 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.
92
+ - infographic-diagram: Define the audience and layout flow; label parts explicitly; require verbatim text; prefer higher quality in CLI mode for dense labels.
93
+ - logo-brand: Keep it simple and scalable; ask for a strong silhouette and balanced negative space; avoid decorative flourishes unless requested.
94
+ - ads-marketing: Write like a creative brief; include brand positioning, audience, desired vibe, scene, and exact tagline if text must appear.
95
+ - 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.
96
+ - scientific-educational: Define audience, lesson objective, required labels, scientific constraints, arrows, and scan-friendly whitespace.
97
+ - illustration-story: Define panels or scene beats; keep each action concrete.
98
+ - stylized-concept: Specify style cues, material finish, and rendering approach (3D, painterly, clay) without inventing new story elements.
99
+ - historical-scene: State the location/date and required period accuracy; constrain clothing, props, and environment to match the era.
100
+
101
+ Edit:
102
+ - text-localization: Change only the text; preserve layout, typography, spacing, and hierarchy; no extra words or reflow unless needed.
103
+ - identity-preserve: Lock identity (face, body, pose, hair, expression); change only the specified elements; match lighting and shadows.
104
+ - precise-object-edit: Specify exactly what to remove/replace; preserve surrounding texture and lighting; keep everything else unchanged.
105
+ - lighting-weather: Change only environmental conditions (light, shadows, atmosphere, precipitation); keep geometry, framing, and subject identity.
106
+ - background-extraction: Request a clean cutout on a genuinely transparent background; preserve fine edges and label text; no halos or restyling.
107
+ - style-transfer: Specify style cues to preserve (palette, texture, brushwork) and what must change; add `no extra elements` to prevent drift.
108
+ - compositing: Reference inputs by index; specify what moves where; match lighting, perspective, and scale; keep the base framing unchanged.
109
+ - sketch-to-render: Preserve layout, proportions, and perspective; choose materials and lighting that support the supplied sketch without adding new elements.
110
+
111
+ ## Where to find copy/paste recipes
112
+ For copy/paste prompt specs (examples only), see `references/sample-prompts.md`. This file focuses on principles, specificity, and iteration patterns.
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/references/sample-prompts.md ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sample prompts (copy/paste)
2
+
3
+ These prompt recipes are shared across both top-level modes of the skill:
4
+ - built-in `image_gen` tool (default)
5
+ - `scripts/image_gen.py` CLI fallback for explicit or user-confirmed CLI/API/model requests
6
+
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
+
9
+ When adapting a user's prompt:
10
+ - keep user-provided requirements
11
+ - only add detail according to the specificity policy in `SKILL.md`
12
+ - do not treat every example below as permission to invent extra story elements
13
+
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
+
16
+ Execution details such as explicit CLI flags, `quality`, `input_fidelity`, masks, output formats, and local output paths depend on mode. Use built-in `image_gen` by default, request transparent backgrounds directly, and preserve the generated alpha; apply CLI-specific controls only when the user chooses or confirms that fallback.
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 `3840x2160` or `2160x3840`.
22
+ - CLI `gpt-image-2` does not support `background=transparent`; ask before using `gpt-image-1.5` unless the user explicitly requested that model.
23
+ - Do not set `input_fidelity` with `gpt-image-2`; image inputs already use high fidelity.
24
+
25
+ For prompting principles (structure, specificity, invariants, iteration), see `references/prompting.md`.
26
+
27
+ ## Generate
28
+
29
+ ### photorealistic-natural
30
+ ```
31
+ Use case: photorealistic-natural
32
+ Primary request: candid photo of an elderly sailor on a small fishing boat adjusting a net
33
+ Scene/backdrop: coastal water with soft haze
34
+ Subject: weathered skin with wrinkles and sun texture
35
+ Style/medium: photorealistic candid photo
36
+ Composition/framing: medium close-up, eye-level
37
+ Lighting/mood: soft coastal daylight, shallow depth of field, subtle film grain
38
+ Materials/textures: real skin texture, worn fabric, salt-worn wood
39
+ Constraints: natural color balance; no heavy retouching; no glamorization; no watermark
40
+ Avoid: studio polish; staged look
41
+ ```
42
+
43
+ ### product-mockup
44
+ ```
45
+ Use case: product-mockup
46
+ Primary request: premium product photo of a matte black shampoo bottle with a minimal label
47
+ Scene/backdrop: clean studio gradient from light gray to white
48
+ Subject: single bottle centered with subtle reflection
49
+ Style/medium: premium product photography
50
+ Composition/framing: centered, slight three-quarter angle, generous padding
51
+ Lighting/mood: softbox lighting, clean highlights, controlled shadows
52
+ Materials/textures: matte plastic, crisp label printing
53
+ Constraints: no logos or trademarks; no watermark
54
+ ```
55
+
56
+ ### ui-mockup
57
+ ```
58
+ Use case: ui-mockup
59
+ Primary request: mobile app home screen for a local farmers market with vendors and daily specials
60
+ Asset type: mobile app screen
61
+ Style/medium: realistic product UI, not concept art
62
+ Composition/framing: clean vertical mobile layout with clear hierarchy
63
+ Constraints: practical layout, clear typography, no logos or trademarks, no watermark
64
+ ```
65
+
66
+ ### infographic-diagram
67
+ ```
68
+ Use case: infographic-diagram
69
+ Primary request: detailed infographic of an automatic coffee machine flow
70
+ Scene/backdrop: clean, light neutral background
71
+ Subject: bean hopper -> grinder -> brew group -> boiler -> water tank -> drip tray
72
+ Style/medium: clean vector-like infographic with clear callouts and arrows
73
+ Composition/framing: vertical poster layout, top-to-bottom flow
74
+ Text (verbatim): "Bean Hopper", "Grinder", "Brew Group", "Boiler", "Water Tank", "Drip Tray"
75
+ Constraints: clear labels, strong contrast, no logos or trademarks, no watermark
76
+ ```
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
+
90
+ ### logo-brand
91
+ ```
92
+ Use case: logo-brand
93
+ Primary request: original logo for "Field & Flour", a local bakery
94
+ Style/medium: vector logo mark; flat colors; minimal
95
+ Composition/framing: single centered logo on a plain background with generous padding
96
+ Constraints: strong silhouette, balanced negative space; original design only; no gradients unless essential; no trademarks; no watermark
97
+ ```
98
+
99
+ ### illustration-story
100
+ ```
101
+ Use case: illustration-story
102
+ Primary request: 4-panel comic about a pet left alone at home
103
+ Scene/backdrop: cozy living room across panels
104
+ Subject: pet reacting to the owner leaving, then relaxing, then returning to a composed pose
105
+ Style/medium: comic illustration with clear panels
106
+ Composition/framing: 4 equal-sized vertical panels, readable actions per panel
107
+ Constraints: no text; no logos or trademarks; no watermark
108
+ ```
109
+
110
+ ### stylized-concept
111
+ ```
112
+ Use case: stylized-concept
113
+ Primary request: cavernous hangar interior with tall support beams and drifting fog
114
+ Scene/backdrop: industrial hangar interior, deep scale, light haze
115
+ Subject: compact shuttle parked near the center
116
+ Style/medium: cinematic concept art, industrial realism
117
+ Composition/framing: wide-angle, low-angle
118
+ Lighting/mood: volumetric light rays cutting through fog
119
+ Constraints: no logos or trademarks; no watermark
120
+ ```
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
127
+ Style/medium: polished youth streetwear campaign photography
128
+ Composition/framing: vertical ad layout with natural poses and integrated headline space
129
+ Lighting/mood: contemporary, energetic, tasteful
130
+ Text (verbatim): "Yours to Create."
131
+ Constraints: render the tagline exactly once; clean legible typography; no extra text; no watermarks; no unrelated logos
132
+ ```
133
+
134
+ ### productivity-visual
135
+ ```
136
+ Use case: productivity-visual
137
+ Primary request: one pitch-deck slide titled "Market Opportunity"
138
+ Asset type: fundraising slide image
139
+ Style/medium: clean modern deck slide, white background, crisp sans-serif typography
140
+ Subject: TAM/SAM/SOM concentric-circle diagram plus a small growth bar chart from 2021 to 2026
141
+ Composition/framing: 16:9 landscape slide, clear data hierarchy, polished spacing
142
+ Text (verbatim): "Market Opportunity", "TAM: $42B", "SAM: $8.7B", "SOM: $340M", "AGI Research, 2024", "Internal analysis"
143
+ Constraints: readable labels, no clip art, no stock photography, no decorative clutter, no watermark
144
+ ```
145
+
146
+ ### historical-scene
147
+ ```
148
+ Use case: historical-scene
149
+ Primary request: outdoor crowd scene in Bethel, New York on August 16, 1969
150
+ Scene/backdrop: open field with period-appropriate staging
151
+ Subject: crowd in period-accurate clothing, authentic environment
152
+ Style/medium: photorealistic photo
153
+ Composition/framing: wide shot, eye-level
154
+ Constraints: period-accurate details; no modern objects; no logos or trademarks; no watermark
155
+ ```
156
+
157
+ ## Asset type templates (taxonomy-aligned)
158
+
159
+ ### Website assets template
160
+ ```
161
+ Use case: <photorealistic-natural|stylized-concept|product-mockup|infographic-diagram|ui-mockup>
162
+ Asset type: <hero image / section illustration / blog header>
163
+ Primary request: <short description>
164
+ Scene/backdrop: <environment or abstract backdrop>
165
+ Subject: <main subject>
166
+ Style/medium: <photo/illustration/3D>
167
+ Composition/framing: <wide/centered; note usable negative space only if needed>
168
+ Lighting/mood: <soft/bright/neutral>
169
+ Color palette: <brand colors or neutral>
170
+ Constraints: <no text; no logos; no watermark; leave room for UI if needed>
171
+ ```
172
+
173
+ ### Website assets example: minimal hero background
174
+ ```
175
+ Use case: stylized-concept
176
+ Asset type: landing page hero background
177
+ Primary request: minimal abstract background with a soft gradient and subtle texture
178
+ Style/medium: matte illustration / soft-rendered abstract background
179
+ Composition/framing: wide composition with usable negative space for page copy
180
+ Lighting/mood: gentle studio glow
181
+ Color palette: restrained neutral palette
182
+ Constraints: no text; no logos; no watermark
183
+ ```
184
+
185
+ ### Website assets example: feature section illustration
186
+ ```
187
+ Use case: stylized-concept
188
+ Asset type: feature section illustration
189
+ Primary request: simple abstract shapes suggesting connection and flow
190
+ Scene/backdrop: subtle light-gray backdrop with faint texture
191
+ Style/medium: flat illustration; soft shadows; restrained contrast
192
+ Composition/framing: centered cluster; open margins for UI
193
+ Color palette: muted neutral palette
194
+ Constraints: no text; no logos; no watermark
195
+ ```
196
+
197
+ ### Website assets example: blog header image
198
+ ```
199
+ Use case: photorealistic-natural
200
+ Asset type: blog header image
201
+ Primary request: overhead desk scene with notebook, pen, and coffee cup
202
+ Scene/backdrop: warm wooden tabletop
203
+ Style/medium: photorealistic photo
204
+ Composition/framing: wide crop with clean room for page copy
205
+ Lighting/mood: soft morning light
206
+ Constraints: no text; no logos; no watermark
207
+ ```
208
+
209
+ ### Game assets template
210
+ ```
211
+ Use case: stylized-concept
212
+ Asset type: <game environment concept art / game character concept / game UI icon / tileable game texture>
213
+ Primary request: <biome/scene/character/icon/material>
214
+ Scene/backdrop: <location + set dressing> (if applicable)
215
+ Subject: <main focal element(s)>
216
+ Style/medium: <realistic/stylized>; <concept art / character render / UI icon / texture>
217
+ Composition/framing: <wide/establishing/top-down>; <camera angle>; <focal point placement>
218
+ Lighting/mood: <time of day>; <mood>; <volumetric/fog/etc>
219
+ Constraints: no logos or trademarks; no watermark
220
+ ```
221
+
222
+ ### Game assets example: environment concept art
223
+ ```
224
+ Use case: stylized-concept
225
+ Asset type: game environment concept art
226
+ Primary request: cavernous hangar interior with tall support beams and drifting fog
227
+ Scene/backdrop: industrial hangar interior, deep scale, light haze
228
+ Subject: compact shuttle parked near the center
229
+ Style/medium: cinematic concept art, industrial realism
230
+ Composition/framing: wide-angle, low-angle
231
+ Lighting/mood: volumetric light rays cutting through fog
232
+ Constraints: no logos or trademarks; no watermark
233
+ ```
234
+
235
+ ### Game assets example: character concept
236
+ ```
237
+ Use case: stylized-concept
238
+ Asset type: game character concept
239
+ Primary request: desert scout character with layered travel gear
240
+ Subject: long coat, satchel, practical travel clothing
241
+ Style/medium: character render; stylized realism
242
+ Composition/framing: neutral hero pose on a simple backdrop
243
+ Constraints: no logos or trademarks; no watermark
244
+ ```
245
+
246
+ ### Game assets example: UI icon
247
+ ```
248
+ Use case: stylized-concept
249
+ Asset type: game UI icon
250
+ Primary request: round shield icon with a subtle rune pattern
251
+ Style/medium: painted game UI icon
252
+ Composition/framing: centered icon; generous padding; clear silhouette
253
+ Constraints: no text; no background scene elements; no logos or trademarks; no watermark
254
+ ```
255
+
256
+ ### Game assets example: tileable texture
257
+ ```
258
+ Use case: stylized-concept
259
+ Asset type: tileable game texture
260
+ Primary request: worn sandstone blocks
261
+ Style/medium: seamless tileable texture; PBR-ish look
262
+ Scene/backdrop: neutral lighting reference only
263
+ Constraints: seamless edges; no obvious focal elements; no text; no logos or trademarks; no watermark
264
+ ```
265
+
266
+ ### Wireframe template
267
+ ```
268
+ Use case: ui-mockup
269
+ Asset type: website wireframe
270
+ Primary request: <page or flow to sketch>
271
+ Style/medium: low-fi grayscale wireframe
272
+ Composition/framing: <landscape or portrait to match expected device>
273
+ Subject: <sections in order; grid/columns; key labels>
274
+ Constraints: no color; no logos; no real photos; no watermark
275
+ ```
276
+
277
+ ### Wireframe example: homepage (desktop)
278
+ ```
279
+ Use case: ui-mockup
280
+ Asset type: website wireframe
281
+ Primary request: SaaS homepage layout with clear hierarchy
282
+ Style/medium: low-fi grayscale wireframe
283
+ Subject: top nav; hero with headline and CTA; three feature cards; testimonial strip; pricing preview; footer
284
+ Composition/framing: landscape desktop layout
285
+ Constraints: label major blocks; no color; no logos; no real photos; no watermark
286
+ ```
287
+
288
+ ### Wireframe example: pricing page
289
+ ```
290
+ Use case: ui-mockup
291
+ Asset type: website wireframe
292
+ Primary request: pricing page layout with comparison table
293
+ Style/medium: low-fi grayscale wireframe
294
+ Subject: header; plan toggle; 3 pricing cards; comparison table; FAQ accordion; footer
295
+ Composition/framing: desktop or tablet layout
296
+ Constraints: label key areas; no color; no logos; no real photos; no watermark
297
+ ```
298
+
299
+ ### Wireframe example: mobile onboarding flow
300
+ ```
301
+ Use case: ui-mockup
302
+ Asset type: mobile onboarding wireframe
303
+ Primary request: three-screen mobile onboarding flow
304
+ Style/medium: low-fi grayscale wireframe
305
+ Subject: screen 1 headline and CTA; screen 2 feature bullets; screen 3 form fields and CTA
306
+ Composition/framing: portrait mobile layout
307
+ Constraints: label screens and blocks; no color; no logos; no real photos; no watermark
308
+ ```
309
+
310
+ ### Logo template
311
+ ```
312
+ Use case: logo-brand
313
+ Asset type: logo concept
314
+ Primary request: <brand idea or symbol concept>
315
+ Style/medium: vector logo mark; flat colors; minimal
316
+ Composition/framing: centered mark; clear silhouette; generous margin
317
+ Color palette: <1-2 colors; high contrast>
318
+ Text (verbatim): "<exact name>" (only if needed)
319
+ Constraints: no gradients; no mockups; no 3D; no watermark
320
+ ```
321
+
322
+ ### Logo example: abstract symbol mark
323
+ ```
324
+ Use case: logo-brand
325
+ Asset type: logo concept
326
+ Primary request: geometric leaf symbol suggesting sustainability and growth
327
+ Style/medium: vector logo mark; flat colors; minimal
328
+ Composition/framing: centered mark; clear silhouette
329
+ Color palette: deep green and off-white
330
+ Constraints: no text unless requested; no gradients; no mockups; no 3D; no watermark
331
+ ```
332
+
333
+ ### Logo example: monogram mark
334
+ ```
335
+ Use case: logo-brand
336
+ Asset type: logo concept
337
+ Primary request: interlocking monogram of the letters "AV"
338
+ Style/medium: vector logo mark; flat colors; minimal
339
+ Composition/framing: centered mark; balanced spacing
340
+ Color palette: black on white
341
+ Constraints: no gradients; no mockups; no 3D; no watermark
342
+ ```
343
+
344
+ ### Logo example: wordmark
345
+ ```
346
+ Use case: logo-brand
347
+ Asset type: logo concept
348
+ Primary request: clean wordmark for a modern studio
349
+ Style/medium: vector wordmark; flat colors; minimal
350
+ Text (verbatim): "Studio North"
351
+ Composition/framing: centered text; even letter spacing
352
+ Constraints: no gradients; no mockups; no 3D; no watermark
353
+ ```
354
+
355
+ ## Edit
356
+
357
+ ### text-localization
358
+ ```
359
+ Use case: text-localization
360
+ Input images: Image 1: original infographic
361
+ Primary request: replace "Bean Hopper", "Grinder", "Brew Group", "Boiler", "Water Tank", and "Drip Tray" with "Tolva", "Molino", "Grupo de infusión", "Caldera", "Depósito de agua", and "Bandeja de goteo"
362
+ Constraints: change only the text; preserve layout, typography, spacing, and hierarchy; no extra words; do not alter logos or imagery
363
+ ```
364
+
365
+ ### identity-preserve
366
+ ```
367
+ Use case: identity-preserve
368
+ Input images: Image 1: person photo; Image 2..N: clothing references
369
+ Primary request: replace only the clothing with the provided garments
370
+ Constraints: preserve face, body shape, pose, hair, expression, and identity; match lighting and shadows; keep the background unchanged; no accessories or text
371
+ ```
372
+
373
+ ### precise-object-edit
374
+ ```
375
+ Use case: precise-object-edit
376
+ Input images: Image 1: room photo
377
+ Primary request: replace only the white chairs with wooden chairs
378
+ Constraints: preserve camera angle, room lighting, floor shadows, and surrounding objects; keep all other aspects unchanged
379
+ ```
380
+
381
+ ### lighting-weather
382
+ ```
383
+ Use case: lighting-weather
384
+ Input images: Image 1: original photo
385
+ Primary request: make it look like a winter evening with gentle snowfall
386
+ Constraints: preserve subject identity, geometry, camera angle, and composition; change only lighting, atmosphere, and weather
387
+ ```
388
+
389
+ ### style-transfer
390
+ ```
391
+ Use case: style-transfer
392
+ Input images: Image 1: style reference
393
+ Primary request: apply Image 1's visual style to a man riding a motorcycle on a plain white backdrop
394
+ Constraints: preserve palette, texture, and brushwork; no extra elements
395
+ ```
396
+
397
+ ### compositing
398
+ ```
399
+ Use case: compositing
400
+ Input images: Image 1: base scene; Image 2: subject to insert
401
+ Primary request: place the subject from Image 2 next to the person in Image 1
402
+ Constraints: match lighting, perspective, and scale; keep the base framing unchanged; no extra elements
403
+ ```
404
+
405
+ ### character consistency workflow
406
+ ```
407
+ Use case: identity-preserve
408
+ Input images: Image 1: previous character anchor illustration
409
+ Primary request: continue the story with the same character in a new scene and action
410
+ Scene/backdrop: snowy forest after a winter storm
411
+ Subject: same young forest hero gently helping a frightened squirrel out of a fallen tree
412
+ Style/medium: same children's book watercolor illustration style as Image 1
413
+ Constraints: do not redesign the character; preserve facial features, proportions, outfit, color palette, and personality; no text; no watermark
414
+ ```
415
+
416
+ ### sketch-to-render
417
+ ```
418
+ Use case: sketch-to-render
419
+ Input images: Image 1: drawing
420
+ Primary request: turn the drawing into a photorealistic image
421
+ Constraints: preserve layout, proportions, and perspective; choose realistic materials and lighting; do not add new elements or text
422
+ ```
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/scripts/image_gen.py ADDED
@@ -0,0 +1,1030 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Fallback CLI for explicit image generation or editing with GPT Image models.
3
+
4
+ Used only when the user explicitly opts into CLI fallback mode, or when explicit
5
+ transparent output requires the `gpt-image-1.5` fallback path.
6
+
7
+ Defaults to gpt-image-2 and a structured prompt augmentation workflow.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import argparse
13
+ import asyncio
14
+ import base64
15
+ import json
16
+ import os
17
+ from pathlib import Path
18
+ import re
19
+ import sys
20
+ import time
21
+ from typing import Any, Dict, Iterable, List, Optional, Tuple
22
+
23
+ from io import BytesIO
24
+
25
+ DEFAULT_MODEL = "gpt-image-2"
26
+ DEFAULT_SIZE = "auto"
27
+ DEFAULT_QUALITY = "medium"
28
+ DEFAULT_OUTPUT_FORMAT = "png"
29
+ DEFAULT_CONCURRENCY = 5
30
+ DEFAULT_DOWNSCALE_SUFFIX = "-web"
31
+ DEFAULT_OUTPUT_PATH = "output/imagegen/output.png"
32
+ GPT_IMAGE_MODEL_PREFIX = "gpt-image-"
33
+
34
+ ALLOWED_LEGACY_SIZES = {"1024x1024", "1536x1024", "1024x1536", "auto"}
35
+ ALLOWED_QUALITIES = {"low", "medium", "high", "auto"}
36
+ ALLOWED_BACKGROUNDS = {"transparent", "opaque", "auto", None}
37
+ ALLOWED_INPUT_FIDELITIES = {"low", "high", None}
38
+
39
+ GPT_IMAGE_2_MODEL = "gpt-image-2"
40
+ GPT_IMAGE_2_MIN_PIXELS = 655_360
41
+ GPT_IMAGE_2_MAX_PIXELS = 8_294_400
42
+ GPT_IMAGE_2_MAX_EDGE = 3840
43
+ GPT_IMAGE_2_MAX_RATIO = 3.0
44
+
45
+ MAX_IMAGE_BYTES = 50 * 1024 * 1024
46
+ MAX_BATCH_JOBS = 500
47
+
48
+
49
+ def _die(message: str, code: int = 1) -> None:
50
+ print(f"Error: {message}", file=sys.stderr)
51
+ raise SystemExit(code)
52
+
53
+
54
+ def _warn(message: str) -> None:
55
+ print(f"Warning: {message}", file=sys.stderr)
56
+
57
+
58
+ def _dependency_hint(package: str, *, upgrade: bool = False) -> str:
59
+ command = f"uv pip install {'-U ' if upgrade else ''}{package}"
60
+ return (
61
+ "Activate the repo-selected environment first, then install it with "
62
+ f"`{command}`. If this repo uses a local virtualenv, start with "
63
+ "`source .venv/bin/activate`; otherwise use this repo's configured shared fallback "
64
+ "environment. If your project declares dependencies, prefer that project's normal "
65
+ "`uv sync` flow."
66
+ )
67
+
68
+
69
+ def _ensure_api_key(dry_run: bool) -> None:
70
+ if os.getenv("OPENAI_API_KEY"):
71
+ print("OPENAI_API_KEY is set.", file=sys.stderr)
72
+ return
73
+ if dry_run:
74
+ _warn("OPENAI_API_KEY is not set; dry-run only.")
75
+ return
76
+ _die("OPENAI_API_KEY is not set. Export it before running.")
77
+
78
+
79
+ def _read_prompt(prompt: Optional[str], prompt_file: Optional[str]) -> str:
80
+ if prompt and prompt_file:
81
+ _die("Use --prompt or --prompt-file, not both.")
82
+ if prompt_file:
83
+ path = Path(prompt_file)
84
+ if not path.exists():
85
+ _die(f"Prompt file not found: {path}")
86
+ return path.read_text(encoding="utf-8").strip()
87
+ if prompt:
88
+ return prompt.strip()
89
+ _die("Missing prompt. Use --prompt or --prompt-file.")
90
+ return "" # unreachable
91
+
92
+
93
+ def _check_image_paths(paths: Iterable[str]) -> List[Path]:
94
+ resolved: List[Path] = []
95
+ for raw in paths:
96
+ path = Path(raw)
97
+ if not path.exists():
98
+ _die(f"Image file not found: {path}")
99
+ if path.stat().st_size > MAX_IMAGE_BYTES:
100
+ _warn(f"Image exceeds 50MB limit: {path}")
101
+ resolved.append(path)
102
+ return resolved
103
+
104
+
105
+ def _normalize_output_format(fmt: Optional[str]) -> str:
106
+ if not fmt:
107
+ return DEFAULT_OUTPUT_FORMAT
108
+ fmt = fmt.lower()
109
+ if fmt not in {"png", "jpeg", "jpg", "webp"}:
110
+ _die("output-format must be png, jpeg, jpg, or webp.")
111
+ return "jpeg" if fmt == "jpg" else fmt
112
+
113
+
114
+ def _parse_size(size: str) -> Optional[Tuple[int, int]]:
115
+ match = re.fullmatch(r"([1-9][0-9]*)x([1-9][0-9]*)", size)
116
+ if not match:
117
+ return None
118
+ return int(match.group(1)), int(match.group(2))
119
+
120
+
121
+ def _validate_gpt_image_2_size(size: str) -> None:
122
+ if size == "auto":
123
+ return
124
+
125
+ parsed = _parse_size(size)
126
+ if parsed is None:
127
+ _die("size must be auto or WIDTHxHEIGHT, for example 1024x1024.")
128
+
129
+ width, height = parsed
130
+ max_edge = max(width, height)
131
+ min_edge = min(width, height)
132
+ total_pixels = width * height
133
+
134
+ if max_edge > GPT_IMAGE_2_MAX_EDGE:
135
+ _die(
136
+ "gpt-image-2 size maximum edge length must be less than or equal to 3840px."
137
+ )
138
+ if width % 16 != 0 or height % 16 != 0:
139
+ _die("gpt-image-2 size width and height must be multiples of 16px.")
140
+ if max_edge / min_edge > GPT_IMAGE_2_MAX_RATIO:
141
+ _die("gpt-image-2 size long edge to short edge ratio must not exceed 3:1.")
142
+ if total_pixels < GPT_IMAGE_2_MIN_PIXELS or total_pixels > GPT_IMAGE_2_MAX_PIXELS:
143
+ _die(
144
+ "gpt-image-2 size total pixels must be at least 655,360 and no more than 8,294,400."
145
+ )
146
+
147
+
148
+ def _validate_size(size: str, model: str) -> None:
149
+ if model == GPT_IMAGE_2_MODEL:
150
+ _validate_gpt_image_2_size(size)
151
+ return
152
+
153
+ if size not in ALLOWED_LEGACY_SIZES:
154
+ _die(
155
+ "size must be one of 1024x1024, 1536x1024, 1024x1536, or auto for this GPT Image model."
156
+ )
157
+
158
+
159
+ def _validate_quality(quality: str) -> None:
160
+ if quality not in ALLOWED_QUALITIES:
161
+ _die("quality must be one of low, medium, high, or auto.")
162
+
163
+
164
+ def _validate_background(background: Optional[str]) -> None:
165
+ if background not in ALLOWED_BACKGROUNDS:
166
+ _die("background must be one of transparent, opaque, or auto.")
167
+
168
+
169
+ def _validate_input_fidelity(input_fidelity: Optional[str]) -> None:
170
+ if input_fidelity not in ALLOWED_INPUT_FIDELITIES:
171
+ _die("input-fidelity must be one of low or high.")
172
+
173
+
174
+ def _validate_model(model: str) -> None:
175
+ if not model.startswith(GPT_IMAGE_MODEL_PREFIX):
176
+ _die(
177
+ "model must be a GPT Image model (for example gpt-image-1.5, gpt-image-1, or gpt-image-1-mini)."
178
+ )
179
+
180
+
181
+ def _validate_transparency(background: Optional[str], output_format: str) -> None:
182
+ if background == "transparent" and output_format not in {"png", "webp"}:
183
+ _die("transparent background requires output-format png or webp.")
184
+
185
+
186
+ def _validate_model_specific_options(
187
+ *,
188
+ model: str,
189
+ background: Optional[str],
190
+ input_fidelity: Optional[str] = None,
191
+ ) -> None:
192
+ if model != GPT_IMAGE_2_MODEL:
193
+ return
194
+ if background == "transparent":
195
+ _die(
196
+ "transparent backgrounds are not supported in gpt-image-2, the latest model. "
197
+ "Use --model gpt-image-1.5 --background transparent --output-format png instead."
198
+ )
199
+ if input_fidelity is not None:
200
+ _die(
201
+ "input_fidelity is not supported in gpt-image-2 because image inputs always use high fidelity for this model."
202
+ )
203
+
204
+
205
+ def _validate_generate_payload(payload: Dict[str, Any]) -> None:
206
+ model = str(payload.get("model", DEFAULT_MODEL))
207
+ _validate_model(model)
208
+ n = int(payload.get("n", 1))
209
+ if n < 1 or n > 10:
210
+ _die("n must be between 1 and 10")
211
+ size = str(payload.get("size", DEFAULT_SIZE))
212
+ quality = str(payload.get("quality", DEFAULT_QUALITY))
213
+ background = payload.get("background")
214
+ _validate_size(size, model)
215
+ _validate_quality(quality)
216
+ _validate_background(background)
217
+ _validate_model_specific_options(model=model, background=background)
218
+ oc = payload.get("output_compression")
219
+ if oc is not None and not (0 <= int(oc) <= 100):
220
+ _die("output_compression must be between 0 and 100")
221
+
222
+
223
+ def _build_output_paths(
224
+ out: str,
225
+ output_format: str,
226
+ count: int,
227
+ out_dir: Optional[str],
228
+ ) -> List[Path]:
229
+ ext = "." + output_format
230
+
231
+ if out_dir:
232
+ out_base = Path(out_dir)
233
+ out_base.mkdir(parents=True, exist_ok=True)
234
+ return [out_base / f"image_{i}{ext}" for i in range(1, count + 1)]
235
+
236
+ out_path = Path(out)
237
+ if out_path.exists() and out_path.is_dir():
238
+ out_path.mkdir(parents=True, exist_ok=True)
239
+ return [out_path / f"image_{i}{ext}" for i in range(1, count + 1)]
240
+
241
+ if out_path.suffix == "":
242
+ out_path = out_path.with_suffix(ext)
243
+ elif output_format and out_path.suffix.lstrip(".").lower() != output_format:
244
+ _warn(
245
+ f"Output extension {out_path.suffix} does not match output-format {output_format}."
246
+ )
247
+
248
+ if count == 1:
249
+ return [out_path]
250
+
251
+ return [
252
+ out_path.with_name(f"{out_path.stem}-{i}{out_path.suffix}")
253
+ for i in range(1, count + 1)
254
+ ]
255
+
256
+
257
+ def _augment_prompt(args: argparse.Namespace, prompt: str) -> str:
258
+ fields = _fields_from_args(args)
259
+ return _augment_prompt_fields(args.augment, prompt, fields)
260
+
261
+
262
+ def _augment_prompt_fields(
263
+ augment: bool, prompt: str, fields: Dict[str, Optional[str]]
264
+ ) -> str:
265
+ if not augment:
266
+ return prompt
267
+
268
+ sections: List[str] = []
269
+ if fields.get("use_case"):
270
+ sections.append(f"Use case: {fields['use_case']}")
271
+ sections.append(f"Primary request: {prompt}")
272
+ if fields.get("scene"):
273
+ sections.append(f"Scene/background: {fields['scene']}")
274
+ if fields.get("subject"):
275
+ sections.append(f"Subject: {fields['subject']}")
276
+ if fields.get("style"):
277
+ sections.append(f"Style/medium: {fields['style']}")
278
+ if fields.get("composition"):
279
+ sections.append(f"Composition/framing: {fields['composition']}")
280
+ if fields.get("lighting"):
281
+ sections.append(f"Lighting/mood: {fields['lighting']}")
282
+ if fields.get("palette"):
283
+ sections.append(f"Color palette: {fields['palette']}")
284
+ if fields.get("materials"):
285
+ sections.append(f"Materials/textures: {fields['materials']}")
286
+ if fields.get("text"):
287
+ sections.append(f'Text (verbatim): "{fields["text"]}"')
288
+ if fields.get("constraints"):
289
+ sections.append(f"Constraints: {fields['constraints']}")
290
+ if fields.get("negative"):
291
+ sections.append(f"Avoid: {fields['negative']}")
292
+
293
+ return "\n".join(sections)
294
+
295
+
296
+ def _fields_from_args(args: argparse.Namespace) -> Dict[str, Optional[str]]:
297
+ return {
298
+ "use_case": getattr(args, "use_case", None),
299
+ "scene": getattr(args, "scene", None),
300
+ "subject": getattr(args, "subject", None),
301
+ "style": getattr(args, "style", None),
302
+ "composition": getattr(args, "composition", None),
303
+ "lighting": getattr(args, "lighting", None),
304
+ "palette": getattr(args, "palette", None),
305
+ "materials": getattr(args, "materials", None),
306
+ "text": getattr(args, "text", None),
307
+ "constraints": getattr(args, "constraints", None),
308
+ "negative": getattr(args, "negative", None),
309
+ }
310
+
311
+
312
+ def _print_request(payload: dict) -> None:
313
+ print(json.dumps(payload, indent=2, sort_keys=True))
314
+
315
+
316
+ def _decode_and_write(images: List[str], outputs: List[Path], force: bool) -> None:
317
+ for idx, image_b64 in enumerate(images):
318
+ if idx >= len(outputs):
319
+ break
320
+ out_path = outputs[idx]
321
+ if out_path.exists() and not force:
322
+ _die(f"Output already exists: {out_path} (use --force to overwrite)")
323
+ out_path.parent.mkdir(parents=True, exist_ok=True)
324
+ out_path.write_bytes(base64.b64decode(image_b64))
325
+ print(f"Wrote {out_path}")
326
+
327
+
328
+ def _derive_downscale_path(path: Path, suffix: str) -> Path:
329
+ if suffix and not suffix.startswith("-") and not suffix.startswith("_"):
330
+ suffix = "-" + suffix
331
+ return path.with_name(f"{path.stem}{suffix}{path.suffix}")
332
+
333
+
334
+ def _downscale_image_bytes(
335
+ image_bytes: bytes, *, max_dim: int, output_format: str
336
+ ) -> bytes:
337
+ try:
338
+ from PIL import Image
339
+ except Exception:
340
+ _die(f"Downscaling requires Pillow. {_dependency_hint('pillow')}")
341
+
342
+ if max_dim < 1:
343
+ _die("--downscale-max-dim must be >= 1")
344
+
345
+ with Image.open(BytesIO(image_bytes)) as img:
346
+ img.load()
347
+ w, h = img.size
348
+ scale = min(1.0, float(max_dim) / float(max(w, h)))
349
+ target = (max(1, int(round(w * scale))), max(1, int(round(h * scale))))
350
+
351
+ resized = (
352
+ img if target == (w, h) else img.resize(target, Image.Resampling.LANCZOS)
353
+ )
354
+
355
+ fmt = output_format.lower()
356
+ if fmt == "jpg":
357
+ fmt = "jpeg"
358
+
359
+ if fmt == "jpeg":
360
+ if resized.mode in ("RGBA", "LA") or (
361
+ "transparency" in getattr(resized, "info", {})
362
+ ):
363
+ bg = Image.new("RGB", resized.size, (255, 255, 255))
364
+ bg.paste(
365
+ resized.convert("RGBA"), mask=resized.convert("RGBA").split()[-1]
366
+ )
367
+ resized = bg
368
+ else:
369
+ resized = resized.convert("RGB")
370
+
371
+ out = BytesIO()
372
+ resized.save(out, format=fmt.upper())
373
+ return out.getvalue()
374
+
375
+
376
+ def _decode_write_and_downscale(
377
+ images: List[str],
378
+ outputs: List[Path],
379
+ *,
380
+ force: bool,
381
+ downscale_max_dim: Optional[int],
382
+ downscale_suffix: str,
383
+ output_format: str,
384
+ ) -> None:
385
+ for idx, image_b64 in enumerate(images):
386
+ if idx >= len(outputs):
387
+ break
388
+ out_path = outputs[idx]
389
+ if out_path.exists() and not force:
390
+ _die(f"Output already exists: {out_path} (use --force to overwrite)")
391
+ out_path.parent.mkdir(parents=True, exist_ok=True)
392
+
393
+ raw = base64.b64decode(image_b64)
394
+ out_path.write_bytes(raw)
395
+ print(f"Wrote {out_path}")
396
+
397
+ if downscale_max_dim is None:
398
+ continue
399
+
400
+ derived = _derive_downscale_path(out_path, downscale_suffix)
401
+ if derived.exists() and not force:
402
+ _die(f"Output already exists: {derived} (use --force to overwrite)")
403
+ derived.parent.mkdir(parents=True, exist_ok=True)
404
+ resized = _downscale_image_bytes(
405
+ raw, max_dim=downscale_max_dim, output_format=output_format
406
+ )
407
+ derived.write_bytes(resized)
408
+ print(f"Wrote {derived}")
409
+
410
+
411
+ def _create_client():
412
+ try:
413
+ from openai import OpenAI
414
+ except ImportError:
415
+ _die(
416
+ f"openai SDK not installed in the active environment. {_dependency_hint('openai')}"
417
+ )
418
+ return OpenAI()
419
+
420
+
421
+ def _create_async_client():
422
+ try:
423
+ from openai import AsyncOpenAI
424
+ except ImportError:
425
+ try:
426
+ import openai as _openai # noqa: F401
427
+ except ImportError:
428
+ _die(
429
+ f"openai SDK not installed in the active environment. {_dependency_hint('openai')}"
430
+ )
431
+ _die(
432
+ "AsyncOpenAI not available in this openai SDK version. "
433
+ f"{_dependency_hint('openai', upgrade=True)}"
434
+ )
435
+ return AsyncOpenAI()
436
+
437
+
438
+ def _slugify(value: str) -> str:
439
+ value = value.strip().lower()
440
+ value = re.sub(r"[^a-z0-9]+", "-", value)
441
+ value = re.sub(r"-{2,}", "-", value).strip("-")
442
+ return value[:60] if value else "job"
443
+
444
+
445
+ def _normalize_job(job: Any, idx: int) -> Dict[str, Any]:
446
+ if isinstance(job, str):
447
+ prompt = job.strip()
448
+ if not prompt:
449
+ _die(f"Empty prompt at job {idx}")
450
+ return {"prompt": prompt}
451
+ if isinstance(job, dict):
452
+ if "prompt" not in job or not str(job["prompt"]).strip():
453
+ _die(f"Missing prompt for job {idx}")
454
+ return job
455
+ _die(f"Invalid job at index {idx}: expected string or object.")
456
+ return {} # unreachable
457
+
458
+
459
+ def _read_jobs_jsonl(path: str) -> List[Dict[str, Any]]:
460
+ p = Path(path)
461
+ if not p.exists():
462
+ _die(f"Input file not found: {p}")
463
+ jobs: List[Dict[str, Any]] = []
464
+ for line_no, raw in enumerate(p.read_text(encoding="utf-8").splitlines(), start=1):
465
+ line = raw.strip()
466
+ if not line or line.startswith("#"):
467
+ continue
468
+ try:
469
+ item: Any
470
+ if line.startswith("{"):
471
+ item = json.loads(line)
472
+ else:
473
+ item = line
474
+ jobs.append(_normalize_job(item, idx=line_no))
475
+ except json.JSONDecodeError as exc:
476
+ _die(f"Invalid JSON on line {line_no}: {exc}")
477
+ if not jobs:
478
+ _die("No jobs found in input file.")
479
+ if len(jobs) > MAX_BATCH_JOBS:
480
+ _die(f"Too many jobs ({len(jobs)}). Max is {MAX_BATCH_JOBS}.")
481
+ return jobs
482
+
483
+
484
+ def _merge_non_null(dst: Dict[str, Any], src: Dict[str, Any]) -> Dict[str, Any]:
485
+ merged = dict(dst)
486
+ for k, v in src.items():
487
+ if v is not None:
488
+ merged[k] = v
489
+ return merged
490
+
491
+
492
+ def _job_output_paths(
493
+ *,
494
+ out_dir: Path,
495
+ output_format: str,
496
+ idx: int,
497
+ prompt: str,
498
+ n: int,
499
+ explicit_out: Optional[str],
500
+ ) -> List[Path]:
501
+ out_dir.mkdir(parents=True, exist_ok=True)
502
+ ext = "." + output_format
503
+
504
+ if explicit_out:
505
+ base = Path(explicit_out)
506
+ if base.suffix == "":
507
+ base = base.with_suffix(ext)
508
+ elif base.suffix.lstrip(".").lower() != output_format:
509
+ _warn(
510
+ f"Job {idx}: output extension {base.suffix} does not match output-format {output_format}."
511
+ )
512
+ base = out_dir / base.name
513
+ else:
514
+ slug = _slugify(prompt[:80])
515
+ base = out_dir / f"{idx:03d}-{slug}{ext}"
516
+
517
+ if n == 1:
518
+ return [base]
519
+ return [base.with_name(f"{base.stem}-{i}{base.suffix}") for i in range(1, n + 1)]
520
+
521
+
522
+ def _extract_retry_after_seconds(exc: Exception) -> Optional[float]:
523
+ # Best-effort: openai SDK errors vary by version. Prefer a conservative fallback.
524
+ for attr in ("retry_after", "retry_after_seconds"):
525
+ val = getattr(exc, attr, None)
526
+ if isinstance(val, (int, float)) and val >= 0:
527
+ return float(val)
528
+ msg = str(exc)
529
+ m = re.search(r"retry[- ]after[:= ]+([0-9]+(?:\\.[0-9]+)?)", msg, re.IGNORECASE)
530
+ if m:
531
+ try:
532
+ return float(m.group(1))
533
+ except Exception:
534
+ return None
535
+ return None
536
+
537
+
538
+ def _is_rate_limit_error(exc: Exception) -> bool:
539
+ name = exc.__class__.__name__.lower()
540
+ if "ratelimit" in name or "rate_limit" in name:
541
+ return True
542
+ msg = str(exc).lower()
543
+ return "429" in msg or "rate limit" in msg or "too many requests" in msg
544
+
545
+
546
+ def _is_transient_error(exc: Exception) -> bool:
547
+ if _is_rate_limit_error(exc):
548
+ return True
549
+ name = exc.__class__.__name__.lower()
550
+ if "timeout" in name or "timedout" in name or "tempor" in name:
551
+ return True
552
+ msg = str(exc).lower()
553
+ return "timeout" in msg or "timed out" in msg or "connection reset" in msg
554
+
555
+
556
+ async def _generate_one_with_retries(
557
+ client: Any,
558
+ payload: Dict[str, Any],
559
+ *,
560
+ attempts: int,
561
+ job_label: str,
562
+ ) -> Any:
563
+ last_exc: Optional[Exception] = None
564
+ for attempt in range(1, attempts + 1):
565
+ try:
566
+ return await client.images.generate(**payload)
567
+ except Exception as exc:
568
+ last_exc = exc
569
+ if not _is_transient_error(exc):
570
+ raise
571
+ if attempt == attempts:
572
+ raise
573
+ sleep_s = _extract_retry_after_seconds(exc)
574
+ if sleep_s is None:
575
+ sleep_s = min(60.0, 2.0**attempt)
576
+ print(
577
+ f"{job_label} attempt {attempt}/{attempts} failed ({exc.__class__.__name__}); retrying in {sleep_s:.1f}s",
578
+ file=sys.stderr,
579
+ )
580
+ await asyncio.sleep(sleep_s)
581
+ raise last_exc or RuntimeError("unknown error")
582
+
583
+
584
+ async def _run_generate_batch(args: argparse.Namespace) -> int:
585
+ jobs = _read_jobs_jsonl(args.input)
586
+ out_dir = Path(args.out_dir)
587
+
588
+ base_fields = _fields_from_args(args)
589
+ base_payload = {
590
+ "model": args.model,
591
+ "n": args.n,
592
+ "size": args.size,
593
+ "quality": args.quality,
594
+ "background": args.background,
595
+ "output_format": args.output_format,
596
+ "output_compression": args.output_compression,
597
+ "moderation": args.moderation,
598
+ }
599
+
600
+ if args.dry_run:
601
+ for i, job in enumerate(jobs, start=1):
602
+ prompt = str(job["prompt"]).strip()
603
+ fields = _merge_non_null(base_fields, job.get("fields", {}))
604
+ # Allow flat job keys as well (use_case, scene, etc.)
605
+ fields = _merge_non_null(
606
+ fields, {k: job.get(k) for k in base_fields.keys()}
607
+ )
608
+ augmented = _augment_prompt_fields(args.augment, prompt, fields)
609
+
610
+ job_payload = dict(base_payload)
611
+ job_payload["prompt"] = augmented
612
+ job_payload = _merge_non_null(
613
+ job_payload, {k: job.get(k) for k in base_payload.keys()}
614
+ )
615
+ job_payload = {k: v for k, v in job_payload.items() if v is not None}
616
+
617
+ _validate_generate_payload(job_payload)
618
+ effective_output_format = _normalize_output_format(
619
+ job_payload.get("output_format")
620
+ )
621
+ _validate_transparency(
622
+ job_payload.get("background"), effective_output_format
623
+ )
624
+ job_payload["output_format"] = effective_output_format
625
+
626
+ n = int(job_payload.get("n", 1))
627
+ outputs = _job_output_paths(
628
+ out_dir=out_dir,
629
+ output_format=effective_output_format,
630
+ idx=i,
631
+ prompt=prompt,
632
+ n=n,
633
+ explicit_out=job.get("out"),
634
+ )
635
+ downscaled = None
636
+ if args.downscale_max_dim is not None:
637
+ downscaled = [
638
+ str(_derive_downscale_path(p, args.downscale_suffix))
639
+ for p in outputs
640
+ ]
641
+ _print_request(
642
+ {
643
+ "endpoint": "/v1/images/generations",
644
+ "job": i,
645
+ "outputs": [str(p) for p in outputs],
646
+ "outputs_downscaled": downscaled,
647
+ **job_payload,
648
+ }
649
+ )
650
+ return 0
651
+
652
+ client = _create_async_client()
653
+ sem = asyncio.Semaphore(args.concurrency)
654
+
655
+ any_failed = False
656
+
657
+ async def run_job(i: int, job: Dict[str, Any]) -> Tuple[int, Optional[str]]:
658
+ nonlocal any_failed
659
+ prompt = str(job["prompt"]).strip()
660
+ job_label = f"[job {i}/{len(jobs)}]"
661
+
662
+ fields = _merge_non_null(base_fields, job.get("fields", {}))
663
+ fields = _merge_non_null(fields, {k: job.get(k) for k in base_fields.keys()})
664
+ augmented = _augment_prompt_fields(args.augment, prompt, fields)
665
+
666
+ payload = dict(base_payload)
667
+ payload["prompt"] = augmented
668
+ payload = _merge_non_null(payload, {k: job.get(k) for k in base_payload.keys()})
669
+ payload = {k: v for k, v in payload.items() if v is not None}
670
+
671
+ n = int(payload.get("n", 1))
672
+ _validate_generate_payload(payload)
673
+ effective_output_format = _normalize_output_format(payload.get("output_format"))
674
+ _validate_transparency(payload.get("background"), effective_output_format)
675
+ payload["output_format"] = effective_output_format
676
+ outputs = _job_output_paths(
677
+ out_dir=out_dir,
678
+ output_format=effective_output_format,
679
+ idx=i,
680
+ prompt=prompt,
681
+ n=n,
682
+ explicit_out=job.get("out"),
683
+ )
684
+ try:
685
+ async with sem:
686
+ print(f"{job_label} starting", file=sys.stderr)
687
+ started = time.time()
688
+ result = await _generate_one_with_retries(
689
+ client,
690
+ payload,
691
+ attempts=args.max_attempts,
692
+ job_label=job_label,
693
+ )
694
+ elapsed = time.time() - started
695
+ print(f"{job_label} completed in {elapsed:.1f}s", file=sys.stderr)
696
+ images = [item.b64_json for item in result.data]
697
+ _decode_write_and_downscale(
698
+ images,
699
+ outputs,
700
+ force=args.force,
701
+ downscale_max_dim=args.downscale_max_dim,
702
+ downscale_suffix=args.downscale_suffix,
703
+ output_format=effective_output_format,
704
+ )
705
+ return i, None
706
+ except Exception as exc:
707
+ any_failed = True
708
+ print(f"{job_label} failed: {exc}", file=sys.stderr)
709
+ if args.fail_fast:
710
+ raise
711
+ return i, str(exc)
712
+
713
+ tasks = [
714
+ asyncio.create_task(run_job(i, job)) for i, job in enumerate(jobs, start=1)
715
+ ]
716
+
717
+ try:
718
+ await asyncio.gather(*tasks)
719
+ except Exception:
720
+ for t in tasks:
721
+ if not t.done():
722
+ t.cancel()
723
+ raise
724
+
725
+ return 1 if any_failed else 0
726
+
727
+
728
+ def _generate_batch(args: argparse.Namespace) -> None:
729
+ exit_code = asyncio.run(_run_generate_batch(args))
730
+ if exit_code:
731
+ raise SystemExit(exit_code)
732
+
733
+
734
+ def _generate(args: argparse.Namespace) -> None:
735
+ prompt = _read_prompt(args.prompt, args.prompt_file)
736
+ prompt = _augment_prompt(args, prompt)
737
+
738
+ payload = {
739
+ "model": args.model,
740
+ "prompt": prompt,
741
+ "n": args.n,
742
+ "size": args.size,
743
+ "quality": args.quality,
744
+ "background": args.background,
745
+ "output_format": args.output_format,
746
+ "output_compression": args.output_compression,
747
+ "moderation": args.moderation,
748
+ }
749
+ payload = {k: v for k, v in payload.items() if v is not None}
750
+
751
+ output_format = _normalize_output_format(args.output_format)
752
+ _validate_transparency(args.background, output_format)
753
+ payload["output_format"] = output_format
754
+ output_paths = _build_output_paths(args.out, output_format, args.n, args.out_dir)
755
+ downscaled = None
756
+ if args.downscale_max_dim is not None:
757
+ downscaled = [
758
+ str(_derive_downscale_path(p, args.downscale_suffix)) for p in output_paths
759
+ ]
760
+
761
+ if args.dry_run:
762
+ _print_request(
763
+ {
764
+ "endpoint": "/v1/images/generations",
765
+ "outputs": [str(p) for p in output_paths],
766
+ "outputs_downscaled": downscaled,
767
+ **payload,
768
+ }
769
+ )
770
+ return
771
+
772
+ print(
773
+ "Calling Image API (generation). This can take up to a couple of minutes.",
774
+ file=sys.stderr,
775
+ )
776
+ started = time.time()
777
+ client = _create_client()
778
+ result = client.images.generate(**payload)
779
+ elapsed = time.time() - started
780
+ print(f"Generation completed in {elapsed:.1f}s.", file=sys.stderr)
781
+
782
+ images = [item.b64_json for item in result.data]
783
+ _decode_write_and_downscale(
784
+ images,
785
+ output_paths,
786
+ force=args.force,
787
+ downscale_max_dim=args.downscale_max_dim,
788
+ downscale_suffix=args.downscale_suffix,
789
+ output_format=output_format,
790
+ )
791
+
792
+
793
+ def _edit(args: argparse.Namespace) -> None:
794
+ prompt = _read_prompt(args.prompt, args.prompt_file)
795
+ prompt = _augment_prompt(args, prompt)
796
+
797
+ image_paths = _check_image_paths(args.image)
798
+ mask_path = Path(args.mask) if args.mask else None
799
+ if mask_path:
800
+ if not mask_path.exists():
801
+ _die(f"Mask file not found: {mask_path}")
802
+ if mask_path.suffix.lower() != ".png":
803
+ _warn(f"Mask should be a PNG with an alpha channel: {mask_path}")
804
+ if mask_path.stat().st_size > MAX_IMAGE_BYTES:
805
+ _warn(f"Mask exceeds 50MB limit: {mask_path}")
806
+
807
+ payload = {
808
+ "model": args.model,
809
+ "prompt": prompt,
810
+ "n": args.n,
811
+ "size": args.size,
812
+ "quality": args.quality,
813
+ "background": args.background,
814
+ "output_format": args.output_format,
815
+ "output_compression": args.output_compression,
816
+ "input_fidelity": args.input_fidelity,
817
+ "moderation": args.moderation,
818
+ }
819
+ payload = {k: v for k, v in payload.items() if v is not None}
820
+
821
+ output_format = _normalize_output_format(args.output_format)
822
+ _validate_transparency(args.background, output_format)
823
+ payload["output_format"] = output_format
824
+ _validate_input_fidelity(args.input_fidelity)
825
+ output_paths = _build_output_paths(args.out, output_format, args.n, args.out_dir)
826
+ downscaled = None
827
+ if args.downscale_max_dim is not None:
828
+ downscaled = [
829
+ str(_derive_downscale_path(p, args.downscale_suffix)) for p in output_paths
830
+ ]
831
+
832
+ if args.dry_run:
833
+ payload_preview = dict(payload)
834
+ payload_preview["image"] = [str(p) for p in image_paths]
835
+ if mask_path:
836
+ payload_preview["mask"] = str(mask_path)
837
+ _print_request(
838
+ {
839
+ "endpoint": "/v1/images/edits",
840
+ "outputs": [str(p) for p in output_paths],
841
+ "outputs_downscaled": downscaled,
842
+ **payload_preview,
843
+ }
844
+ )
845
+ return
846
+
847
+ print(
848
+ f"Calling Image API (edit) with {len(image_paths)} image(s).",
849
+ file=sys.stderr,
850
+ )
851
+ started = time.time()
852
+ client = _create_client()
853
+
854
+ with _open_files(image_paths) as image_files, _open_mask(mask_path) as mask_file:
855
+ request = dict(payload)
856
+ request["image"] = image_files if len(image_files) > 1 else image_files[0]
857
+ if mask_file is not None:
858
+ request["mask"] = mask_file
859
+ result = client.images.edit(**request)
860
+
861
+ elapsed = time.time() - started
862
+ print(f"Edit completed in {elapsed:.1f}s.", file=sys.stderr)
863
+ images = [item.b64_json for item in result.data]
864
+ _decode_write_and_downscale(
865
+ images,
866
+ output_paths,
867
+ force=args.force,
868
+ downscale_max_dim=args.downscale_max_dim,
869
+ downscale_suffix=args.downscale_suffix,
870
+ output_format=output_format,
871
+ )
872
+
873
+
874
+ def _open_files(paths: List[Path]):
875
+ return _FileBundle(paths)
876
+
877
+
878
+ def _open_mask(mask_path: Optional[Path]):
879
+ if mask_path is None:
880
+ return _NullContext()
881
+ return _SingleFile(mask_path)
882
+
883
+
884
+ class _NullContext:
885
+ def __enter__(self):
886
+ return None
887
+
888
+ def __exit__(self, exc_type, exc, tb):
889
+ return False
890
+
891
+
892
+ class _SingleFile:
893
+ def __init__(self, path: Path):
894
+ self._path = path
895
+ self._handle = None
896
+
897
+ def __enter__(self):
898
+ self._handle = self._path.open("rb")
899
+ return self._handle
900
+
901
+ def __exit__(self, exc_type, exc, tb):
902
+ if self._handle:
903
+ try:
904
+ self._handle.close()
905
+ except Exception:
906
+ pass
907
+ return False
908
+
909
+
910
+ class _FileBundle:
911
+ def __init__(self, paths: List[Path]):
912
+ self._paths = paths
913
+ self._handles: List[object] = []
914
+
915
+ def __enter__(self):
916
+ self._handles = [p.open("rb") for p in self._paths]
917
+ return self._handles
918
+
919
+ def __exit__(self, exc_type, exc, tb):
920
+ for handle in self._handles:
921
+ try:
922
+ handle.close()
923
+ except Exception:
924
+ pass
925
+ return False
926
+
927
+
928
+ def _add_shared_args(parser: argparse.ArgumentParser) -> None:
929
+ parser.add_argument("--model", default=DEFAULT_MODEL)
930
+ parser.add_argument("--prompt")
931
+ parser.add_argument("--prompt-file")
932
+ parser.add_argument("--n", type=int, default=1)
933
+ parser.add_argument("--size", default=DEFAULT_SIZE)
934
+ parser.add_argument("--quality", default=DEFAULT_QUALITY)
935
+ parser.add_argument("--background")
936
+ parser.add_argument("--output-format")
937
+ parser.add_argument("--output-compression", type=int)
938
+ parser.add_argument("--moderation")
939
+ parser.add_argument("--out", default=DEFAULT_OUTPUT_PATH)
940
+ parser.add_argument("--out-dir")
941
+ parser.add_argument("--force", action="store_true")
942
+ parser.add_argument("--dry-run", action="store_true")
943
+ parser.add_argument("--augment", dest="augment", action="store_true")
944
+ parser.add_argument("--no-augment", dest="augment", action="store_false")
945
+ parser.set_defaults(augment=True)
946
+
947
+ # Prompt augmentation hints
948
+ parser.add_argument("--use-case")
949
+ parser.add_argument("--scene")
950
+ parser.add_argument("--subject")
951
+ parser.add_argument("--style")
952
+ parser.add_argument("--composition")
953
+ parser.add_argument("--lighting")
954
+ parser.add_argument("--palette")
955
+ parser.add_argument("--materials")
956
+ parser.add_argument("--text")
957
+ parser.add_argument("--constraints")
958
+ parser.add_argument("--negative")
959
+
960
+ # Post-processing (optional): generate an additional downscaled copy for fast web loading.
961
+ parser.add_argument("--downscale-max-dim", type=int)
962
+ parser.add_argument("--downscale-suffix", default=DEFAULT_DOWNSCALE_SUFFIX)
963
+
964
+
965
+ def main() -> int:
966
+ parser = argparse.ArgumentParser(
967
+ description="Fallback CLI for explicit image generation or editing via GPT Image models"
968
+ )
969
+ subparsers = parser.add_subparsers(dest="command", required=True)
970
+
971
+ gen_parser = subparsers.add_parser("generate", help="Create a new image")
972
+ _add_shared_args(gen_parser)
973
+ gen_parser.set_defaults(func=_generate)
974
+
975
+ batch_parser = subparsers.add_parser(
976
+ "generate-batch",
977
+ help="Generate multiple prompts concurrently (JSONL input)",
978
+ )
979
+ _add_shared_args(batch_parser)
980
+ batch_parser.add_argument(
981
+ "--input", required=True, help="Path to JSONL file (one job per line)"
982
+ )
983
+ batch_parser.add_argument("--concurrency", type=int, default=DEFAULT_CONCURRENCY)
984
+ batch_parser.add_argument("--max-attempts", type=int, default=3)
985
+ batch_parser.add_argument("--fail-fast", action="store_true")
986
+ batch_parser.set_defaults(func=_generate_batch)
987
+
988
+ edit_parser = subparsers.add_parser("edit", help="Edit an existing image")
989
+ _add_shared_args(edit_parser)
990
+ edit_parser.add_argument("--image", action="append", required=True)
991
+ edit_parser.add_argument("--mask")
992
+ edit_parser.add_argument("--input-fidelity")
993
+ edit_parser.set_defaults(func=_edit)
994
+
995
+ args = parser.parse_args()
996
+ if args.n < 1 or args.n > 10:
997
+ _die("--n must be between 1 and 10")
998
+ if getattr(args, "concurrency", 1) < 1 or getattr(args, "concurrency", 1) > 25:
999
+ _die("--concurrency must be between 1 and 25")
1000
+ if getattr(args, "max_attempts", 3) < 1 or getattr(args, "max_attempts", 3) > 10:
1001
+ _die("--max-attempts must be between 1 and 10")
1002
+ if args.output_compression is not None and not (
1003
+ 0 <= args.output_compression <= 100
1004
+ ):
1005
+ _die("--output-compression must be between 0 and 100")
1006
+ if args.command == "generate-batch" and not args.out_dir:
1007
+ _die("generate-batch requires --out-dir")
1008
+ if (
1009
+ getattr(args, "downscale_max_dim", None) is not None
1010
+ and args.downscale_max_dim < 1
1011
+ ):
1012
+ _die("--downscale-max-dim must be >= 1")
1013
+
1014
+ _validate_model(args.model)
1015
+ _validate_size(args.size, args.model)
1016
+ _validate_quality(args.quality)
1017
+ _validate_background(args.background)
1018
+ _validate_model_specific_options(
1019
+ model=args.model,
1020
+ background=args.background,
1021
+ input_fidelity=getattr(args, "input_fidelity", None),
1022
+ )
1023
+ _ensure_api_key(args.dry_run)
1024
+
1025
+ args.func(args)
1026
+ return 0
1027
+
1028
+
1029
+ if __name__ == "__main__":
1030
+ raise SystemExit(main())
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/imagegen/scripts/remove_chroma_key.py ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Remove a solid chroma-key background from an image.
3
+
4
+ This helper supports the imagegen skill's built-in-first transparent workflow:
5
+ generate an image on a flat key color, then convert that key color to alpha.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import argparse
11
+ from io import BytesIO
12
+ from pathlib import Path
13
+ import re
14
+ from statistics import median
15
+ import sys
16
+ from typing import Tuple
17
+
18
+
19
+ Color = Tuple[int, int, int]
20
+ KEY_DOMINANCE_THRESHOLD = 16.0
21
+ ALPHA_NOISE_FLOOR = 8
22
+
23
+
24
+ def _die(message: str, code: int = 1) -> None:
25
+ print(f"Error: {message}", file=sys.stderr)
26
+ raise SystemExit(code)
27
+
28
+
29
+ def _dependency_hint(package: str) -> str:
30
+ return (
31
+ "Activate the repo-selected environment first, then install it with "
32
+ f"`uv pip install {package}`. If this repo uses a local virtualenv, start with "
33
+ "`source .venv/bin/activate`; otherwise use this repo's configured shared fallback "
34
+ "environment."
35
+ )
36
+
37
+
38
+ def _load_pillow():
39
+ try:
40
+ from PIL import Image, ImageFilter
41
+ except ImportError:
42
+ _die(f"Pillow is required for chroma-key removal. {_dependency_hint('pillow')}")
43
+ return Image, ImageFilter
44
+
45
+
46
+ def _parse_key_color(raw: str) -> Color:
47
+ value = raw.strip()
48
+ match = re.fullmatch(r"#?([0-9a-fA-F]{6})", value)
49
+ if not match:
50
+ _die("key color must be a hex RGB value like #00ff00.")
51
+ hex_value = match.group(1)
52
+ return (
53
+ int(hex_value[0:2], 16),
54
+ int(hex_value[2:4], 16),
55
+ int(hex_value[4:6], 16),
56
+ )
57
+
58
+
59
+ def _validate_args(args: argparse.Namespace) -> None:
60
+ if args.tolerance < 0 or args.tolerance > 255:
61
+ _die("--tolerance must be between 0 and 255.")
62
+ if args.transparent_threshold < 0 or args.transparent_threshold > 255:
63
+ _die("--transparent-threshold must be between 0 and 255.")
64
+ if args.opaque_threshold < 0 or args.opaque_threshold > 255:
65
+ _die("--opaque-threshold must be between 0 and 255.")
66
+ if args.soft_matte and args.transparent_threshold >= args.opaque_threshold:
67
+ _die("--transparent-threshold must be lower than --opaque-threshold.")
68
+ if args.edge_feather < 0 or args.edge_feather > 64:
69
+ _die("--edge-feather must be between 0 and 64.")
70
+ if args.edge_contract < 0 or args.edge_contract > 16:
71
+ _die("--edge-contract must be between 0 and 16.")
72
+
73
+ src = Path(args.input)
74
+ if not src.exists():
75
+ _die(f"Input image not found: {src}")
76
+
77
+ out = Path(args.out)
78
+ if out.exists() and not args.force:
79
+ _die(f"Output already exists: {out} (use --force to overwrite)")
80
+
81
+ if out.suffix.lower() not in {".png", ".webp"}:
82
+ _die("--out must end in .png or .webp so the alpha channel is preserved.")
83
+
84
+
85
+ def _channel_distance(a: Color, b: Color) -> int:
86
+ return max(abs(a[0] - b[0]), abs(a[1] - b[1]), abs(a[2] - b[2]))
87
+
88
+
89
+ def _clamp_channel(value: float) -> int:
90
+ return max(0, min(255, int(round(value))))
91
+
92
+
93
+ def _smoothstep(value: float) -> float:
94
+ value = max(0.0, min(1.0, value))
95
+ return value * value * (3.0 - 2.0 * value)
96
+
97
+
98
+ def _soft_alpha(
99
+ distance: int, transparent_threshold: float, opaque_threshold: float
100
+ ) -> int:
101
+ if distance <= transparent_threshold:
102
+ return 0
103
+ if distance >= opaque_threshold:
104
+ return 255
105
+ ratio = (float(distance) - transparent_threshold) / (
106
+ opaque_threshold - transparent_threshold
107
+ )
108
+ return _clamp_channel(255.0 * _smoothstep(ratio))
109
+
110
+
111
+ def _dominance_alpha(rgb: Color, key: Color) -> int:
112
+ spill_channels = _spill_channels(key)
113
+ if not spill_channels:
114
+ return 255
115
+
116
+ channels = [float(value) for value in rgb]
117
+ non_spill = [idx for idx in range(3) if idx not in spill_channels]
118
+ key_strength = (
119
+ min(channels[idx] for idx in spill_channels)
120
+ if len(spill_channels) > 1
121
+ else channels[spill_channels[0]]
122
+ )
123
+ non_key_strength = max((channels[idx] for idx in non_spill), default=0.0)
124
+ dominance = key_strength - non_key_strength
125
+ if dominance <= 0:
126
+ return 255
127
+
128
+ denominator = max(1.0, float(max(key)) - non_key_strength)
129
+ alpha = 1.0 - min(1.0, dominance / denominator)
130
+ return _clamp_channel(alpha * 255.0)
131
+
132
+
133
+ def _spill_channels(key: Color) -> list[int]:
134
+ key_max = max(key)
135
+ if key_max < 128:
136
+ return []
137
+ return [
138
+ idx for idx, value in enumerate(key) if value >= key_max - 16 and value >= 128
139
+ ]
140
+
141
+
142
+ def _key_channel_dominance(rgb: Color, key: Color) -> float:
143
+ spill_channels = _spill_channels(key)
144
+ if not spill_channels:
145
+ return 0.0
146
+
147
+ channels = [float(value) for value in rgb]
148
+ non_spill = [idx for idx in range(3) if idx not in spill_channels]
149
+ key_strength = (
150
+ min(channels[idx] for idx in spill_channels)
151
+ if len(spill_channels) > 1
152
+ else channels[spill_channels[0]]
153
+ )
154
+ non_key_strength = max((channels[idx] for idx in non_spill), default=0.0)
155
+ return key_strength - non_key_strength
156
+
157
+
158
+ def _looks_key_colored(rgb: Color, key: Color, distance: int) -> bool:
159
+ if distance <= 32:
160
+ return True
161
+
162
+ spill_channels = _spill_channels(key)
163
+ if not spill_channels:
164
+ return True
165
+
166
+ return _key_channel_dominance(rgb, key) >= KEY_DOMINANCE_THRESHOLD
167
+
168
+
169
+ def _cleanup_spill(rgb: Color, key: Color, alpha: int = 255) -> Color:
170
+ if alpha >= 252:
171
+ return rgb
172
+
173
+ spill_channels = _spill_channels(key)
174
+ if not spill_channels:
175
+ return rgb
176
+
177
+ channels = [float(value) for value in rgb]
178
+ non_spill = [idx for idx in range(3) if idx not in spill_channels]
179
+ if non_spill:
180
+ anchor = max(channels[idx] for idx in non_spill)
181
+ cap = max(0.0, anchor - 1.0)
182
+ for idx in spill_channels:
183
+ if channels[idx] > cap:
184
+ channels[idx] = cap
185
+
186
+ return (
187
+ _clamp_channel(channels[0]),
188
+ _clamp_channel(channels[1]),
189
+ _clamp_channel(channels[2]),
190
+ )
191
+
192
+
193
+ def _apply_alpha_to_image(
194
+ image,
195
+ *,
196
+ key: Color,
197
+ tolerance: int,
198
+ spill_cleanup: bool,
199
+ soft_matte: bool,
200
+ transparent_threshold: float,
201
+ opaque_threshold: float,
202
+ ) -> int:
203
+ pixels = image.load()
204
+ width, height = image.size
205
+ transparent = 0
206
+
207
+ for y in range(height):
208
+ for x in range(width):
209
+ red, green, blue, alpha = pixels[x, y]
210
+ rgb = (red, green, blue)
211
+ distance = _channel_distance(rgb, key)
212
+ key_like = _looks_key_colored(rgb, key, distance)
213
+ output_alpha = (
214
+ min(
215
+ _soft_alpha(distance, transparent_threshold, opaque_threshold),
216
+ _dominance_alpha(rgb, key),
217
+ )
218
+ if soft_matte and key_like
219
+ else (0 if distance <= tolerance else 255)
220
+ )
221
+ output_alpha = int(round(output_alpha * (alpha / 255.0)))
222
+ if 0 < output_alpha <= ALPHA_NOISE_FLOOR:
223
+ output_alpha = 0
224
+
225
+ if output_alpha == 0:
226
+ pixels[x, y] = (0, 0, 0, 0)
227
+ transparent += 1
228
+ continue
229
+
230
+ if spill_cleanup and key_like:
231
+ red, green, blue = _cleanup_spill(rgb, key, output_alpha)
232
+ pixels[x, y] = (red, green, blue, output_alpha)
233
+
234
+ return transparent
235
+
236
+
237
+ def _contract_alpha(image, pixels: int):
238
+ if pixels == 0:
239
+ return image
240
+
241
+ _, ImageFilter = _load_pillow()
242
+ alpha = image.getchannel("A")
243
+ for _ in range(pixels):
244
+ alpha = alpha.filter(ImageFilter.MinFilter(3))
245
+ image.putalpha(alpha)
246
+ return image
247
+
248
+
249
+ def _apply_edge_feather(image, radius: float):
250
+ if radius == 0:
251
+ return image
252
+
253
+ _, ImageFilter = _load_pillow()
254
+ alpha = image.getchannel("A")
255
+ alpha = alpha.filter(ImageFilter.GaussianBlur(radius=radius))
256
+ image.putalpha(alpha)
257
+ return image
258
+
259
+
260
+ def _encode_image(image, output_format: str) -> bytes:
261
+ out = BytesIO()
262
+ image.save(out, format=output_format.upper())
263
+ return out.getvalue()
264
+
265
+
266
+ def _alpha_counts(image) -> tuple[int, int, int]:
267
+ pixels = image.load()
268
+ width, height = image.size
269
+ total = 0
270
+ transparent = 0
271
+ partial = 0
272
+
273
+ for y in range(height):
274
+ for x in range(width):
275
+ alpha = pixels[x, y][3]
276
+ total += 1
277
+ if alpha == 0:
278
+ transparent += 1
279
+ elif alpha < 255:
280
+ partial += 1
281
+
282
+ return total, transparent, partial
283
+
284
+
285
+ def _sample_border_key(image, mode: str) -> Color:
286
+ width, height = image.size
287
+ pixels = image.load()
288
+ samples: list[Color] = []
289
+
290
+ if mode == "corners":
291
+ patch = max(1, min(width, height, 12))
292
+ boxes = [
293
+ (0, 0, patch, patch),
294
+ (width - patch, 0, width, patch),
295
+ (0, height - patch, patch, height),
296
+ (width - patch, height - patch, width, height),
297
+ ]
298
+ for left, top, right, bottom in boxes:
299
+ for y in range(top, bottom):
300
+ for x in range(left, right):
301
+ red, green, blue = pixels[x, y][:3]
302
+ samples.append((red, green, blue))
303
+ else:
304
+ band = max(1, min(width, height, 6))
305
+ step = max(1, min(width, height) // 256)
306
+ for x in range(0, width, step):
307
+ for y in range(band):
308
+ red, green, blue = pixels[x, y][:3]
309
+ samples.append((red, green, blue))
310
+ red, green, blue = pixels[x, height - 1 - y][:3]
311
+ samples.append((red, green, blue))
312
+ for y in range(0, height, step):
313
+ for x in range(band):
314
+ red, green, blue = pixels[x, y][:3]
315
+ samples.append((red, green, blue))
316
+ red, green, blue = pixels[width - 1 - x, y][:3]
317
+ samples.append((red, green, blue))
318
+
319
+ if not samples:
320
+ _die("Could not sample background key color from image border.")
321
+
322
+ return (
323
+ int(round(median(sample[0] for sample in samples))),
324
+ int(round(median(sample[1] for sample in samples))),
325
+ int(round(median(sample[2] for sample in samples))),
326
+ )
327
+
328
+
329
+ def _remove_chroma_key(args: argparse.Namespace) -> None:
330
+ Image, _ = _load_pillow()
331
+ src = Path(args.input)
332
+ out = Path(args.out)
333
+
334
+ with Image.open(src) as image:
335
+ rgba = image.convert("RGBA")
336
+ key = (
337
+ _sample_border_key(rgba, args.auto_key)
338
+ if args.auto_key != "none"
339
+ else _parse_key_color(args.key_color)
340
+ )
341
+
342
+ transparent = _apply_alpha_to_image(
343
+ rgba,
344
+ key=key,
345
+ tolerance=args.tolerance,
346
+ spill_cleanup=args.spill_cleanup,
347
+ soft_matte=args.soft_matte,
348
+ transparent_threshold=args.transparent_threshold,
349
+ opaque_threshold=args.opaque_threshold,
350
+ )
351
+ rgba = _contract_alpha(rgba, args.edge_contract)
352
+ rgba = _apply_edge_feather(rgba, args.edge_feather)
353
+
354
+ total, transparent_after, partial_after = _alpha_counts(rgba)
355
+
356
+ out.parent.mkdir(parents=True, exist_ok=True)
357
+ output_format = "PNG" if out.suffix.lower() == ".png" else "WEBP"
358
+ out.write_bytes(_encode_image(rgba, output_format))
359
+
360
+ print(f"Wrote {out}")
361
+ print(f"Key color: #{key[0]:02x}{key[1]:02x}{key[2]:02x}")
362
+ print(f"Transparent pixels: {transparent_after}/{total}")
363
+ print(f"Partially transparent pixels: {partial_after}/{total}")
364
+ if transparent == 0:
365
+ print(
366
+ "Warning: no pixels matched the key color before feathering.",
367
+ file=sys.stderr,
368
+ )
369
+
370
+
371
+ def _build_parser() -> argparse.ArgumentParser:
372
+ parser = argparse.ArgumentParser(
373
+ description="Remove a solid chroma-key background and write an image with alpha."
374
+ )
375
+ parser.add_argument("--input", required=True, help="Input image path.")
376
+ parser.add_argument("--out", required=True, help="Output .png or .webp path.")
377
+ parser.add_argument(
378
+ "--key-color",
379
+ default="#00ff00",
380
+ help="Hex RGB key color to remove, for example #00ff00.",
381
+ )
382
+ parser.add_argument(
383
+ "--tolerance",
384
+ type=int,
385
+ default=12,
386
+ help="Hard-key per-channel tolerance for matching the key color, 0-255.",
387
+ )
388
+ parser.add_argument(
389
+ "--auto-key",
390
+ choices=["none", "corners", "border"],
391
+ default="none",
392
+ help="Sample the key color from image corners or border instead of --key-color.",
393
+ )
394
+ parser.add_argument(
395
+ "--soft-matte",
396
+ action="store_true",
397
+ help="Use a smooth alpha ramp between transparent and opaque thresholds.",
398
+ )
399
+ parser.add_argument(
400
+ "--transparent-threshold",
401
+ type=float,
402
+ default=12.0,
403
+ help="Soft-matte distance at or below which pixels become fully transparent.",
404
+ )
405
+ parser.add_argument(
406
+ "--opaque-threshold",
407
+ type=float,
408
+ default=96.0,
409
+ help="Soft-matte distance at or above which pixels become fully opaque.",
410
+ )
411
+ parser.add_argument(
412
+ "--edge-feather",
413
+ type=float,
414
+ default=0.0,
415
+ help="Optional alpha blur radius for softened edges, 0-64.",
416
+ )
417
+ parser.add_argument(
418
+ "--edge-contract",
419
+ type=int,
420
+ default=0,
421
+ help="Shrink the visible alpha matte by this many pixels before feathering.",
422
+ )
423
+ parser.add_argument(
424
+ "--spill-cleanup",
425
+ dest="spill_cleanup",
426
+ action="store_true",
427
+ help="Reduce obvious key-color spill on opaque pixels.",
428
+ )
429
+ parser.add_argument(
430
+ "--despill",
431
+ dest="spill_cleanup",
432
+ action="store_true",
433
+ help="Alias for --spill-cleanup; decontaminate key-color edge spill.",
434
+ )
435
+ parser.add_argument(
436
+ "--force", action="store_true", help="Overwrite an existing output file."
437
+ )
438
+ return parser
439
+
440
+
441
+ def main() -> None:
442
+ parser = _build_parser()
443
+ args = parser.parse_args()
444
+ _validate_args(args)
445
+ _remove_chroma_key(args)
446
+
447
+
448
+ if __name__ == "__main__":
449
+ main()
20261001T054755.827592Z_eval/episode-0011/runtime_uy_v15n7/codex/skills/.system/openai-docs/LICENSE.txt ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf of
171
+ any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don\'t include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.