Skip to main content

Python library for AI-powered image manipulation.

Project description

PyImagine

License Release Latest Version

PyImagine is a Python library for AI-powered image manipulation. It provides a simple interface to interact with an image manipulation service, allowing you to perform various operations on images.

Features

  • Generate inspired images based on predefined prompts and styles.
  • Apply variations to images based on prompts, strengths, and styles.
  • Enhance image resolution and quality using AI-powered upscaling.
  • Generate prompts based on the content of images.
  • Fill in missing or corrupted parts of images.
  • Remix images by applying control prompts, strengths, and styles.
  • Fix and enhance facial features in images.

Installation

You can install PyImagine using pip:

pip install pyimagine

Usage

Here's a basic example of how to use PyImagine:

from pyimagine import Imagine
from pyimagine.constants import Inspiration

# Initialize Imagine
imagine = Imagine()

# Generate an inspired image
inspired_image = imagine.sdinsp(Inspiration.INSPIRATION_01)

# Variate an image
original_image = open("image.jpg", "rb").read()
variated_image = imagine.variate(original_image, prompt="Create something amazing!")

# Upscale an image
upscaled_image = imagine.upscale(original_image)

# And more...

For more information on how to use PyImagine, please refer to the documentation.

Exceptions

The following exceptions can be raised by PyImagine:

  • InvalidWord: Raised when a banned word is found in the prompt. By default, if the restricted flag is set to True during initialization, the library will raise an InvalidWord exception. You can customize this behavior by setting restricted to False to replace banned words with alternative words instead of raising an exception.
  • InvalidSize: Raised when attempting to perform an operation that requires both images to have the same size.

License

This project is licensed under the GPL v3 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyimagine-2.7.1.tar.gz (34.4 kB view details)

Uploaded Source

File details

Details for the file pyimagine-2.7.1.tar.gz.

File metadata

  • Download URL: pyimagine-2.7.1.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for pyimagine-2.7.1.tar.gz
Algorithm Hash digest
SHA256 dd281425649de8b14998839a595dbceb145b1a1349e30a0e32d7dc3d1ecd541c
MD5 5c489afffedd8e76b0effacec9f13e7c
BLAKE2b-256 127e088fa58067fa85810c319f1dd59454860e3ebe80c55bfe41bc9ddaa2acd9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page