Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jhrcook/openai-expt

Experimenting with the OpenAI model APIs.
https://github.com/jhrcook/openai-expt

ai artificial-intelligence dall-e examples image-generation openai

Last synced: 29 days ago
JSON representation

Experimenting with the OpenAI model APIs.

Awesome Lists containing this project

README

        

# Playing with OpenAI APIs

[![python](https://img.shields.io/badge/Python-3.10-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![pydocstyle](https://img.shields.io/badge/pydocstyle-enabled-AD4CD3)](http://www.pydocstyle.org/en/stable/)
[![License: GPLv3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

## DALL-E

Generate images for example prompts.

```bash
❯ python dalle.py examples
Generating images for 'A man standing on a bridge in California.'
100%|█████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 6329.43it/s]
Generating images for 'A cat waving to her mom.'
100%|█████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 8671.89it/s]
Generating images for 'Elvis jumping out of a cake.'
100%|████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 10745.44it/s]
Generating images for 'Golden retriever riding the space shuttle to the moon.'
100%|█████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 9467.95it/s]
```

(Note that DALL-E was specifically trained with some precautions against producing identifiable images of celebrities, e.g. Elvis.)

A man standing on a bridge in California.
A cat waving to her mom.
Elvis jumping out of a cake.
Golden retriever riding the space shuttle to the moon.

Or run with new prompts.

```bash
❯ ./dalle.py generate "a baby duck in a tea cup on a table" --n 3
Generating images for 'a baby duck in a tea cup on a table'
100%|███████████████████████████████████████████████████████████████████████████████████| 3/3 [00:20<00:00, 6.69s/it]
```

a baby duck in a tea cup on a table (img 1)
a baby duck in a tea cup on a table (img 2)
a baby duck in a tea cup on a table (img 3)

I played around with requesting different styles for the same prompt. The prompt was **"A computer programmer in the style of \."**

**Claude Monet**

A computer programmer in the style of Claude Monet (img 1)
A computer programmer in the style of Claude Monet (img 2)
A computer programmer in the style of Claude Monet (img 3)

**Vincent van Gogh**

A computer programmer in the style of Vincent van Gogh (img 1)
A computer programmer in the style of Vincent van Gogh (img 2)
A computer programmer in the style of Vincent van Gogh (img 3)

**Jackson Pollock**

A computer programmer in the style of Jackson Pollock (img 1)
A computer programmer in the style of Jackson Pollock (img 2)
A computer programmer in the style of Jackson Pollock (img 3)

**"DALL-E" (itself)**

A computer programmer in the style of DALL-E (img 1)
A computer programmer in the style of DALL-E (img 2)
A computer programmer in the style of DALL-E (img 3)