Skip to content

openai_image.py: add -i/--image to edit an existing image from a path or URL - #333

Merged
simonw merged 1 commit into
mainfrom
claude/image-gen-existing-input-59s8q0
Sep 8, 2026
Merged

openai_image.py: add -i/--image to edit an existing image from a path or URL#333
simonw merged 1 commit into
mainfrom
claude/image-gen-existing-input-59s8q0

Conversation

@simonw

@simonw simonw commented Sep 8, 2026

Copy link
Copy Markdown
Owner

I want "Run this: uv run https://tools.simonwillison.net/python/openai_image.py \ 'Add a racoon eating cheese wearing an inappropriate hat' -m gpt-image-2.5-sunburst" to grow an extra option for feeding in a file path or URL to an existing image

When one or more -i/--image values are supplied the prompt is sent to
images.edit instead of images.generate. Each value may be a local file
path or an http(s) URL. Also adds --input-fidelity (edit only) and warns
about options the edit endpoint does not accept, such as --moderation.

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01L8h3oaw6d4jqwKs8AKo6UN

… or URL

When one or more -i/--image values are supplied the prompt is sent to
images.edit instead of images.generate. Each value may be a local file
path or an http(s) URL. Also adds --input-fidelity (edit only) and warns
about options the edit endpoint does not accept, such as --moderation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8h3oaw6d4jqwKs8AKo6UN
@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

@simonw

simonw commented Sep 8, 2026

Copy link
Copy Markdown
Owner Author
image

@simonw

simonw commented Sep 8, 2026

Copy link
Copy Markdown
Owner Author
uv run python/openai_image.py \
  'add a raccoon scientist studying the chart thoughtfully' \
  -i https://static.simonwillison.net/static/2026/openai-agent-usage.webp \
  -m gpt-image-2.5-sunburst
image

@simonw
simonw merged commit 0b8aadd into main Sep 8, 2026
1 of 4 checks passed
@simonw

simonw commented Sep 8, 2026

Copy link
Copy Markdown
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants