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

# Version 1
model: ai.Image = ai.Image()
image: ai.ImageObject = model.generate(
      prompt='cat in space',
).save()

# Version 2
class Model(ai.Image):
      params = {
            "prompt": "cat in space"
      }

model: ai.Image = Model()
model.generate().save()
@abc.resource(deprecated=False)
def generate(
    self,
    *args,
    prompt: str = "",
    model: str = None,
    width: int = 1024,
    height: int = 1024,
    seed: int = None,
    nologo: bool = False,
    **kwargs,
) -> str:
# Version 1
batch: list = ["lion in space", "dog in space"]
image_generator: ai.Image = ai.Image()
image_generator.generate_batch(prompts=batch, save=True, path="images")

# Version 2
class Model(ai.Image):
      params = {
            "prompt": ["lion in space", "dog in space"]
      }

model: ai.Image = Model()
model.generate_batch(save=True, path="images")
@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:

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.

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-0.5.2.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

pollinations-0.5.2-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file pollinations-0.5.2.tar.gz.

File metadata

  • Download URL: pollinations-0.5.2.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-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3da848cd418c05d917c8a25211c648f6397b800db171b83e7cde38b48516916a
MD5 4124a1ebbefe5fab30655e17f6fa86bf
BLAKE2b-256 5db3a012ae8d5f50b60c540f3f3a3909b3f02210bde3ef913e804f7a437b9bc5

See more details on using hashes here.

File details

Details for the file pollinations-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: pollinations-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for pollinations-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5f3b6463a0879ef8e1cb28fe72e39214566fbbd54801fcf39a8777c895a844
MD5 8dea023a706eb717ac38d924bc975144
BLAKE2b-256 0962728bff721a409da2dbc99bf486c05fff526c9b0b95c89ee43272cb952e33

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