pywombo
A library for simple usage https://dream.ai (neural network of image generation) from python code.
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
Metadata
Release files for pywombo 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pywombo-0.1.1.tar.gz | 10.1 kB | Without provenance | Details for pywombo-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pywombo-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pywombo-0.1.1-py3-none-any.whl |
Total release size: 23.6 kB
Release files / pywombo-0.1.1.tar.gz
| Download URL | pywombo-0.1.1.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df3430ff50e040b18dd5ee40935573c5330335c83ed1ea361558cef6bfaba09c
|
|
BLAKE2b-256 checksum How to use checksums |
1df6bdb290bae7fa03e701e85f82cc18e7a8be5468d196a33689585f884c28d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.11 Windows/10
|
Release files / pywombo-0.1.1-py3-none-any.whl
| Download URL | pywombo-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bb6b98e836edc73ce2006faee74f1712e07e072e9e83a4bfd282aa8e85741f7
|
|
BLAKE2b-256 checksum How to use checksums |
6d21a595fd9819dacda727ecf8386f4095a46a74d7c8e10c53b0dd08b2142a59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.11 Windows/10
|
Security for pywombo 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.