Loading...
Loading...
Generate and save images using Pollinations.ai's free, open-source API. No signup required. Supports URL-based generation, custom parameters (width, height, model, seed), and automatic file saving. Perfect for quick prototypes, marketing assets, and creative workflows.
npx skill4agent add akillness/skills-template pollinations-aihttps://image.pollinations.ai/prompt/{YOUR_PROMPT}?{PARAMETERS}widthheightmodelfluxturbostable-diffusionseednologotrueenhancetrue[Subject], [Style], [Lighting], [Mood], [Composition], [Quality modifiers]A father welcoming a beautiful holiday, warm golden hour lighting,
cozy interior background with festive decorations, 8k resolution,
highly detailed, cinematic depth of fieldcurl# Basic generation
curl "https://image.pollinations.ai/prompt/A_serene_mountain_landscape" -o mountain.jpg
# With parameters
curl "https://image.pollinations.ai/prompt/A_serene_mountain_landscape?width=1920&height=1080&model=flux&seed=42" -o mountain-hd.jpgimport requests
from urllib.parse import quote
def generate_image(prompt, output_file, width=1920, height=1080, model="flux", seed=None):
"""
Generate image using Pollinations.ai and save to file
Args:
prompt: Description of the image to generate
output_file: Path to save the image
width: Image width in pixels
height: Image height in pixels
model: AI model ('flux', 'turbo', 'stable-diffusion')
seed: Optional seed for reproducibility
"""
# Encode prompt for URL
encoded_prompt = quote(prompt)
url = f"https://image.pollinations.ai/prompt/{encoded_prompt}"
# Build parameters
params = {
"width": width,
"height": height,
"model": model,
"nologo": "true"
}
if seed:
params["seed"] = seed
# Generate and save
print(f"Generating: {prompt[:50]}...")
response = requests.get(url, params=params)
if response.status_code == 200:
with open(output_file, "wb") as f:
f.write(response.content)
print(f"✓ Saved to {output_file}")
return True
else:
print(f"✗ Error: {response.status_code}")
return False
# Example usage
generate_image(
prompt="A father welcoming a beautiful holiday, warm lighting, festive decorations",
output_file="holiday_father.jpg",
width=1920,
height=1080,
model="flux",
seed=12345
)prompts = [
"photorealistic shot of a father at front door, warm lighting, festive decorations",
"digital illustration of a father in snow, magical winter wonderland, disney style",
"minimalist silhouette of father and child, holiday fireworks, flat design"
]
for i, prompt in enumerate(prompts):
generate_image(
prompt=prompt,
output_file=f"variant_{i+1}.jpg",
width=1920,
height=1080,
model="flux"
)import json
from datetime import datetime
metadata = {
"prompt": prompt,
"model": "flux",
"width": 1920,
"height": 1080,
"seed": 12345,
"output_file": "holiday_father.jpg",
"timestamp": datetime.now().isoformat()
}
with open("generation_metadata.json", "w") as f:
json.dump(metadata, f, indent=2)generate_image(
prompt="serene mountain landscape at sunset, wide 16:9, minimal style, soft gradients in blue tones, clean lines, modern aesthetic",
output_file="hero-image.jpg",
width=1920,
height=1080,
model="flux"
)generate_image(
prompt="futuristic dashboard UI, 1:1 square, clean interface, soft lighting, professional feel, dark theme, subtle glow effects",
output_file="product-thumb.jpg",
width=1024,
height=1024,
model="flux"
)generate_image(
prompt="LinkedIn banner for SaaS startup, modern gradient background, abstract geometric shapes, colors from purple to blue, space for text on left side",
output_file="linkedin-banner.jpg",
width=1584,
height=396,
model="flux"
)# Generate 4 variations of the same prompt with different seeds
base_prompt = "A father welcoming a beautiful holiday, cinematic lighting"
for seed in [100, 200, 300, 400]:
generate_image(
prompt=base_prompt,
output_file=f"variation_seed_{seed}.jpg",
width=1920,
height=1080,
model="flux",
seed=seed
)fluxturbostable-diffusionurllib.parse.quote()generate_image(prompt="...", seed=12345, ...) # Same output every time# Instagram: 1:1
generate_image(prompt="...", width=1080, height=1080)
# LinkedIn banner: ~4:1
generate_image(prompt="...", width=1584, height=396)
# YouTube thumbnail: 16:9
generate_image(prompt="...", width=1280, height=720)prompt = "landscape with brand colors deep blue #2563EB and purple #8B5CF6"import time
def generate_with_retry(prompt, output_file, max_retries=3):
for attempt in range(max_retries):
if generate_image(prompt, output_file):
return True
print(f"Retry {attempt + 1}/{max_retries}...")
time.sleep(2)
return False## Image Generation Report
### Request
- **Prompt**: [full prompt text]
- **Model**: flux
- **Dimensions**: 1920x1080
- **Seed**: 12345
### Output Files
1. `hero-image-v1.jpg` - Primary variant
2. `hero-image-v2.jpg` - Alternative style
3. `hero-image-v3.jpg` - Different lighting
### Metadata
- Generated: 2026-02-13T14:30:00Z
- Iterations: 3
- Selected: hero-image-v1.jpg
### Usage Notes
- Best for: Website hero section
- Format: JPEG, 1920x1080
- Reproducible: Yes (seed: 12345)| Agent | Role | Tools |
|---|---|---|
| Claude | Prompt engineering, quality validation | Write, Read |
| Codex | Script execution, batch processing | Bash, Write |
| Gemini | Style analysis, brand consistency check | Read, ask-gemini |
# 1. Claude: Generate prompts and script
# 2. Codex: Execute generation
bash -c "python generate_images.py"
# 3. Gemini: Review outputs
ask-gemini "@outputs/ Analyze brand consistency of generated images"#pollinations#image-generation#free#api#url-based#no-signup#creative