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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pollinations_ai-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_ai-0.5.2.tar.gz
Algorithm Hash digest
SHA256 67a300227f71539bb96b327245c6084f8983bf2f19cf8a033847ac2943fda416
MD5 978f0e04aa7517df298ebbb80000aa74
BLAKE2b-256 4be49f3f31dc89f1c3139cef0012c4873c850e3da927de780431dd7736564d12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pollinations.ai-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55b3618e92d0e8287552fe1478dd8aab389144dc2688c86586071c627bfb5ff0
MD5 b622973857ead4283a6952bcc159644e
BLAKE2b-256 f5a927807123e3e13aca879f89aa7e8730a8ce411300dd9295e89b769f4dcea7

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