HERMES + FLUX KONTEXT

Use Flux Kontext in Hermes Agent.

Flux Kontext by Black Forest Labs handles text-guided image editing and generation with character consistency. Hermes Agent calls it through RunAPI using the custom:runapi provider — same key and base URL you configured for chat.

one API key · text to image endpoint · async task polling
Use RunAPI to generate an image with Flux Kontext Pro through Hermes Agent.

Requirements:
- Use the custom:runapi provider already configured in Hermes Agent
- Call the RunAPI text_to_image endpoint at https://runapi.ai/v1/text_to_image
- Set model to "flux-kontext-pro"
- The RUNAPI_API_KEY environment variable provides authorization
- The response is async — poll the task status endpoint until the task completes, then retrieve the image URL
curl -X POST https://runapi.ai/v1/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-kontext-pro",
    "prompt": "a matte-black water bottle on a beige stone surface, soft side light, studio photography"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "flux-kontext-pro"
}
Copy the curl command to test flux-kontext
HOW IT WORKS

Use Flux Kontext in Hermes Agent in three steps

1

Configure RunAPI

Set the RUNAPI_API_KEY environment variable. If you already added RunAPI as a custom:runapi provider in Hermes Agent for chat, the same key and base_url work for image generation — no extra configuration needed.

export RUNAPI_API_KEY=runapi_xxx
2

Call Flux Kontext

Send a POST request to the text_to_image endpoint with model set to flux-kontext-pro. Include a text prompt describing the image you want. Optionally pass an image_url for in-context editing.

text_to_image
3

Get the result

The endpoint returns a task ID. Poll the task status endpoint until the status changes to completed, then retrieve the generated image URL from the response.

task_id: tsk_abc123
PARAMETERS

Flux Kontext API parameters

Parameter Type Description
model string Required. flux-kontext-pro or flux-kontext-max.
prompt string Text instruction for generation or editing.
image_url string Source image URL for in-context editing.
aspect_ratio string Optional. Output aspect ratio.

What is Flux Kontext on Hermes Agent?

Flux Kontext is Black Forest Labs' instruction-based image editor built on a 12-billion-parameter rectified flow transformer. It supports multi-round editing -- you can chain several edits in sequence and the model maintains context from each previous step. Hermes Agent calls it through the RunAPI custom provider endpoint, making it straightforward to build multi-step editing pipelines.

Flux Kontext use cases

Multi-round editing workflows

Chain several edits in sequence -- generate an image, change the lighting, swap the background, add text -- with each step building on the previous result.

Style conversion pipelines

Convert photos to paintings, sketches, or anime style while preserving the subject composition, useful for creating style variants of the same content.

Weather and lighting adjustments

Change time of day, weather conditions, or lighting setup in existing photos without regenerating the entire scene from scratch.

FAQ

Flux Kontext + Hermes Agent questions

Hermes Agent general setup

Not configured yet? Start with the RunAPI setup guide for Hermes Agent.

Hermes Agent setup guide →

Flux Kontext model catalog

See all Flux Kontext variants, pricing, and API docs.

Flux Kontext models →

Try Flux Kontext in Hermes Agent today.

Get a free RunAPI key, configure the custom:runapi provider, and start generating images with Flux Kontext.