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.
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"
}
Use Flux Kontext in Hermes Agent in three steps
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
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
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
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.
Flux Kontext + Hermes Agent questions
Yes. Configure RunAPI as a custom:runapi provider in Hermes Agent, then call the text_to_image endpoint with model set to flux-kontext-pro. The same RUNAPI_API_KEY you use for chat handles image generation.
No. The same RUNAPI_API_KEY works for all RunAPI models — LLM, image, video, and music. One key, one billing account.
Hermes Agent sends the source image URL and editing instructions to the RunAPI Flux Kontext endpoint. The agent can chain multiple edits in sequence, passing each output as input to the next step for iterative refinement.
Pass the character image as image_url and describe only what you want to change in the prompt. Flux Kontext preserves facial features and proportions by default -- you do not need special tokens or reference IDs. For multi-step edits, pass the previous output as the new image_url each time.
Yes. Pass the image containing the sign or label as image_url and describe the text change in the prompt -- for example, "change the shop sign to read BAKERY." Flux Kontext renders the new text in the position and style of the original, which is useful for localization and mockup workflows.
Dev Pro is faster and cheaper, suitable for most editing and generation tasks. Max produces higher-fidelity output with better detail on complex compositions. Both share the same API parameters and editing capabilities through the custom:runapi provider.
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.