Skip to main content

ImaginePy
Discord Banner 4
Python version Release Version

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.

$ python setup.py install

You now have the imaginepy package installed.

PyPi Installation

pip install imaginepy

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.

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.

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

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 © Vyro AI & API
  • Original reverse and version by: hyugogirubato

License

GNU General Public License, Version 3.0

Metadata

Release files for imaginepy 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imaginepy 2.0.1
File Size Uploaded
imaginepy-2.0.1.tar.gz 36.4 kB Details

Release files / imaginepy-2.0.1.tar.gz

Download URL imaginepy-2.0.1.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
05f26502cc4cf697ba85121ca8f04ba62b7a23a896e056c3e2740da95f3451fe
BLAKE2b-256 checksum
How to use checksums
bef90469a47de15e6a64cfc4ffea4d2434145a42b379dfc5ef2cb32cd13494af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file

2.0.0

1 release file

1.1.0

2 release files

1.0.7

2 release files

1.0.5

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page