wombo AI free image generation
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df3430ff50e040b18dd5ee40935573c5330335c83ed1ea361558cef6bfaba09c
|
|
| MD5 |
d3cd8f430935da5df288294e34952b76
|
|
| BLAKE2b-256 |
1df6bdb290bae7fa03e701e85f82cc18e7a8be5468d196a33689585f884c28d7
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bb6b98e836edc73ce2006faee74f1712e07e072e9e83a4bfd282aa8e85741f7
|
|
| MD5 |
83f8c0c5ee656f149300c77e247e461c
|
|
| BLAKE2b-256 |
6d21a595fd9819dacda727ecf8386f4095a46a74d7c8e10c53b0dd08b2142a59
|