Banana Straightener: AI image generation that actually gets it right
Finally, an AI image generator that doesn't give up after one try

The Great Wave with Surfers. I prompted the model to remove the boats from the original image, to remove text, and to add surfers. It got it right on the third try.
You know that feeling when you're trying to get Nano Banana (aka Gemini 2.5 Flash Image) to generate exactly what you want?
You write a prompt. Nano Banana generates something... close-ish. You tweak the prompt. Still not quite right. You add more details. Now it's doing something completely different. Three hours later, you're typing prompts like "NO, NOT THAT KIND OF BANANA, YOU HEARTLESS MACHINE!".
Here's the thing about AI image generation
It's basically gambling. You pull the slot machine lever, hope for the best, and when you inevitably get three lemons instead of three cherries, you just... pull again. And again. And again.
The whole process is broken:
- You write a prompt
- The AI generates one image
- It's wrong
- You manually adjust your prompt
- Repeat until your coffee or sanity run out.
Enter Banana Straightener
So I built something different. Something that doesn't give up after one try.
Banana Straightener works more like a stubborn perfectionist than a slot machine:
- Generates an initial image from your prompt
- Looks at what it made (using AI vision)
- If the image is what you wanted, it's done. The 🍒🍒🍒 aligned on the slot machine and you get your prize.
- If the image is not what you wanted, it realizes "oh crap, that's not right"
- Figures out what's wrong
- Tries again with better instructions
- Keeps going until it actually gets it right
Getting started is stupid simple
That's it. You're ready to go.
Three ways to use it
1. Command line (for the terminal warriors)
You can get your API key from Google AI Studio.
2. Web interface (for normal humans)
It will automatically open your browser. You'll see:
- Each iteration as it happens
- What the AI thinks is wrong
- The fixes it's trying
- Your final masterpiece

3. Python API (for the builders)
The clever bits
It actually understands what went wrong
Instead of blindly retrying, Banana Straightener figures out the specific problems:
- Missing something? "Add ruler markings to the banana"
- Wrong position? "Center the banana in the frame"
- Wrong color? "Make the banana bright yellow"
- Wrong style? "Photographic, not cartoon"
No infinite loops of stupidity
You know when AI gets stuck doing the same wrong thing over and over? Yeah, we fixed that.
If it detects it's going in circles, it automatically tries:
- Different styles
- Different wording
- Negative prompts ("NOT curved", "avoid cartoon")
- Metaphors ("straight like a ruler")
Everything is saved
Every session keeps:
- All iteration images
- What the AI was thinking at each step
- The prompts it tried
- A full report of what happened
- ZIP file with everything
The tech stack (for the nerds)
I'm using:
- Google's Gemini 2.5 Flash Image (aka Nano Banana) model for image generation
- Gemini 2.5 Flash Image (yes, the same model!) for evaluation (it can work with both images and text)
- Gradio for the web UI
- Rich for pretty terminal output
Who is this for?
Artists who are tired of prompt engineering
Just describe what you want. Let the AI figure out the details.
Developers building apps
Reliable image generation you can actually ship to production.
Regular people who just want their damn image
No more wrestling with prompts for hours.
It's open source
The whole thing is open-source and on GitHub: https://github.com/velvet-shark/banana-straightener
Want to help? Cool. Would be great to have:
- Bug reports (there are definitely bugs)
- Better evaluation criteria
- Smarter prompt enhancement
- UI improvements
- More banana puns
Try it right now
Or if terminals scare you:
Check out the GitHub repo for docs, examples, and to complain about bugs.
Look, I built this because I was frustrated. Every AI image tool makes you work way too hard for mediocre results. This one doesn't give up until it gets it right, or until the model stubbornly refuses to generate an image that matches your prompt over the limit of iterations that you set.
Is it perfect? No.
Is it better than manually tweaking prompts for hours? Absolutely.
Give it a try. Straighten some bananas.