image-generation

Generate and edit images via OpenAI's gpt-image-2 API.

2|Updated Jun 2, 2024
One-click install
npx skills add https://github.com/magnusrodseth/dotfiles --skill image-generation-magnusrodseth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: image-generation
Source: https://github.com/magnusrodseth/dotfiles/tree/main/.claude/skills/image-generation
Command: npx skills add https://github.com/magnusrodseth/dotfiles --skill image-generation-magnusrodseth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python3, requests, and includes scripts (resource) and styles (resource) components.

What problem does it solve?

This Skill provides a seamless way to generate and edit images using OpenAI's gpt-image-2 API, offering users the ability to create images from text descriptions or edit existing images with specific modifications.

Core Features & Use Cases

  • Image Generation: Create images based on textual descriptions.
  • Image Editing: Modify existing images with new elements or changes.
  • Use Case: Generate a detailed watercolor illustration of a fjord at dawn or edit a photo to add a sunset sky.

Quick Start

Run the following command to generate an image: ./.claude/skills/image-generation/scripts/generate.py "A minimalist watercolor of a fjord at dawn, soft blues" --size 1024x1024 --quality high

Frequently Asked Questions about image-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate images from text descriptions using the OpenAI API?▼

To generate images from text descriptions, you provide a textual prompt to the OpenAI API via a Python script, which then processes the request and returns a newly created image matching your specifications.

Can I edit existing images by applying masks and modifications through an API?▼

Yes, you can edit existing images by supplying edit-image paths, mask files, and input fidelity parameters to the API, allowing targeted modifications like adding a sunset sky to a photo.

Do I need an OpenAI API key to use Python scripts for text-to-image generation?▼

Yes, an OpenAI API key is required for authentication and access to the gpt-image-2 API, enabling the Python scripts to execute image generation and editing tasks successfully.

What dependencies are required to run Python scripts for image generation and editing?▼

You need Python 3 and the requests library installed in your environment to run the scripts that interact with the OpenAI API for image generation and editing tasks.

How can I specify image size and quality when generating images from text prompts?▼

You can specify image size and quality by passing arguments like size and quality to the generate script, allowing you to create high-resolution images such as 1024x1024 watercolor illustrations.