• Stefy Lanza (nextime / spora )'s avatar
    return the bytes when b64_json asks for them · b2da096f
    Stefy Lanza (nextime / spora ) authored
    Found by generating a real image against the live server: a request with
    "response_format": "b64_json" came back {url, path} and no bytes.
    
    The request model documents OpenAI's values -- url and b64_json -- and every
    OpenAI SDK sends the latter. save_image_response compared against this
    codebase's own older internal spelling, "base64", so with --file-path
    configured the documented behaviour ("if the client explicitly requested
    base64, include it") could never fire for a standards-compliant client. It got
    a URL, no bytes, and nothing in the response to say why. Nine call sites were
    affected: generations, edits, inpaint, upscale, depth, segment and the rest.
    
    Both spellings are accepted now. The url path is unchanged -- the point of
    --file-path is not to ship megabytes inline.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_014T3rZnmWyKjWZerwsb27jZ
    b2da096f
test_image_response_format.py 2.67 KB