Loading...
Loading...
Generate images with gpt-image-2 through an OpenAI-compatible Image API using the current OPENAI_API_KEY, OPENAI_BASE_URL, or CUSTOM_IMAGE_URL environment variables. Use when the user asks to call gpt-image-2 via API/CLI, /v1/images/generations, the prior /api/image/generate endpoint flow, or wants the faster API route instead of Codex CLI image_generation/session extraction.
npx skill4agent add ranger1112/ranger-image-skills ranger-image-2gpt-image-2~/.codex/ranger-image-2/config.json--configurescripts/generate_image.py--enable image_generationCUSTOM_IMAGE_URLhttps://host/api/image/generatehttps://host/v1/v1/images/generations/api/image/generate/v1OPENAI_API_KEYOPENAI_BASE_URLCUSTOM_IMAGE_URLpython skills/ranger-image-2/scripts/generate_image.py --configure~/.codex/ranger-image-2/config.jsonpython skills/ranger-image-2/scripts/generate_image.py `
--prompt "Create a sunset afterglow..." `
--out output/imagegen/sunset.png `
--size 1536x1024 `
--quality high `
--forceOPENAI_BASE_URL/v1CUSTOM_IMAGE_URLscripts/generate_image.py --dry-runscripts/generate_image.py --configurescripts/generate_image.py--prompt-file--promptoutput/imagegen/Add-Type -AssemblyName System.Drawing
$path = 'output/imagegen/result.png'
$item = Get-Item -LiteralPath $path
$img = [System.Drawing.Image]::FromFile((Resolve-Path $path).Path)
try {
[pscustomobject]@{
Path = $path
Bytes = $item.Length
Dimensions = "$($img.Width)x$($img.Height)"
} | ConvertTo-Json -Compress
} finally {
$img.Dispose()
}404 page not found/api/image/generate/v1/images/generationsOPENAI_BASE_URL=https://host/v1urlliburllibpython skills/ranger-image-2/scripts/generate_image.py --configureopenai SDK is not installedpython -m pip install openai--force