Git Product home page Git Product logo

pyimagine's Introduction

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.

Disclaimer

PyImagine is an unofficial library and is not affiliated with or endorsed by Imagine or Vyroai. The library is provided "as is" without any warranty, and the usage of this library is at your own risk. Make sure to comply with the terms and conditions of the Imagine service while using this library.

License

This project is licensed under the GPL v3 License.

pyimagine's People

Contributors

hyugogirubato avatar

Stargazers

Omar Nagy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.