pollinations


Namepollinations JSON
Version 2.3.11 PyPI version JSON
download
home_pagehttps://pollinations.ai/
Summarypollinations.ai | Free AI Text & Image Generation
upload_time2025-01-13 02:29:10
maintainerNone
docs_urlNone
authorgit.pollinations.ai
requires_python>=3.7
licenseMIT License Copyright (c) 2025 pollinations Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords pollinations pollinations.ai pollinations-ai pollinations_ai ai api sdk wrapper free
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <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.ai)
[![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 models from Pollinations using this Python SDK.
```

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

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

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

## Image Generation
```python
import pollinations

image_model = pollinations.Image(
    model=pollinations.Image.flux(),
    seed="random",
    width=1024,
    height=1024,
    enhance=False,
    nologo=True,
    private=True,
    safe=False,
    referrer="pollinations.py"
)  # or pollinations.Image() to use defaults

image = image_model(
    prompt="A cat with flowers around it."
)

print(image.prompt, image.response)

image.save(
    file="pollinations-image.png"
)

print(pollinations.Image.models())
print(pollinations.Image.flux())
print(pollinations.Image.flux.info())
```
### Async Image Generation
```python
image_model = pollinations.Async.Image()  # Has ALL features and functionality of normal Image class

image = await image_model(
    prompt="A cat with flowers around it."
)
```
## Text Generation
```python
import pollinations

text_model = pollinations.Text(
    model=pollinations.Text.openai(),
    system="You are a helpful assistant.",
    contextual=True,
    messages=[  # or [] or None
        pollinations.Text.Message(
            role="user",
            content="What is the capital of France?"
        ),
        pollinations.Text.Message(
            role="assistant",
            content="The capital of France is Paris."
        )
    ],
    seed="random",
    jsonMode=False,
    referrer="pollinations.py"
)

response = text_model(
    prompt="Hello.",
    display=True,  # Simulate typing,
    encode=True  # Use proper encoding
)

print(response.prompt, response.response)

print(pollinations.Text.models())
print(pollinations.Text.openai())
print(pollinations.Text.openai.info())
```
### Async Text Generation
```python
text_model = pollinations.Async.Text()  # Has ALL features and functionality of normal Text class

response = await text_model(
    prompt="Hello."
)
```
## Image Request Building
```python
import pollinations

image_request = pollinations.Image.Request(
    model=pollinations.Image.flux(),
    prompt="A cat with flowers around it.",
    seed="random",
    width=1024,
    height=1024,
    enhance=False,
    nologo=True,
    private=True,
    safe=False,
    referrer="pollinations.py"
)

image = image_request()

print(image.model, image.prompt, image.response)
```

## Text Request Building
```python
import pollinations

text_request = pollinations.Text.Request(
    model=pollinations.Text.openai(),
    prompt="Hello, how are you?",
    system="You are a helpful assistant.",
    contextual=True,
    messages=[  # or [] or None
        pollinations.Text.Message(
            role="user",
            content="What is the capital of France?"
        ),
        pollinations.Text.Message(
            role="assistant",
            content="The capital of France is Paris."
        )
    ],
    images=[
        pollinations.Text.Message.image("my_file.png"),
        pollinations.Text.Message.image("my_file2.png")
    ],
    seed="random",
    jsonMode=False,
    referrer="pollinations.py"
)

response = text_request(
    encode=True  # Use proper encoding
)
print(response)
```

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://pollinations.ai/",
    "name": "pollinations",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "pollinations, pollinations.ai, pollinations-ai, pollinations_ai, ai, api, sdk, wrapper, free",
    "author": "git.pollinations.ai",
    "author_email": "\"pollinations.ai\" <hello@pollinations.ai>, \"git.pollinations.ai\" <git.pollinations.ai@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e8/68/927602624c8eeb651d6c0fe27d27196f77c4952a7db5620009641c4fcf60/pollinations-2.3.11.tar.gz",
    "platform": null,
    "description": "<div id=\"header\">\r\n  <img src=\"https://i.ibb.co/p049Y5S/86964862.png\" width=\"50\"/>   <img src=\"https://i.ibb.co/r6JZ336/sketch1700556567238.png\" width=\"250\">\r\n</div>\r\n\r\n# [pollinations.ai - Free AI Text & Image Generation](https://pypi.org/project/pollinations.ai)\r\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/pollinations-ai/pollinations.ai/blob/main/LICENSE)\r\n[![Python Versions](https://img.shields.io/badge/python-3%20%7C%203.10--3.13-blue)](https://www.python.org/downloads/)\r\n\r\n```\r\npollinations.ai: (https://pollinations.ai/)\r\n\r\nWork with the best generative models from Pollinations using this Python SDK.\r\n```\r\n\r\n## Installing\r\n```shell\r\npip install -U pollinations\r\npip install -U pollinations.ai\r\n\r\n# Linux/macOS\r\npython3 -m pip install -U pollinations\r\npython3 -m pip install -U pollinations.ai\r\n\r\n# Windows\r\npy -3 -m pip install -U pollinations\r\npy -3 -m pip install -U pollinations.ai\r\n```\r\n\r\n## Image Generation\r\n```python\r\nimport pollinations\r\n\r\nimage_model = pollinations.Image(\r\n    model=pollinations.Image.flux(),\r\n    seed=\"random\",\r\n    width=1024,\r\n    height=1024,\r\n    enhance=False,\r\n    nologo=True,\r\n    private=True,\r\n    safe=False,\r\n    referrer=\"pollinations.py\"\r\n)  # or pollinations.Image() to use defaults\r\n\r\nimage = image_model(\r\n    prompt=\"A cat with flowers around it.\"\r\n)\r\n\r\nprint(image.prompt, image.response)\r\n\r\nimage.save(\r\n    file=\"pollinations-image.png\"\r\n)\r\n\r\nprint(pollinations.Image.models())\r\nprint(pollinations.Image.flux())\r\nprint(pollinations.Image.flux.info())\r\n```\r\n### Async Image Generation\r\n```python\r\nimage_model = pollinations.Async.Image()  # Has ALL features and functionality of normal Image class\r\n\r\nimage = await image_model(\r\n    prompt=\"A cat with flowers around it.\"\r\n)\r\n```\r\n## Text Generation\r\n```python\r\nimport pollinations\r\n\r\ntext_model = pollinations.Text(\r\n    model=pollinations.Text.openai(),\r\n    system=\"You are a helpful assistant.\",\r\n    contextual=True,\r\n    messages=[  # or [] or None\r\n        pollinations.Text.Message(\r\n            role=\"user\",\r\n            content=\"What is the capital of France?\"\r\n        ),\r\n        pollinations.Text.Message(\r\n            role=\"assistant\",\r\n            content=\"The capital of France is Paris.\"\r\n        )\r\n    ],\r\n    seed=\"random\",\r\n    jsonMode=False,\r\n    referrer=\"pollinations.py\"\r\n)\r\n\r\nresponse = text_model(\r\n    prompt=\"Hello.\",\r\n    display=True,  # Simulate typing,\r\n    encode=True  # Use proper encoding\r\n)\r\n\r\nprint(response.prompt, response.response)\r\n\r\nprint(pollinations.Text.models())\r\nprint(pollinations.Text.openai())\r\nprint(pollinations.Text.openai.info())\r\n```\r\n### Async Text Generation\r\n```python\r\ntext_model = pollinations.Async.Text()  # Has ALL features and functionality of normal Text class\r\n\r\nresponse = await text_model(\r\n    prompt=\"Hello.\"\r\n)\r\n```\r\n## Image Request Building\r\n```python\r\nimport pollinations\r\n\r\nimage_request = pollinations.Image.Request(\r\n    model=pollinations.Image.flux(),\r\n    prompt=\"A cat with flowers around it.\",\r\n    seed=\"random\",\r\n    width=1024,\r\n    height=1024,\r\n    enhance=False,\r\n    nologo=True,\r\n    private=True,\r\n    safe=False,\r\n    referrer=\"pollinations.py\"\r\n)\r\n\r\nimage = image_request()\r\n\r\nprint(image.model, image.prompt, image.response)\r\n```\r\n\r\n## Text Request Building\r\n```python\r\nimport pollinations\r\n\r\ntext_request = pollinations.Text.Request(\r\n    model=pollinations.Text.openai(),\r\n    prompt=\"Hello, how are you?\",\r\n    system=\"You are a helpful assistant.\",\r\n    contextual=True,\r\n    messages=[  # or [] or None\r\n        pollinations.Text.Message(\r\n            role=\"user\",\r\n            content=\"What is the capital of France?\"\r\n        ),\r\n        pollinations.Text.Message(\r\n            role=\"assistant\",\r\n            content=\"The capital of France is Paris.\"\r\n        )\r\n    ],\r\n    images=[\r\n        pollinations.Text.Message.image(\"my_file.png\"),\r\n        pollinations.Text.Message.image(\"my_file2.png\")\r\n    ],\r\n    seed=\"random\",\r\n    jsonMode=False,\r\n    referrer=\"pollinations.py\"\r\n)\r\n\r\nresponse = text_request(\r\n    encode=True  # Use proper encoding\r\n)\r\nprint(response)\r\n```\r\n\r\n# Links\r\n- [Pollinations.ai](https://pollinations.ai/)\r\n- [Discord](https://discord.gg/8HqSRhJVxn)\r\n- [Github](https://github.com/pollinations)\r\n- [Repository](https://github.com/pollinations-ai/pollinations.ai)\r\n- [Youtube](https://www.youtube.com/channel/UCk4yKnLnYfyUmCCbDzOZOug)\r\n- [Instagram](https://instagram.com/pollinations_ai)\r\n- [Twitter (X)](https://twitter.com/pollinations_ai)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2025 pollinations  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "pollinations.ai | Free AI Text & Image Generation",
    "version": "2.3.11",
    "project_urls": {
        "Discord": "https://discord.gg/8HqSRhJVxn",
        "Github": "https://github.com/pollinations",
        "Homepage": "https://pollinations.ai/",
        "Instagram": "https://instagram.com/pollinations_ai",
        "Repository": "https://github.com/pollinations-ai/pollinations.ai",
        "Twitter": "https://twitter.com/pollinations_ai",
        "Website": "https://pollinations.ai/",
        "YouTube": "https://www.youtube.com/channel/UCk4yKnLnYfyUmCCbDzOZOug"
    },
    "split_keywords": [
        "pollinations",
        " pollinations.ai",
        " pollinations-ai",
        " pollinations_ai",
        " ai",
        " api",
        " sdk",
        " wrapper",
        " free"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "831c354207b1ac73174c27de4b64cc6d27ae95116fd2e6f5dd3c1fcf952eb008",
                "md5": "497691aeb52dd591229aee2563854386",
                "sha256": "edd7f22567c28383f1db0c2f8388e3f06fd350a3edb15ccc47f7c13fbdbb326b"
            },
            "downloads": -1,
            "filename": "pollinations-2.3.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "497691aeb52dd591229aee2563854386",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 13421,
            "upload_time": "2025-01-13T02:29:07",
            "upload_time_iso_8601": "2025-01-13T02:29:07.857544Z",
            "url": "https://files.pythonhosted.org/packages/83/1c/354207b1ac73174c27de4b64cc6d27ae95116fd2e6f5dd3c1fcf952eb008/pollinations-2.3.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e868927602624c8eeb651d6c0fe27d27196f77c4952a7db5620009641c4fcf60",
                "md5": "5a394f22d30ce9e3b235ba50d2c22686",
                "sha256": "9e8fceced267464940584b0696f8fe0d040e090d3e4d25ee9a29fdaaa3dae208"
            },
            "downloads": -1,
            "filename": "pollinations-2.3.11.tar.gz",
            "has_sig": false,
            "md5_digest": "5a394f22d30ce9e3b235ba50d2c22686",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14648,
            "upload_time": "2025-01-13T02:29:10",
            "upload_time_iso_8601": "2025-01-13T02:29:10.363488Z",
            "url": "https://files.pythonhosted.org/packages/e8/68/927602624c8eeb651d6c0fe27d27196f77c4952a7db5620009641c4fcf60/pollinations-2.3.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-13 02:29:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pollinations-ai",
    "github_project": "pollinations.ai",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pollinations"
}
        
Elapsed time: 1.19297s