Graphrt

Stability AI

Generate (Ultra, Core, SD 3.5), upscale (incl. async creative), edit and control images, saved to a local folder (paid in credits)

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

About

A Graphrt plugin for the Stability AI REST API (Stable Image v2beta): generate images with Stable Image Ultra, Core and Stable Diffusion 3.5, upscale, edit (erase, inpaint, outpaint, search and replace/recolor, remove background) and control (sketch, structure, style). Results are saved into a local folder. Built with the declarative REST layer.

What it can do

  • Generate: generate_ultra, generate_core, generate_sd3 (text-to-image, and image-to-image for Ultra and SD 3.5)
  • Upscale: upscale_fast (4x), upscale_conservative (to 4 MP), upscale_creative (async job, waits and saves the result), get_result (fetch any async result by id)
  • Edit: erase_object, inpaint, outpaint, search_and_replace, search_and_recolor, remove_background
  • Control: control_sketch, control_structure, control_style
  • Account: get_account, get_balance (free)
  • api_request: any other endpoint, e.g. /v1/engines/list (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.

  • Get account stability-ai.get_account
  • Get credit balance stability-ai.get_balance
  • Generate image (Stable Image Ultra) stability-ai.generate_ultra
  • Generate image (Stable Image Core) stability-ai.generate_core
  • Generate image (Stable Diffusion 3.5) stability-ai.generate_sd3
  • Upscale image (fast) stability-ai.upscale_fast
  • Upscale image (conservative) stability-ai.upscale_conservative
  • Upscale image (creative, async) stability-ai.upscale_creative
  • Get async result stability-ai.get_result
  • Erase object stability-ai.erase_object
Show all 19 actions
  • Inpaint stability-ai.inpaint
  • Outpaint stability-ai.outpaint
  • Search and replace stability-ai.search_and_replace
  • Search and recolor stability-ai.search_and_recolor
  • Remove background stability-ai.remove_background
  • Sketch to image stability-ai.control_sketch
  • Structure to image stability-ai.control_structure
  • Style guide stability-ai.control_style
  • Stability AI REST API request stability-ai.api_request

Settings

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

  • STABILITY_API_KEY Required
    API key from <https://platform.stability.ai/dashboard/api-keys> (sent as Authorization: Bearer)
  • STABILITY_AI_OUTPUT_DIR For image operations
    Absolute directory where images are saved. Synchronous operations refuse to run without it (the API answers with raw image bytes)
  • STABILITY_AI_UPLOAD_DIR For local uploads
    Absolute directory that image/mask inputs may be read from. Unset: only https URLs are accepted

How to use it

In Graphrt Desktop

  1. Open Plugins and search for Stability AI.
  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 stability-ai
workflow.yaml
- id: draft
  type: stability-ai.generate_core
  prompt: "A cozy cabin in a snowy forest, golden hour"
  aspect_ratio: "16:9"
- id: big
  type: stability-ai.upscale_fast
  image: "{{#draft.data.path#}}"   # needs STABILITY_AI_UPLOAD_DIR to include the output dir
Plugins in the docs