imaginepy


Nameimaginepy JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/ItsCEED/imaginepy
SummaryPython library to create Art with AI.
upload_time2023-06-26 01:29:12
maintainer
docs_urlNone
authorCEED
requires_python>=3.7
licenseGPL-3.0-only
keywords art image ai stable-diffusion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<img src="https://github.com/ItsCEED/ImaginePy-Midjourney-Free-Alternative/blob/main/docs/imagine_logo.gif" width="10%">

**ImaginePy**
<br>
<a href="https://discord.gg/axfkjqWR5E" target="_blank">
  <img src="https://discordapp.com/api/guilds/1110314971012808774/widget.png?style=banner4" alt="Discord Banner 4">
</a>
<br>
<img src="https://img.shields.io/badge/python-3.7+-informational?style=plastic" alt="Python version">
<img src="https://img.shields.io/github/release-date/ItsCEED/ImaginePy-Midjourney-Free-Alternative?style=plastic" alt="Release">
<img src="https://img.shields.io/github/release/ItsCEED/ImaginePy-Midjourney-Free-Alternative?style=plastic" alt="Version">

</div>

## Features

- 🎨 Turn words into art
- 👓 Choose from an array of art styles
- 🔧 Adjust your masterpiece with creative controls!
- 📦 Stay ahead of the game with the ever-growing art library!
- 🌇 Generate wallpapers
- 🔎 Discover and explore similar artistic designs
- This is refactored and improved version of the original from [hyugogirubato]

## Installation

_Note: Requires [Python] 3.7.0 or newer with PIP installed._

```shell
$ python setup.py install
```

You now have the `imaginepy` package installed.

### PyPi Installation

```
pip install imaginepy
```

[Python]: https://python.org
[Venv's]: https://docs.python.org/3/tutorial/venv.html
[Venv's Docs]: https://docs.python.org/3/library/venv.html
[hyugogirubato]: https://github.com/hyugogirubato/pyImagine

### From Source Code

The following steps are instructions on download, preparing, and running the code under a Venv environment.
You can skip steps 3-5 with a simple `python setup.py install` call instead, but you miss out on a wide array of benefits.

1. `git clone https://github.com/ItsCEED/Imaginepy`
2. `cd Imaginepy`
3. `python -m venv env`
4. `source env/bin/activate`
5. `python setup.py install`

As seen in Step 5, running the `imaginepy` executable is somewhat different to a normal PIP installation.
See [Venv's Docs] on various ways of making calls under the virtual-environment.

[Python]: https://python.org
[Venv's]: https://docs.python.org/3/tutorial/venv.html
[Venv's Docs]: https://docs.python.org/3/library/venv.html
[hyugogirubato]: https://github.com/hyugogirubato/pyImagine

## Usage

The following is a minimal example of using ImaginePy in a script. It gets the generated image
from the text and increases the quality.

```python
from imaginepy import Imagine
from imaginepy.constants import *


def main():
    imagine = Imagine()

    img_data = imagine.sdprem(
        prompt="Woman sitting on a table, looking at the sky, seen from behind",
        style=Style.NO_STYLE,
        ratio=Ratio.RATIO_16X9,
        negative="",
        seed=1000,
        cfg=16,
        model=Model.REALISTIC,
        asbase64=False  # default is false, putting it here as presentation.
    )

    if img_data is None:
        print("An error occurred while generating the image.")
        return

    img_data = imagine.upscale(img_data)

    if img_data is None:
        print("An error occurred while upscaling the image.")
        return

    try:
        with open("example.jpeg", mode="wb") as img_file:
            img_file.write(img_data)
    except Exception as e:
        print(f"An error occurred while writing the image to file: {e}")


if __name__ == "__main__":
    main()
```

Async version

```python
import asyncio
from imaginepy import AsyncImagine
from imaginepy.constants import *


async def main():
    imagine = AsyncImagine()
    img_data = imagine.sdprem(
        prompt="Woman sitting on a table, looking at the sky, seen from behind",
        style=Style.NO_STYLE,
        ratio=Ratio.RATIO_16X9,
        negative="",
        seed=1000,
        cfg=16,
        model=Model.REALISTIC,
        asbase64=False  # default is false, putting it here as presentation.
    )

    if img_data is None:
        print("An error occurred while generating the image.")
        return

    img_data = await imagine.upscale(image=img_data)

    if img_data is None:
        print("An error occurred while upscaling the image.")
        return

    try:
        with open("example.png", mode="wb") as img_file:
            img_file.write(img_data)
    except Exception as e:
        print(f"An error occurred while writing the image to file: {e}")

    await imagine.close()


if __name__ == "__main__":
    asyncio.run(main())

```

## Credit

- Imagine Icon &copy; Vyro AI & API
- Original reverse and version by: [hyugogirubato]

## License

[GNU General Public License, Version 3.0](LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ItsCEED/imaginepy",
    "name": "imaginepy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "art,image,ai,stable-diffusion",
    "author": "CEED",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/be/f9/0469a47de15e6a64cfc4ffea4d2434145a42b379dfc5ef2cb32cd13494af/imaginepy-2.0.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\r\n<img src=\"https://github.com/ItsCEED/ImaginePy-Midjourney-Free-Alternative/blob/main/docs/imagine_logo.gif\" width=\"10%\">\r\n\r\n**ImaginePy**\r\n<br>\r\n<a href=\"https://discord.gg/axfkjqWR5E\" target=\"_blank\">\r\n  <img src=\"https://discordapp.com/api/guilds/1110314971012808774/widget.png?style=banner4\" alt=\"Discord Banner 4\">\r\n</a>\r\n<br>\r\n<img src=\"https://img.shields.io/badge/python-3.7+-informational?style=plastic\" alt=\"Python version\">\r\n<img src=\"https://img.shields.io/github/release-date/ItsCEED/ImaginePy-Midjourney-Free-Alternative?style=plastic\" alt=\"Release\">\r\n<img src=\"https://img.shields.io/github/release/ItsCEED/ImaginePy-Midjourney-Free-Alternative?style=plastic\" alt=\"Version\">\r\n\r\n</div>\r\n\r\n## Features\r\n\r\n- \ud83c\udfa8 Turn words into art\r\n- \ud83d\udc53 Choose from an array of art styles\r\n- \ud83d\udd27 Adjust your masterpiece with creative controls!\r\n- \ud83d\udce6 Stay ahead of the game with the ever-growing art library!\r\n- \ud83c\udf07 Generate wallpapers\r\n- \ud83d\udd0e Discover and explore similar artistic designs\r\n- This is refactored and improved version of the original from [hyugogirubato]\r\n\r\n## Installation\r\n\r\n_Note: Requires [Python] 3.7.0 or newer with PIP installed._\r\n\r\n```shell\r\n$ python setup.py install\r\n```\r\n\r\nYou now have the `imaginepy` package installed.\r\n\r\n### PyPi Installation\r\n\r\n```\r\npip install imaginepy\r\n```\r\n\r\n[Python]: https://python.org\r\n[Venv's]: https://docs.python.org/3/tutorial/venv.html\r\n[Venv's Docs]: https://docs.python.org/3/library/venv.html\r\n[hyugogirubato]: https://github.com/hyugogirubato/pyImagine\r\n\r\n### From Source Code\r\n\r\nThe following steps are instructions on download, preparing, and running the code under a Venv environment.\r\nYou can skip steps 3-5 with a simple `python setup.py install` call instead, but you miss out on a wide array of benefits.\r\n\r\n1. `git clone https://github.com/ItsCEED/Imaginepy`\r\n2. `cd Imaginepy`\r\n3. `python -m venv env`\r\n4. `source env/bin/activate`\r\n5. `python setup.py install`\r\n\r\nAs seen in Step 5, running the `imaginepy` executable is somewhat different to a normal PIP installation.\r\nSee [Venv's Docs] on various ways of making calls under the virtual-environment.\r\n\r\n[Python]: https://python.org\r\n[Venv's]: https://docs.python.org/3/tutorial/venv.html\r\n[Venv's Docs]: https://docs.python.org/3/library/venv.html\r\n[hyugogirubato]: https://github.com/hyugogirubato/pyImagine\r\n\r\n## Usage\r\n\r\nThe following is a minimal example of using ImaginePy in a script. It gets the generated image\r\nfrom the text and increases the quality.\r\n\r\n```python\r\nfrom imaginepy import Imagine\r\nfrom imaginepy.constants import *\r\n\r\n\r\ndef main():\r\n    imagine = Imagine()\r\n\r\n    img_data = imagine.sdprem(\r\n        prompt=\"Woman sitting on a table, looking at the sky, seen from behind\",\r\n        style=Style.NO_STYLE,\r\n        ratio=Ratio.RATIO_16X9,\r\n        negative=\"\",\r\n        seed=1000,\r\n        cfg=16,\r\n        model=Model.REALISTIC,\r\n        asbase64=False  # default is false, putting it here as presentation.\r\n    )\r\n\r\n    if img_data is None:\r\n        print(\"An error occurred while generating the image.\")\r\n        return\r\n\r\n    img_data = imagine.upscale(img_data)\r\n\r\n    if img_data is None:\r\n        print(\"An error occurred while upscaling the image.\")\r\n        return\r\n\r\n    try:\r\n        with open(\"example.jpeg\", mode=\"wb\") as img_file:\r\n            img_file.write(img_data)\r\n    except Exception as e:\r\n        print(f\"An error occurred while writing the image to file: {e}\")\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n```\r\n\r\nAsync version\r\n\r\n```python\r\nimport asyncio\r\nfrom imaginepy import AsyncImagine\r\nfrom imaginepy.constants import *\r\n\r\n\r\nasync def main():\r\n    imagine = AsyncImagine()\r\n    img_data = imagine.sdprem(\r\n        prompt=\"Woman sitting on a table, looking at the sky, seen from behind\",\r\n        style=Style.NO_STYLE,\r\n        ratio=Ratio.RATIO_16X9,\r\n        negative=\"\",\r\n        seed=1000,\r\n        cfg=16,\r\n        model=Model.REALISTIC,\r\n        asbase64=False  # default is false, putting it here as presentation.\r\n    )\r\n\r\n    if img_data is None:\r\n        print(\"An error occurred while generating the image.\")\r\n        return\r\n\r\n    img_data = await imagine.upscale(image=img_data)\r\n\r\n    if img_data is None:\r\n        print(\"An error occurred while upscaling the image.\")\r\n        return\r\n\r\n    try:\r\n        with open(\"example.png\", mode=\"wb\") as img_file:\r\n            img_file.write(img_data)\r\n    except Exception as e:\r\n        print(f\"An error occurred while writing the image to file: {e}\")\r\n\r\n    await imagine.close()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())\r\n\r\n```\r\n\r\n## Credit\r\n\r\n- Imagine Icon &copy; Vyro AI & API\r\n- Original reverse and version by: [hyugogirubato]\r\n\r\n## License\r\n\r\n[GNU General Public License, Version 3.0](LICENSE)\r\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "Python library to create Art with AI.",
    "version": "2.0.1",
    "project_urls": {
        "Homepage": "https://github.com/ItsCEED/imaginepy"
    },
    "split_keywords": [
        "art",
        "image",
        "ai",
        "stable-diffusion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bef90469a47de15e6a64cfc4ffea4d2434145a42b379dfc5ef2cb32cd13494af",
                "md5": "a2a8fa9fc54652d67f945551d189ae23",
                "sha256": "05f26502cc4cf697ba85121ca8f04ba62b7a23a896e056c3e2740da95f3451fe"
            },
            "downloads": -1,
            "filename": "imaginepy-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a2a8fa9fc54652d67f945551d189ae23",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 36398,
            "upload_time": "2023-06-26T01:29:12",
            "upload_time_iso_8601": "2023-06-26T01:29:12.287257Z",
            "url": "https://files.pythonhosted.org/packages/be/f9/0469a47de15e6a64cfc4ffea4d2434145a42b379dfc5ef2cb32cd13494af/imaginepy-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-26 01:29:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ItsCEED",
    "github_project": "imaginepy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "imaginepy"
}
        
Elapsed time: 0.09485s