# **pywombo**
[](https://t.me/bots_forge)
**A library for simple usage https://dream.ai (neural network of image generation) from python code.**
[](https://dream.ai/create)
```bash
pip install pywombo
```
**Depencies**: `pydantic, httpx, httpx-socks, proxystr`
**Optional**: `pillow`
## **Simple usage**
```python
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**
```python
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
```python
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
```python
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`](https://pypi.org/project/proxystr/) lib. Also `Dream` takes a `Proxy` obj from that lib.
## **Advanced usage**
### Creating more than one task at once
- **sync**
```python
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**
```python
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
```python
from wombo import Dream
with Dream() as dream:
task = dream.generate('a dragon in the sky')
task.image.save()
```
- **async**
```python
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](https://t.me/Mr_Smith06) | [gtihub](https://github.com/MrSmith06)
If you find this project helpful, feel free to leave a tip!
- EVM address (metamask): `0x6201d7364F01772F8FbDce67A9900d505950aB99`
Raw data
{
"_id": null,
"home_page": "https://github.com/BotsForge/pywombo",
"name": "pywombo",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "MrSmith06",
"author_email": "sletars@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1d/f6/bdb290bae7fa03e701e85f82cc18e7a8be5468d196a33689585f884c28d7/pywombo-0.1.1.tar.gz",
"platform": null,
"description": "# **pywombo**\n[](https://t.me/bots_forge)\n\n**A library for simple usage https://dream.ai (neural network of image generation) from python code.** \n[](https://dream.ai/create)\n\n\n```bash\npip install pywombo\n```\n**Depencies**: `pydantic, httpx, httpx-socks, proxystr`\n**Optional**: `pillow`\n\n## **Simple usage**\n```python\nfrom wombo import Dream\n\ndream = Dream()\ntask = dream.generate('a dragon in the sky') # by default a random style used\n\nprint(task.url)\n# or\ntask.image.save(folder='images')\n# or\ntask.image.show() # this needs pillow installed\n```\n- **async usage**\n```python\nimport asyncio\nfrom wombo import AsyncDream\n\ndream = AsyncDream()\n\nasync def get_image(prompt):\n task = await dream.generate(prompt)\n return task.image\n\nimage = asyncio.run(get_image('a dragon in the sky'))\n\nurl = image.url\nimage.save() # by default folder='images'\nPIL_Image = image.image # this needs pillow installed\nimage.show() # this needs pillow installed\n```\n\n### Styles\n```python\ntop_styles = dream.styles.top\nfree_styles = dream.styles.free\nall_styles = dream.styles.all\nrandom_style_from_top = dream.styles.random()\n\nfor style in top_styles:\n print(f\"{style.id:<5}{style.name}\")\n\ntask = dream.generate('a dragon in the sky', style=115)\n# or\ntask = dream.generate('a dragon in the sky', style=top_styles[10])\n```\n\n### Proxy\n```python\nfrom wombo import Dream\n\ndream = Dream('login:password@ip:port')\ndream = Dream('socks5://login:password@ip:port')\n```\n`Dream` takes proxy in any popular format because it uses [`proxystr`](https://pypi.org/project/proxystr/) lib. Also `Dream` takes a `Proxy` obj from that lib.\n## **Advanced usage**\n### Creating more than one task at once\n- **sync**\n```python\nfrom wombo import Dream\n\ndream = Dream()\n\ntasks = []\nfor _ in range(3):\n tasks.append(dream.create_task('a dragon in the sky'))\n\n# wait all of tasks\nready_tasks = dream.await_tasks(tasks)\nfor task in ready_tasks:\n task.image.save()\n\n# or one by one as complited\nfor task in dream.as_complited(tasks):\n task.image.save()\n```\n- **async**\n```python\nimport asyncio\nfrom wombo import AsyncDream\n\ndream = AsyncDream()\n\nasync def generate(amount: int):\n tasks = []\n for _ in range(amount):\n tasks.append(await dream.create_task('a dragon in the sky'))\n \n # wait all of tasks\n ready_tasks = await dream.await_tasks(tasks)\n for task in ready_tasks:\n task.image.save()\n \n # or one by one as complited\n async for task in dream.as_complited(tasks):\n task.image.save()\n\nasyncio.run(generate(3))\n```\n### Context meneger\n```python\nfrom wombo import Dream\n\nwith Dream() as dream:\n task = dream.generate('a dragon in the sky')\n task.image.save()\n```\n- **async**\n```python\nimport asyncio\nfrom wombo import Dream\n\nasync def generate():\n async with Dream() as dream:\n task = await dream.generate('a dragon in the sky')\n task.image.save()\nasyncio.run(generate())\n```\n## Support\nDeveloped by `MrSmith06`: [telegram](https://t.me/Mr_Smith06) | [gtihub](https://github.com/MrSmith06)\nIf you find this project helpful, feel free to leave a tip!\n- EVM address (metamask): `0x6201d7364F01772F8FbDce67A9900d505950aB99`",
"bugtrack_url": null,
"license": "MIT",
"summary": "wombo AI free image generation",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/BotsForge/pywombo",
"Repository": "https://github.com/BotsForge/pywombo"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6d21a595fd9819dacda727ecf8386f4095a46a74d7c8e10c53b0dd08b2142a59",
"md5": "83f8c0c5ee656f149300c77e247e461c",
"sha256": "5bb6b98e836edc73ce2006faee74f1712e07e072e9e83a4bfd282aa8e85741f7"
},
"downloads": -1,
"filename": "pywombo-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "83f8c0c5ee656f149300c77e247e461c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 13499,
"upload_time": "2024-08-10T10:09:47",
"upload_time_iso_8601": "2024-08-10T10:09:47.031843Z",
"url": "https://files.pythonhosted.org/packages/6d/21/a595fd9819dacda727ecf8386f4095a46a74d7c8e10c53b0dd08b2142a59/pywombo-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1df6bdb290bae7fa03e701e85f82cc18e7a8be5468d196a33689585f884c28d7",
"md5": "d3cd8f430935da5df288294e34952b76",
"sha256": "df3430ff50e040b18dd5ee40935573c5330335c83ed1ea361558cef6bfaba09c"
},
"downloads": -1,
"filename": "pywombo-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "d3cd8f430935da5df288294e34952b76",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 10122,
"upload_time": "2024-08-10T10:09:48",
"upload_time_iso_8601": "2024-08-10T10:09:48.705252Z",
"url": "https://files.pythonhosted.org/packages/1d/f6/bdb290bae7fa03e701e85f82cc18e7a8be5468d196a33689585f884c28d7/pywombo-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-10 10:09:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "BotsForge",
"github_project": "pywombo",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pydantic",
"specs": [
[
">=",
"2.0"
]
]
},
{
"name": "httpx",
"specs": [
[
">=",
"0.27"
]
]
},
{
"name": "httpx-socks",
"specs": [
[
">=",
"0.9"
]
]
},
{
"name": "proxystr",
"specs": [
[
">=",
"2.0.5"
]
]
}
],
"lcname": "pywombo"
}