Skip to main content

pywombo

Telegram channel

A library for simple usage https://dream.ai (neural network of image generation) from python code. N|Solid

pip install pywombo

Depencies: pydantic, httpx, httpx-socks, proxystr Optional: pillow

Simple usage

from wombo import Dream

dream = Dream()
task = dream.generate('a dragon in the sky')  # by default a random style used

print(task.url)
# or
task.image.save(folder='images')
# or
task.image.show()  # this needs pillow installed
  • async usage
import asyncio
from wombo import AsyncDream

dream = AsyncDream()

async def get_image(prompt):
    task = await dream.generate(prompt)
    return task.image

image = asyncio.run(get_image('a dragon in the sky'))

url = image.url
image.save()  # by default folder='images'
PIL_Image = image.image  # this needs pillow installed
image.show()  # this needs pillow installed

Styles

top_styles = dream.styles.top
free_styles = dream.styles.free
all_styles = dream.styles.all
random_style_from_top = dream.styles.random()

for style in top_styles:
    print(f"{style.id:<5}{style.name}")

task = dream.generate('a dragon in the sky', style=115)
# or
task = dream.generate('a dragon in the sky', style=top_styles[10])

Proxy

from wombo import Dream

dream = Dream('login:password@ip:port')
dream = Dream('socks5://login:password@ip:port')

Dream takes proxy in any popular format because it uses proxystr lib. Also Dream takes a Proxy obj from that lib.

Advanced usage

Creating more than one task at once

  • sync
from wombo import Dream

dream = Dream()

tasks = []
for _ in range(3):
    tasks.append(dream.create_task('a dragon in the sky'))

# wait all of tasks
ready_tasks = dream.await_tasks(tasks)
for task in ready_tasks:
    task.image.save()

# or one by one as complited
for task in dream.as_complited(tasks):
    task.image.save()
  • async
import asyncio
from wombo import AsyncDream

dream = AsyncDream()

async def generate(amount: int):
    tasks = []
    for _ in range(amount):
        tasks.append(await dream.create_task('a dragon in the sky'))
    
    # wait all of tasks
    ready_tasks = await dream.await_tasks(tasks)
    for task in ready_tasks:
        task.image.save()
    
    # or one by one as complited
    async for task in dream.as_complited(tasks):
        task.image.save()

asyncio.run(generate(3))

Context meneger

from wombo import Dream

with Dream() as dream:
    task = dream.generate('a dragon in the sky')
    task.image.save()
  • async
import asyncio
from wombo import Dream

async def generate():
    async with Dream() as dream:
        task = await dream.generate('a dragon in the sky')
        task.image.save()
asyncio.run(generate())

Support

Developed by MrSmith06: telegram | gtihub If you find this project helpful, feel free to leave a tip!

  • EVM address (metamask): 0x6201d7364F01772F8FbDce67A9900d505950aB99

Download files

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

Source Distribution

pywombo-0.1.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywombo-0.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file pywombo-0.1.1.tar.gz.

File metadata

  • Download URL: pywombo-0.1.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for pywombo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 df3430ff50e040b18dd5ee40935573c5330335c83ed1ea361558cef6bfaba09c
MD5 d3cd8f430935da5df288294e34952b76
BLAKE2b-256 1df6bdb290bae7fa03e701e85f82cc18e7a8be5468d196a33689585f884c28d7

See more details on using hashes here.

File details

Details for the file pywombo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pywombo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for pywombo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5bb6b98e836edc73ce2006faee74f1712e07e072e9e83a4bfd282aa8e85741f7
MD5 83f8c0c5ee656f149300c77e247e461c
BLAKE2b-256 6d21a595fd9819dacda727ecf8386f4095a46a74d7c8e10c53b0dd08b2142a59

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page