Created
November 17, 2025 15:41
-
-
Save peterc/d6683cce1f11abbf25393c02ef6c5265 to your computer and use it in GitHub Desktop.
Produce images with gemini-2.5-flash-image (Nano Banana) with RubyLLM 1.9.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Just because the example in the docs doesn't seem to work outside of a Rails app | |
| require 'ruby_llm' | |
| RubyLLM.configure do |config| | |
| config.gemini_api_key = ENV['GEMINI_API_KEY'] | |
| end | |
| chat = RubyLLM.chat(model: "gemini-2.5-flash-image") | |
| reply = chat.ask("Cyberpunk city street at night, raining, neon signs") | |
| image = reply.content[:attachments].first | |
| image.save("output.png") |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Still can't establish how to send the aspect ratio information as in the Google example though: