pollinations.ai | Image Generation
Project description
pollinations.ai - Image Generation
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
prompt: str = 'A cat with a top hat and a mustache.'
prompt_sample: str = ai.sample()
image_generator: ai.Image = ai.Image(save_file='pollinations.ai.jpg') # OPTIONAL: takes save_file parameter
image = image_generator.generate(prompt)
image.save() # OPTIONAL: takes save_file parameter
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')
Links
Project details
Release history Release notifications | RSS feed
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.2.3.tar.gz
(19.2 kB
view hashes)
Built Distributions
Close
Hashes for pollinations_ai-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 511457b263a630a03ef6141ac0682c00a37d429ce8b2faf6be1af06afcd10e2e |
|
MD5 | f8eea2eeb4768a2b3f31da32ce73de5b |
|
BLAKE2b-256 | 80167ada46f5fe41868909c9fc39a389eb81907c258bca4f0dd2a10ea5633b51 |
Close
Hashes for pollinations.ai-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c5f9009b8c7fdebfe80b4a63a98905cbede8f96479547ef3dcf6cde75fb46d |
|
MD5 | cb9192d4bc88fe4a8e631696ab9abb8b |
|
BLAKE2b-256 | db24f5b3adbac7d61f9df41094cb05c1ef5f9558f831e971fcc9d208ec7342ec |