I have an app using Nano Banana Pro preview for generating language lessons with high dense text. Works fine quite a few times but then there are times when it just refuses to generate images and output no image. The code remains the same, just the behaviour of the service becomes erratic.
raise ValueError("No image data found in response parts")
ValueError: No image data found in response parts
raise ValueError(error_msg)
ValueError: No image data found. Finish reason: FinishReason.STOP
*“A bustling cafe scene in Garmisch-Partenkirchen, Bavaria, Germany. The cafe, “Cafe Wilder,” has large windows overlooking snow-capped mountains. Inside, three people are seated at a wooden table cluttered with maps, hiking brochures, and half-empty Apfelschorle glasses. One is a young man with a tablet showing a hiking app. The second is an older woman in traditional Bavarian Tracht, pointing at a map of the Alps. The third, presumably the learner’s persona, is looking thoughtfully at the maps. A chalkboard menu displays German cakes and coffee variations: “Kuchen: Schwarzwälder Kirschtorte, Apfelstrudel. Kaffee: Kaffee, Cappuccino, Latte Macchiato.” A sign near the entrance reads: “Wanderkarten erhältlich!” (Hiking maps available!). Outside, a couple in hiking gear, including functional jackets and sturdy boots, walks by. [LEFT BOX: dark background, white text] Exercise Instructions: Role-play with the AI as the learner. You are helping your friends plan a hiking trip in the Bavarian Alps. Express your preferences, make suggestions about routes and difficulty, and give advice on what to pack, considering weather and “Schicki Micki” locations. [RIGHT BOX: dark background, white text] Übungsanweisungen: Spiele mit der KI als Lernender. Du hilfst deinen Freunden bei der Planung einer Wanderung in den bayerischen Alpen. Äußere deine Vorlieben, mache Vorschläge zu Routen und Schwierigkeitsgrad, und gib Ratschläge, was man einpacken sollte, unter Berücksichtigung des Wetters und “Schicki Micki” Orten.”
The time it works I do get a good image.*
Question is why does it fail so many times.
Just 5 mins later I try the prompt and the api is just not working for this prompt, which is similar to the previous one.
*“A sun-drenched café terrace in Garmisch-Partenkirchen, Bavaria, Germany. In the foreground, a wooden table with a red-and-white checkered tablecloth. Spread on the table are various hiking maps of the Bavarian Alps, brochures for local attractions, and a half-eaten “Apfelstrudel” with a dusting of powdered sugar. Two partially filled glasses of “Apfelschorle” sit beside the food. Two young adults, Lena and Markus, are seated at the table, intensely studying the maps. Lena is wearing a modern hiking jacket and has her hair pulled back in a ponytail. Markus is sporting a traditional Bavarian “Trachten” jacket and a casual t-shirt. In the background, the majestic Zugspitze mountain looms, its peak dusted with snow. A sign on the café building reads “Café am Berg - Kaffee und Kuchen.” A waitress wearing a traditional “Dirndl” is approaching the table with a tray. Another poster on the wall advertises a “Wanderwoche” (hiking week) with guided tours. The vibe is very relaxed and a little “Schicki Micki”. [LEFT BOX: white text on black background] Exercise Instructions: You are helping Lena and Markus plan their hiking trip. Suggest an itinerary for their week, considering their interest in both challenging hikes and relaxed sightseeing. Express your preferences and give advice on specific trails and activities, incorporating vocabulary related to hiking gear and landscapes. [RIGHT BOX: white text on black background] Übungsanleitung: Sie helfen Lena und Markus bei der Planung ihrer Wanderreise. Schlagen Sie eine Reiseroute für ihre Woche vor, unter Berücksichtigung ihres Interesses an sowohl anspruchsvollen Wanderungen als auch entspanntem Sightseeing. Äußern Sie Ihre Vorlieben und geben Sie Ratschläge zu bestimmten Wanderwegen und Aktivitäten, unter Einbeziehung von Vokabular zu Wanderausrüstung und Landschaften.”
Very unrealiable API service for Nano Banana Pro and Gemini Live API. Hopefully they are stable once they are out from preview.*
