Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/austenstone/openai-image-generation
Generate images using OpenAI Image Generation API DALLE
https://github.com/austenstone/openai-image-generation
actions dall-e image-generation openai
Last synced: 26 days ago
JSON representation
Generate images using OpenAI Image Generation API DALLE
- Host: GitHub
- URL: https://github.com/austenstone/openai-image-generation
- Owner: austenstone
- Created: 2023-04-05T19:26:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T17:08:25.000Z (over 1 year ago)
- Last Synced: 2024-11-21T19:16:02.082Z (about 2 months ago)
- Topics: actions, dall-e, image-generation, openai
- Language: TypeScript
- Homepage:
- Size: 539 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OpenAI Image Generation Action
This action generates an image using the [OpenAI Image Generation API](https://platform.openai.com/docs/guides/images/image-generation-beta).
## Usage
Create a workflow (eg: `.github/workflows/generate-image.yml`). See [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).#### Example
```yml
name: Image Generation
on:
issue_comment:
types: [created]jobs:
run:
if: ${{ startsWith(github.event.comment.body, '/image') }}
name: Run Action
runs-on: ubuntu-latest
steps:
- id: prompt
uses: actions/github-script@v3
with:
script: return context.payload.comment.body.replace('/image', '').trim()
- id: generate-image
uses: austenstone/openai-image-generation@main
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt: ${{ steps.prompt.outputs.result }}
- run: gh api repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments -f body="![image](${{ steps.generate-image.outputs.image }})"
env:
GH_TOKEN: ${{ github.token }}
```## ➡️ Inputs
Various inputs are defined in [`action.yml`](action.yml):| Name | Description | Default |
| --- | - | - |
| openai‑api‑key | OpenAI API key. | |
| prompt | Prompt to use for image generation. | |
| size | Size of the image to generate. | 512x512 |## Further help
To get more help on the Actions see [documentation](https://docs.github.com/en/actions).