Skip to content

Latest commit

 

History

History
78 lines (44 loc) · 1.94 KB

README.md

File metadata and controls

78 lines (44 loc) · 1.94 KB

OpenAI API Image Basics

This is just a simple command line utilities to create/modify images with OpenAI. Feel free to use the code in your projects.

This project has 2 programs: - image-generator.py to generate images using simple text like "a dog with a ball". - image-variation.py to modify an existent image by the OpenAI algorithm.

Run the programs without arguments to get help about usage.

Setup

  1. Python installed is required

  2. Navigate into the project directory

  3. Create a new virtual environment... AND ACTIVATE IT!

    python -m venv venv
    source venv/bin/activate

    Under Windows use

    venv\Scripts\activate.bat
    
  4. Install the requirements

    python -m pip install -r requirements.txt
  5. You must Add your API key in open_ai_key.py or set it in your environment, in any case, edit the file open_ai_key.py before run. Create an API Key, sing up for free.

  6. All done. you can run the programs without params to get usage help.

Copyright & License

By José Puga 2023. Under MIT License.


image-generator.py : Some samples (just typing the text)

An alien organism adapted to water and land

Alien organism

An 80's computer running tetris

80's Computer

The Last Supper impressionist style

The Last Supper

Rusted clock

Rusted Clock

A blue cow with flowers

Blue Cow


image-variation.py : Getting variations of the same image

Original Image

Multifruits

samples

Multifruits 1 Out Multifruits 2 Out Multifruits 3 Out