Skip to content

[OPENAI] Support Image edits gpt-image-1 #138

@sbounmy

Description

@sbounmy

OpenAI recently released their new image generation model via API: gpt-image-1.

It would be great to add support for it in the gem.

Notes

  • gpt-image-1 uses a different endpoint: images/edits.
  • Currently, RubyLLM#paint uses images/generations endpoint (code).
  • It's a bit odd that OpenAI introduced a separate endpoint instead of simply allowing an image input on generations, but that's the current setup.

Proposal:

I suggest introducing a new method, maybe RubyLLM#edit, to support the images/edits endpoint separately without changing the existing paint method.

Or update RubyLLM#paint to support :

RubyLLM.paint 'transform me this image into ghibli style", with: { image: some_image }

WDYT?

Lastly, I am wondering if this would be possible (instead of just #paint) :

chat = RubyLLM.chat
chat.draw "transform me into ghibli style", with: { image: "me.png" }

# Analyze images
chat.draw "can you turn the landscape into blue pastel colors?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions