Metadata-Version: 2.4
Name: pollinations
Version: 3.5.1
Summary: pollinations.ai | Free AI Image, Text, and Audio Generation
Author-email: "git.pollinations.ai" <git.pollinations.ai@gmail.com>
License: MIT
Project-URL: Website, https://pollinations.ai/
Project-URL: SDK-Repository, https://github.com/pollinations-ai/pollinations.ai
Project-URL: Discord, https://discord.gg/8HqSRhJVxn
Project-URL: Github, https://github.com/pollinations
Project-URL: YouTube, https://www.youtube.com/channel/UCk4yKnLnYfyUmCCbDzOZOug
Project-URL: Instagram, https://instagram.com/pollinations_ai
Project-URL: Twitter, https://twitter.com/pollinations_ai
Keywords: pollinations,pollinations.ai,pollinations-ai,pollinations_ai,ai,api,sdk,wrapper,free
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: OSI Approved :: MIT License
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: httpx
Requires-Dist: pillow
Dynamic: license-file

<div id="header">
  <img src="https://i.ibb.co/p049Y5S/86964862.png" width="50"/>   <img src="https://i.ibb.co/r6JZ336/sketch1700556567238.png" width="250">
</div>

# [pollinations.ai - Free AI Text & Image Generation](https://pypi.org/project/pollinations)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/pollinations-ai/pollinations.ai/blob/main/LICENSE)
[![Python Versions](https://img.shields.io/badge/python-3%20%7C%203.10--3.13-blue)](https://www.python.org/downloads/)

```
pollinations.ai: (https://pollinations.ai/)

Work with the best generative AI from Pollinations using this Python SDK. 🐝
```

## Installing
```shell
pip install pollinations
pip install pollinations.ai

# Linux/macOS
python3 -m pip install pollinations
python3 -m pip install pollinations.ai

# Windows
py -3 -m pip install pollinations
py -3 -m pip install pollinations.ai
```

## Image Generation
```python
model = pollinations.Image(  # Optional Arguments
    model="flux",
    seed="random",
    file="pollinations-image.png",
    width=1024,
    height=1024,
    nologo=False,
    private=False,
    enhance=False,
    safe=False,
    referrer="pollinations.py",
)

print(model.models())

image = model("A dog and cat.")  # Returns pillow Image instance

image.save("image.png")  
# (or) 
# (optional) model.file="image.png"
image = model("A dog and cat.", save=True)
```

## Async Image Generation
```python
async def async_example():
    image = await model.Async("A horse and pig.")
    # image = await model.Async("A horse and pig.", save=True)

    image.save("a_image.png")
    print(image)
    print(model)
```

## Text Generation
```python
model = pollinations.Text(  # Optional Arguments
    model="openai",
    system="You are a helpful assistant.",
    contextual=True,
    messages=[],
    private=False,
    seed="random",
    reasoning_effort="medium",
    tools=[],
    tool_choices=[],
    voice=None,
    json_mode=False,
    referrer="pollinations.py",
)

print(model.models())

print(model("Hello world"))

model.image("image.png")  # model.image(["image1.png", "image2.png", ...])
print(model("What do you see in that image?"))


# Stream Request
for token in model("Explain AI at a low level.", stream=True):
    print(token, end="", flush=True)
```

## Async Text Generation
```python
async def async_example():
    image = await model.Async("A horse and pig.")
    # image = await model.Async("A horse and pig.", save=True)

    image.save("a_image.png")
    print(image)
    print(model)
```

## Audio Transcription
```python
model = pollinations.Text()

print(model.Transcribe("test.mp3"))
```

## Audio Generation
```python
# Coming in a future update
```

# Links
- [SDK-Repository](https://github.com/pollinations-ai/pollinations.ai)
- [Pollinations.ai](https://pollinations.ai/)
- [Discord](https://discord.gg/8HqSRhJVxn)
- [Github](https://github.com/pollinations)
- [Youtube](https://www.youtube.com/channel/UCk4yKnLnYfyUmCCbDzOZOug)
- [Instagram](https://instagram.com/pollinations_ai)
- [Twitter (X)](https://twitter.com/pollinations_ai)
