Repository navigation
fix(openai): use edits endpoint for image-to-image - #328
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe OpenAI image client now parses URL or Base64 responses. Text-to-image requests use the generations endpoint, while image-to-image requests use the edits endpoint with validated image file uploads. ChangesOpenAI image requests
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Image generation and editing response paths preserve usable image data; no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit packs a PNG with care, Comment |
Summary
Use the OpenAI Images edits endpoint for image-to-image requests made through the
v1/imagemode, and support the Base64 image responses returned by GPT Image models for both generation and editing. Previously, reference images were passed through the generations endpoint and both paths assumed a URL response.Type of change
Changes
v1/imageimage-to-image calls throughclient.images.edit.urlandb64_jsonresults for image generation and editing.response_formatparameter and remove the non-standardwatermarkrequest field.v1/chatimage flows unchanged.Screenshots / Logs
Not applicable (backend-only change).
Validation:
Checklist
requirements.txt(if applicable)Summary by CodeRabbit