An open API service indexing awesome lists of open source software.

https://github.com/simatwa/ai-imager

Generate and manipulate image with DALL-E and BingImageCreator
https://github.com/simatwa/ai-imager

bingimagegenerator dalle dalle2 flask-application image-processing imagegeneration

Last synced: 11 months ago
JSON representation

Generate and manipulate image with DALL-E and BingImageCreator

Awesome Lists containing this project

README

          

AI-Imager



Logo


Github
License
visitors
Progress
Code-style
Coverage
wakatime

![Demo](assets/demo.png)

## Features

- Generate image from prompt
- BingImageCreator
- DALL-E (2)
- Edit image with a mask
- Generate variant of an image
- User-friendly web interface

## Prerequisites

1. [OPENAI-API-KEY](https://platform.openai.com/account/api-keys)
2. [Bing cookies](bing.com) - (*optional*)
3. [Python >=3.7](Python.org)

## Installation and usage

### Installation

If you have enough permissions you can clone from official repo:

```sh
git clone https://github.com/Simatwa/ai-imager.git
cd ai-imager
bash install.sh
```

If you're viewing this locally, you can install by executing the `install.sh` script.

```sh
bash install.sh
```

### Usage

Once installed, the site can be fired up as follows:

```sh
ai-imager -k $OPENAI_API_KEY
```

Fire up efficiently - *recommended*

- Make **KEY** an environment variable

```sh
export OPENAI_API_KEY=
```

- Fire up the server - `$ ai-imager`

- If yout want to use Bing's model, you have to parse the path to the cookie file during start up introduced by `-cf

By default, the server has the following configurations.


Argument
Default


Port
8000


Logging-level
20


Host
False


Debug
False

Run `$ ai-imager help` for more info.

```

usage: ai-imager [-h] [-v] [-k KEY] [-kp PATH] [-l 10-50] [-o PATH]
[-cf COOKIE_FILE] [--host] [--thread] [--debug]
[port ...]

Manipulate images with OpenAI's model

positional arguments:
port Port to start the server

options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-k KEY, --key KEY OpenAI's API key
-kp PATH, --key-path PATH
Path to OpenAI-API-KEY path
-l 10-50, --logging-level 10-50
Log level of the app
-o PATH, --output PATH
Filepath to log to
-cf COOKIE_FILE, --cookie-file COOKIE_FILE
Path to Bing's cookie file
--host Host the site on LAN
--thread Run server in multiple threads
--debug Start as debugging server

This script has no official relation with OpenAI.

```

> **Note** To *developers*, execute the [test.py](test.py) script to run server as you modify the contents.

## ToDo

- [x] Generate with BingImageCreator
- [ ] Download button
- [ ] Chat feature
- [ ] Aunthenticate users

## Acknowledgements

- [x] [LawrenceKimutai](https://github.com/LawrenceKimutai)

## Disclaimer

This is not an official OpenAI product. This is a personal project and is not affiliated with OpenAI in any way. Don't sue me.