Loading...
Loading...
Generate images from text prompts using Google Nano Banana (Gemini image generation) via eng0 data API. Use when user asks to generate, create, or make images, pictures, illustrations, or artwork from descriptions. Triggers include "generate image", "create image", "make a picture", "draw", "illustrate", "image of", "picture of", "nano banana". Do NOT use for image editing or manipulation of existing images.
npx skill4agent add rebyteai-template/rebyte-skills nano-bananahttps://api.eng0.ai/api/data| Model | ID | Best For | Max Resolution |
|---|---|---|---|
| Flash | | Fast generation, high-volume tasks | 1024px |
| Pro | | Professional quality, complex prompts | 4K |
curl -X POST https://api.eng0.ai/api/data/images/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic cityscape at sunset with flying cars",
"model": "flash",
"aspectRatio": "16:9"
}'| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Text description of the image to generate |
| string | No | | |
| string | No | | Output aspect ratio |
| string | No | | |
| Ratio | Use Case |
|---|---|
| Square (social media, icons) |
| Landscape (presentations, banners) |
| Portrait (mobile, stories) |
| Standard landscape |
| Standard portrait |
| Ultra-wide (cinematic) |
| Various formats |
{
"image": {
"base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"mimeType": "image/png",
"dataUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
},
"description": "A vibrant futuristic cityscape..."
}| Field | Description |
|---|---|
| Base64-encoded image data |
| Image MIME type (typically |
| Ready-to-use data URL for HTML/CSS |
| Model's description of the generated image |
curl -X POST https://api.eng0.ai/api/data/images/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cute robot holding a cup of coffee"
}'curl -X POST https://api.eng0.ai/api/data/images/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "Professional product photo of a sleek smartphone on marble surface",
"model": "pro",
"imageSize": "4K",
"aspectRatio": "4:3"
}'curl -X POST https://api.eng0.ai/api/data/images/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "Abstract gradient background with geometric shapes in blue and purple",
"aspectRatio": "16:9"
}'curl -X POST https://api.eng0.ai/api/data/images/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "Cozy coffee shop interior with warm lighting",
"aspectRatio": "9:16"
}'import requests
import base64
from pathlib import Path
BASE_URL = "https://api.eng0.ai/api/data"
def generate_image(
prompt: str,
model: str = "flash",
aspect_ratio: str = "1:1",
image_size: str = "1K"
) -> dict:
"""Generate an image from a text prompt."""
response = requests.post(
f"{BASE_URL}/images/generate",
json={
"prompt": prompt,
"model": model,
"aspectRatio": aspect_ratio,
"imageSize": image_size
}
)
return response.json()
def save_image(result: dict, filepath: str) -> None:
"""Save generated image to a file."""
if "image" in result:
image_data = base64.b64decode(result["image"]["base64"])
Path(filepath).write_bytes(image_data)
print(f"Saved to {filepath}")
else:
print(f"Error: {result.get('error', 'Unknown error')}")
# Example: Generate and save an image
result = generate_image(
prompt="A serene mountain landscape at dawn with mist in the valley",
aspect_ratio="16:9"
)
save_image(result, "landscape.png")
# Example: Generate high-quality product image
result = generate_image(
prompt="Minimalist tech gadget on white background, studio lighting",
model="pro",
image_size="4K"
)
save_image(result, "product.png")const fs = require('fs');
const BASE_URL = 'https://api.eng0.ai/api/data';
async function generateImage(prompt, options = {}) {
const response = await fetch(`${BASE_URL}/images/generate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt,
model: options.model || 'flash',
aspectRatio: options.aspectRatio || '1:1',
imageSize: options.imageSize || '1K'
})
});
return response.json();
}
function saveImage(result, filepath) {
if (result.image) {
const buffer = Buffer.from(result.image.base64, 'base64');
fs.writeFileSync(filepath, buffer);
console.log(`Saved to ${filepath}`);
} else {
console.error('Error:', result.error || 'Unknown error');
}
}
// Example usage
(async () => {
const result = await generateImage(
'A neon-lit cyberpunk street scene at night',
{ aspectRatio: '21:9' }
);
saveImage(result, 'cyberpunk.png');
})();Bad: "A dog"
Good: "A golden retriever puppy playing in autumn leaves, warm sunlight""Oil painting style portrait of a woman in Renaissance clothing"
"Minimalist vector illustration of a mountain range"
"Photorealistic close-up of a dewdrop on a leaf""... with dramatic side lighting"
"... golden hour sunlight"
"... soft diffused studio lighting""... in the style of Studio Ghibli"
"... professional product photography"
"... vintage 1970s film aesthetic"| Feature | Flash | Pro |
|---|---|---|
| Speed | Fast | Slower |
| Max Resolution | 1024px | 4K |
| Complex Prompts | Good | Excellent |
| Text Rendering | Good | Sharp |
| Best For | Quick iterations, previews | Final assets, print |
{
"error": "No image generated",
"message": "SAFETY"
}{
"error": "Invalid parameters",
"message": "Missing required parameter: prompt"
}propro