SuperAPI AI Directory

Pollinations.AI - Open-source AI Content Generation Platform Offering Free Text and Image Generation API

Author: AI小集 · Original source: AI工具集

What is Pollinations.AI

Pollinations.AI is an open-source AI content generation platform that provides a free and easy-to-use text and image generation API. Pollinations.AI can be used without registration or an API key, and supports a variety of features, includingImage Generation, Text Generation, Text-to-Audio,Speech-to-Text, and visual content analysis. Pollinations.AI provides a rich set of API interfaces and SDKs, making it easy for developers to integrate quickly. Pollinations.AI has launched Pollinations.DIY, a browser-based development environment, further lowering the development barrier, making it suitable for developers, creators, and AI enthusiasts.

Pollinations.AI

Main Features of Pollinations.AI

  • Image Generation: Generates high-quality images based on text descriptions, supports multiple models (such as Flux and Turbo) and custom parameters (such as size, random seed, etc.).
  • Text Generation: Generates natural language text based on user-input prompts, supports multiple text generation models.
  • Text-to-Audio: Converts text into audio files, supports multiple voice types.
  • Speech-to-Text: Converts audio files into text content.
  • Visual Content Analysis: Analyzes image content, supports analysis based on image URL or Base64-encoded data.
  • OpenAI-Compatible Interface: Supports calls in OpenAI format, making it convenient for developers to migrate and integrate seamlessly.
  • Real-Time Feed: Provides a real-time feed of image and text generation, showcasing the community's latest creations.

How to Use Pollinations.AI

  • Image Generation:
    • Web: VisitPollinations.AI's official website. Enter a text description on the homepage, select a model (such as Turbo or Flux), and click generate.
    • API Call: Use the URL format, GET https://image.pollinations.ai/prompt/{prompt}
  • Text Generation:
    • Web: Visit the text generation page. Enter a prompt, select a model (such as Mistral or OpenAI), and click generate.
    • API Call: Use the URL format, GET https://text.pollinations.ai/{prompt}
  • Text-to-Audio: API call uses the URL format, GET https://text.pollinations.ai/{prompt}?model=openai-audio&voice={voice}
  • Using Python Example Code
    • Image Generation:
import requests

def generate_image(prompt, width=768, height=768, model='flux', seed=None):
    url = f"https://image.pollinations.ai/prompt/{prompt}?width={width}&height={height}&model={model}&seed={seed}"
    response = requests.get(url)
    if response.status_code == 200:
        with open('generated_image.jpg', 'wb') as file:
            file.write(response.content)
        print('Image downloaded!')
    else:
        print('Error:', response.status_code)

generate_image("A beautiful sunset over the ocean", width=1280, height=720, model='turbo', seed=42)
    • Text Generation:
import requests

def generate_text(prompt, model='mistral'):
    url = f"https://text.pollinations.ai/{prompt}?model={model}"
    response = requests.get(url)
    if response.status_code == 200:
        print(response.text)
    else:
        print('Error:', response.status_code)

generate_text("What is artificial intelligence?", model='mistral')
    • Text-to-Audio:
import requests

def generate_audio(prompt, voice='nova'):
    url = f"https://text.pollinations.ai/{prompt}?model=openai-audio&voice={voice}"
    response = requests.get(url)
    if response.status_code == 200:
        with open('generated_audio.mp3', 'wb') as file:
            file.write(response.content)
        print('Audio downloaded!')
    else:
        print('Error:', response.status_code)

generate_audio("Welcome to Pollinations!", voice='nova')

Pollinations.AI Official Website Address

Application Scenarios of Pollinations.AI

  • Creative Design: Quickly generate images and copy, spark inspiration, and improve creative efficiency.
  • Educational Resources: Generate teaching materials, enrich content, and enhance learning interest.
  • Entertainment and Interaction: Develop interactive stories and games to enhance user engagement.
  • Development Integration: Integrate the API into applications to achieve automated content generation.
  • Content Analysis: Analyze images and audio, extract information, and improve work efficiency.