← 返回
内容创作 Key 中文

Pollinations AI

Generate images, music, and videos from text prompts using Pollinations AI with models like flux, zimage, and suno-4 via API key.
利用Pollinations AI,通过API密钥调用flux、zimage和suno-4等模型,根据文本提示生成图像、音乐和视频。
kanfred
内容创作 clawhub v1.0.4 1 版本 99883 Key: 需要
★ 2
Stars
📥 814
下载
💾 44
安装
1
版本
#latest

概述

Pollinations AI - Image, Music & Video Generation

A comprehensive skill for generating images, music, and video using the Pollinations AI API.

Overview

Pollinations.ai provides free AI generation with API key support. This skill enables:

  • Image Generation - Create images from text prompts using state-of-the-art models
  • Music/Audio Generation - Generate background music and audio tracks
  • Video Generation - Create videos from text descriptions

Prerequisites

1. Get an API Key

Visit pollinations.ai to get your free API key.

2. Set Environment Variable

Add to your shell profile (~/.bashrc or ~/.zshrc):

export POLLINATIONS_API_KEY="your_api_key_here"

Then reload:

source ~/.bashrc

3. Install Dependencies

pip install requests Pillow

Security Configuration

Required Environment Variables

VariableRequiredDescription
---------------------------------
POLLINATIONS_API_KEYYesYour API key from pollinations.ai

Optional Environment Variables

VariableDefaultDescription
--------------------------------
TELEGRAM_CHAT_ID(none)Chat ID for Telegram sending. If not set, --telegram flag is disabled
ALLOWED_OUTPUT_DIRS., /tmpComma-separated list of allowed output directories
OPENCLAW_WORKSPACE~/.openclaw/workspaceWorkspace directory for output files

Note: The --telegram flag requires TELEGRAM_CHAT_ID to be explicitly set. If not set, the feature is disabled for security.

Available Scripts

ScriptPurpose
-----------------
pollinations_image_gen.pyGenerate images from text prompts
pollinations_audio_gen.pyGenerate music and audio
pollinations_video_gen.pyGenerate videos from text

Usage

Image Generation

# Basic usage
python pollinations_image_gen.py "a cute cat" --output cat.jpg

# With specific model and enhancements
python pollinations_image_gen.py "cyberpunk city at night" --model flux --enhance --width 1920 --height 1080 --output city.jpg

# Using different models
python pollinations_image_gen.py "your prompt" --model zimage
python pollinations_image_gen.py "your prompt" --model flux-2-dev  # Free tier

Parameters:

ParameterDescriptionDefault
---------------------------------
promptText description of desired image(required)
--modelAI model to useflux
--widthImage width in pixels1024
--heightImage height in pixels1024
--enhanceEnable AI prompt enhancementfalse
--seedFixed random seed for reproducibilityrandom
--safeEnable safe modefalse
--outputOutput filenameoutput.jpg
--telegramSend result via Telegram (requires TELEGRAM_CHAT_ID)false

Music/Audio Generation

# Generate music from prompt
python pollinations_audio_gen.py "upbeat electronic dance music" --output music.mp3

# With custom duration
python pollinations_audio_gen.py "calm piano melody" --duration 60 --output piano.mp3

Parameters:

ParameterDescriptionDefault
---------------------------------
promptDescription of desired music(required)
--modelAudio modelsuno-4
--durationLength in seconds30
--outputOutput filenameoutput.mp3

Video Generation

# Generate video
python pollinations_video_gen.py "a cat playing with a ball" --output video.mp4

# Custom duration and aspect ratio
python pollinations_video_gen.py "ocean waves" --duration 30 --aspectRatio 16:9 --output ocean.mp4

Parameters:

ParameterDescriptionDefault
---------------------------------
promptDescription of desired video(required)
--modelVideo modelsuno-4
--durationLength in seconds10
--aspectRatioVideo aspect ratio (16:9 or 9:16)16:9
--outputOutput filenameoutput.mp4

Supported Models

Image Models

ModelDescriptionQuality
-----------------------------
fluxDefault high-quality model⭐⭐⭐⭐⭐
flux-2-devLatest flux (FREE)⭐⭐⭐⭐⭐
zimageFast generation⭐⭐⭐⭐
nanobananaCreative/artistic⭐⭐⭐⭐
gptimageOpenAI-based⭐⭐⭐⭐
seedreamHigh detail⭐⭐⭐⭐

Audio Models

ModelDescription
--------------------
suno-4Latest (recommended) ⭐
suno-3.5Previous version
suno-3Legacy model

Video Models

ModelDescription
--------------------
sunoMusic video generation ⭐
veo-3.1Google video AI
seedanceHigh quality
wanOpen source option
ltx-2Fast generation

Security Features

This skill includes several security measures:

  1. Path Traversal Protection - All output paths are validated against allowed directories
  2. Environment Variable Validation - Telegram sending requires explicit opt-in
  3. No Hardcoded Credentials - All credentials come from environment variables
  4. File Access Whitelist - Only configured directories can be written to

Troubleshooting

ErrorCauseSolution
------------------------
401 UnauthorizedMissing or invalid API keySet POLLINATIONS_API_KEY correctly
403 ForbiddenAPI key lacks permissionCheck your key permissions at pollinations.ai
429 Too Many RequestsRate limit exceededWait before making more requests
402 Payment RequiredInsufficient balanceAdd credits at pollinations.ai

References

  • API Documentation: https://gen.pollinations.ai/api/docs
  • Pollinations Website: https://pollinations.ai/

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-03-29 23:48 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,224
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 860 📥 199,995
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,517