Skip to main content

pollinations.ai | Image Generation

Project description

pollinations.ai - Image Generation

License Python Versions

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

This is a WRAPPER designed for easy text-image generation.

Installing

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

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

Simple Examples

import pollinations.ai as ai

model: ai.Image = ai.Image()
image: ai.ImageObject = model.generate(
      prompt='lion feasting on prey',
      # model...width...height...seed...
      nologo=False,
).save()

# >>> lion feasting on prey https://image.pollinations.ai/prompt/lion%20feasting%20on%20prey?model...width...height...seed...&nologo=true
@abc.resource(deprecated=False)
def generate(
    self,
    prompt: str,
    *args,
    model: str = None, width: int = 1024, height: int = 1024, seed: int = None, nologo: bool = False,
    **kwargs,
) -> str:

DEPRECATED > Chatting with text generative ai model:

# import pollinations.ai as ai

# model: ai.Text = ai.Text()

# response: str = model.chat(prompt='What is the meaning of life?')

Setting model filter:

import pollinations.ai as ai

image_generator: ai.Image = ai.Image()
image_generator.set_filter(ai.BANNED_WORDS)

# If any word from a prompt is in the filter it will return an exception.

Batch sample and generation:

import pollinations.ai as ai

batch: list = ai.sample_batch(size=5)
image_generator: ai.Image = ai.Image()
image_generator.generate_batch(prompts=batch, save=True) # OPTIONAL: path  # OPTIONAL: naming = 'counter' | naming = 'prompt'

# image_generator.generate_batch(prompts=batch, save=True, path='somefolder', naming='prompt')
@abc.resource(deprecated=False)
def generate_batch(
    self,
    prompts: list,
    save: bool = False,
    path: str = None,
    naming: str = "counter",
    *args,
    model: str = None, width: int = 1024, height: int = 1024, seed: int = None, nologo: bool = False, 
    **kwargs,
) -> list:

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pollinations_ai-0.5.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

pollinations.ai-0.5.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file pollinations_ai-0.5.1.tar.gz.

File metadata

  • Download URL: pollinations_ai-0.5.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pollinations_ai-0.5.1.tar.gz
Algorithm Hash digest
SHA256 a7b35fae60c7c9868e7b419895e9036f4004139e141e6d4485bb9f268ab3d94f
MD5 24000a4a5369d5ad378618339f2a41a9
BLAKE2b-256 15e52ad18fb313769869acafce894fee4255f657b362f6bfc83b816831eed45a

See more details on using hashes here.

File details

Details for the file pollinations.ai-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pollinations.ai-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c59416b9628813155411b69fae20f9f41d85b3bf0de448c5b83be96dbc1304c0
MD5 3f75a750e70136a870b26be74b78aa9c
BLAKE2b-256 849fb9f68229973e36b4e19b8a8741866edb99fa7142dc00de867fd84daa3f00

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page