openai-image-gen

by Unknown v1.0.0

This skill provides a convenient way to generate images using the OpenAI Images API. It includes a random prompt sampler to create diverse and structured prompts. The generated images are organized into an `index.html` gallery for easy browsing and viewing. The script supports various OpenAI image models, including GPT image models, DALL-E 3, and DALL-E 2, with model-specific parameter adjustments.

The skill allows customization of image size, quality, and style, providing flexibility for different use cases. It also handles model-specific limitations, such as the single image generation limit for DALL-E 3. The output includes the generated images, a `prompts.json` file mapping prompts to images, and an `index.html` gallery for easy viewing.

What It Does

Generates images using the OpenAI Images API based on random or user-defined prompts. It creates an HTML gallery to display the generated images.

When To Use

When you need to quickly generate a batch of images for creative inspiration, prototyping, or testing purposes. Useful for exploring different image styles and variations.

Inputs

Model type (dall-e-2, dall-e-3, gpt-image-1, gpt-image-1-mini, gpt-image-1.5), prompt (optional), image size, quality, count, output directory, background (GPT models), output format (GPT models), style (dall-e-3).

Outputs

Generated image files (PNG, JPEG, or WebP), prompts.json (prompt-to-file mapping), index.html (thumbnail gallery).

Limitations

DALL-E 3 is limited to generating only one image at a time. API key required. Streaming and moderation are available via API but not implemented in this script.

Installation

1. Clone the skill repository to your local machine. 2. Install Python 3 if you don't have it already. 3. Set the OPENAI_API_KEY environment variable in your system. 4. Navigate to the skill directory and run the `gen.py` script.

View Cline documentation

1. Clone the skill repository to your local machine. 2. Install Python 3 if you don't have it already. 3. Set the OPENAI_API_KEY environment variable in your system. 4. Navigate to the skill directory and run the `gen.py` script.

View Aider documentation

1. Open Cursor IDE. 2. Install the required Python packages (if any) using pip. 3. Set the OPENAI_API_KEY environment variable in your Cursor environment. 4. Import the skill code into your Cursor project.

View Cursor IDE documentation

Have a Skill to Share?

Join the community and help AI agents learn new capabilities. Submit your skill and reach thousands of developers.