# pollinations

Pollinations - Also generates images like Prodia, but Pollinations is more of an acquired taste. However, it all depends on the quality of the prompt!

{% tabs %}
{% tab title="Image 1" %}
<figure><img src="https://345430043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaYIyUTBTYhRveSFbxOri%2Fuploads%2Fnn17shmMFAZPqGFvoRx2%2Fimage1.png?alt=media&#x26;token=e7fd8af6-851e-41ab-9d10-d87cc6424e20" alt=""><figcaption><p>Example 1</p></figcaption></figure>
{% endtab %}

{% tab title="Image 2" %}
<figure><img src="https://345430043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaYIyUTBTYhRveSFbxOri%2Fuploads%2FqpecdqjNriMSJ6grtohc%2Fimage2.png?alt=media&#x26;token=85b625ee-ab0a-4769-93ba-7575b21e9b5c" alt=""><figcaption><p>Example 2</p></figcaption></figure>
{% endtab %}

{% tab title="Image 3" %}
<figure><img src="https://345430043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaYIyUTBTYhRveSFbxOri%2Fuploads%2Fzbp8UhrLhyFePlisudxE%2Fimage3.png?alt=media&#x26;token=7d0807ae-3562-4836-b623-9ba18cc8e242" alt=""><figcaption><p>Example 3</p></figcaption></figure>
{% endtab %}

{% tab title="Image 4" %}
<figure><img src="https://345430043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaYIyUTBTYhRveSFbxOri%2Fuploads%2FBATO89pVN0Y2SOEBnH8S%2Fimage4.png?alt=media&#x26;token=24242b4b-bb97-4856-b3d9-11eeabf311b0" alt=""><figcaption><p>Example 4</p></figcaption></figure>
{% endtab %}
{% endtabs %}

<details>

<summary>Example</summary>

```python
from freeGPTFix import Client
from PIL import Image
from io import BytesIO

while True:
    prompt = input("> ")
    try:
        resp = Client.create_generation("pollinations", prompt)
        Image.open(BytesIO(resp)).show()
        print(f"🤖: Image shown.")
    except Exception as e:
        print(f"🤖: {e}")
```

</details>

<details>

<summary>Pollinations </summary>

```python
def create(self, prompt):
	try:
		return get(
			url=f"https://image.pollinations.ai/prompt/{prompt}{randint(1, 10000)}",
			timeout=30,
		).content
	except RequestException as exc:
		raise RequestException("Unable to fetch the response.") from exc
```

</details>
