HERMES + IMAGEN 4

Use Imagen 4 in Hermes Agent.

Imagen 4 is Google DeepMind's image generation model with accurate text rendering and high prompt fidelity. Hermes Agent calls it through the same RunAPI custom provider endpoint you use for chat — no ComfyUI or GPU setup needed.

one API key · text to image endpoint · async task polling
Use RunAPI to generate an image with Google Imagen 4 from Hermes Agent.

Requirements:
- Read the API key from RUNAPI_API_KEY. Do not hardcode the key.
- Use the custom:runapi provider already configured in Hermes Agent.
- Send a POST request to https://runapi.ai/v1/text_to_image.
- Set the model to imagen-4.
- Write a descriptive prompt for the image you want.
- The response returns a task_id. Poll the task status endpoint until the task completes.
- When the task is complete, retrieve the image URL from the response.
curl -X POST https://runapi.ai/v1/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "imagen-4",
    "prompt": "A ceramic coffee mug on a wooden table with morning light, the text HELLO printed on the side in serif font, photorealistic"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "imagen-4"
}
Copy the curl command to test imagen-4
HOW IT WORKS

Use Imagen 4 in Hermes Agent in three steps

1

Configure RunAPI

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

export RUNAPI_API_KEY=runapi_xxx
2

Call Imagen 4

Send a POST request to the text_to_image endpoint with model set to imagen-4. Include a descriptive prompt. Add aspect_ratio or negative_prompt as needed.

POST /v1/text_to_image
3

Get the result

The response includes a task_id. Poll the task status endpoint until status changes to completed. The finished response contains the generated image URL.

task_id: tsk_abc123
PARAMETERS

Imagen 4 API parameters

Parameter Type Description
model string Required. imagen-4, imagen-4-fast, or imagen-4-ultra.
prompt string Text description of the desired image.
aspect_ratio string Optional. E.g. 1:1, 16:9, 9:16.
negative_prompt string Optional. What to avoid in the generated image.

What is Imagen 4 on Hermes Agent?

Imagen 4 by Google DeepMind ranks near the top in head-to-head comparisons with cleaner text and stricter prompt following than most competitors. Its three-tier system (Fast, Standard, Ultra) lets you pick the cost-quality tradeoff per image rather than committing to one quality level for everything. Hermes Agent calls it through the RunAPI custom provider -- no Vertex AI project or GCP account required.

Imagen 4 use cases

Team-friendly image generation

Non-technical team members can tweak prompts and generate usable images with Imagen 4's strict prompt following -- it does what you ask without needing prompt engineering expertise.

Adventurous and editorial photography

Generate editorial-quality photography -- landscapes, food, architecture, lifestyle -- with accurate lighting, depth of field, and natural color grading.

Cost-optimized batch generation

Mix tiers within a single workflow -- Fast for draft rounds at $0.02 per image, Ultra for final selects -- keeping batch costs low without sacrificing final output quality.

FAQ

Imagen 4 + Hermes Agent questions

Hermes Agent general setup

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

Hermes Agent setup guide →

Imagen 4 model catalog

See all Imagen 4 variants, pricing, and API docs.

Imagen 4 models →

Try Imagen 4 in Hermes Agent today.

Get a free RunAPI key, configure the custom:runapi provider, and start generating images with Google Imagen 4.