Graphrt

OpenAI Images

Generate and edit images with GPT Image and DALL·E (masks, reference images), saved to a local folder (paid per call)

Beta v0.1.0 Node.js 5 actions
Use in Graphrt Desktop

About

A Graphrt plugin for the OpenAI Images API: generate images from a prompt and edit images (with an optional mask, or from several reference images) with the GPT Image models (gpt-image-2, gpt-image-1.5, gpt-image-1-mini, chatgpt-image-latest, the 2.5/2.6 models) and DALL·E. Generated images are saved into a local folder. Built with the declarative REST layer.

What it can do

  • generate_image: prompt to 1–10 images, size, quality, background (transparent), output format and compression, moderation level. DALL·E 3 style and response_format for the legacy models.
  • edit_image: edit one uploaded image, optionally only where a PNG mask is transparent. Without a mask and with a prompt such as "a variation of this image" it replaces the retired variations endpoint.
  • edit_image_from_references: edit or combine up to 16 images given as URLs, data: URLs or uploaded file_ids (JSON form of the edits endpoint, GPT Image models only).
  • list_models: the models your key can use (free).
  • api_request: any other endpoint (GET only when called by an agent).

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • List models openai-images.list_models
  • Generate image openai-images.generate_image
  • Edit image openai-images.edit_image
  • Edit image from references openai-images.edit_image_from_references
  • OpenAI API request openai-images.api_request

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • OPENAI_API_KEY Required
    API key from <https://platform.openai.com/api-keys> (a project key limits it to one project)
  • OPENAI_IMAGES_OUTPUT_DIR For files
    Absolute directory where generated images are saved. Unset: nothing is saved and the result keeps the raw b64_json (large)
  • OPENAI_IMAGES_UPLOAD_DIR For local uploads
    Absolute directory that edit_image may read local files from. Unset: only https URLs are accepted

How to use it

In Graphrt Desktop

  1. Open Plugins and search for OpenAI Images.
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install openai-images
workflow.yaml
- id: hero
  type: openai-images.generate_image
  prompt: "Flat illustration of a lighthouse at dawn, warm colours"
  size: 1536x1024
  quality: medium
  output_format: webp
- id: tweak
  type: openai-images.edit_image
  image: "{{#hero.data.saved_files.0.path#}}"   # needs OPENAI_IMAGES_UPLOAD_DIR to include the output dir
  prompt: "Add a small sailboat on the left"
Plugins in the docs