HERMES + QWEN 2 IMAGE

Use Qwen 2 Image in Hermes Agent.

Qwen 2 Image is Alibaba's image generation and editing model. Hermes Agent calls it through the RunAPI custom provider endpoint — send a prompt, get an image URL. Supports text-to-image, image editing, and image remixing through three model variants.

one API key · text to image endpoint · async task polling
Use RunAPI to generate an image with Qwen 2 Image.

Requirements:
- Call the RunAPI text_to_image endpoint at https://runapi.ai/api/v1/task/text_to_image.
- Set the model to "qwen-2-text-to-image".
- Read the API key from the RUNAPI_API_KEY environment variable.
- Use the custom:runapi provider configured in Hermes Agent.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the image URL from the output.
- For image editing, use model "qwen-2-edit-image" and include an image_url field.
- For remixing, use model "qwen-2-remix-image" and include an image_url field.
curl -X POST https://runapi.ai/api/v1/task/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-2-text-to-image",
    "prompt": "A traditional Chinese ink painting of misty mountains at dawn, elegant brushwork"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "qwen-2-text-to-image"
}
Copy the curl command to test qwen-2
HOW IT WORKS

Use Qwen 2 Image in Hermes Agent in three steps

1

Configure RunAPI

Set your RunAPI API key as an environment variable. If you have not added RunAPI as a Hermes Agent custom provider yet, follow the Hermes Agent setup guide and add custom:runapi with base_url https://runapi.ai/v1.

export RUNAPI_API_KEY=runapi_xxx
2

Call Qwen 2 Image

Paste the prompt into Hermes Agent or call the text_to_image endpoint directly. Set the model field to qwen-2-text-to-image for generation, qwen-2-edit-image for editing, or qwen-2-remix-image for remixing.

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 read the image URL from the output. RunAPI SDKs handle polling automatically.

task_id: tsk_abc123
PARAMETERS

Qwen 2 Image API parameters

Parameter Type Description
model string Required. qwen-2-text-to-image, qwen-2-edit-image, or qwen-2-remix-image.
prompt string Text description or editing instruction.
image_url string Source image for edit or remix mode.
size string Optional. Output dimensions.

What is Qwen 2 Image on Hermes Agent?

Qwen 2 Image is Alibaba's image model with three modes -- generation, editing, and remixing -- all through one API. Hermes Agent calls it through the custom:runapi provider. It handles complex multi-object scenes and understands prompts in Chinese, English, and mixed-language text natively, making it especially useful for multilingual content pipelines.

Qwen 2 Image use cases

Iterative image editing in agent workflows

Chain multiple Qwen 2 editing steps in one Hermes Agent run -- generate an initial image, then apply a series of text-guided changes like swapping backgrounds, adjusting colors, or adding elements.

Budget-friendly image generation for startups

Use Qwen 2 Image as a cost-effective alternative for high-volume image generation tasks like product mockups, social media content, or placeholder art during development.

Bilingual content production

Generate images from Chinese and English prompts without translation, producing visuals for bilingual marketing campaigns or localized product pages in a single workflow.

FAQ

Qwen 2 Image + Hermes Agent questions

Hermes Agent general setup

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

Hermes Agent setup guide →

Qwen 2 Image model catalog

See all Qwen 2 Image variants, pricing, and API docs.

Qwen 2 Image models →

Try Qwen 2 Image in Hermes Agent today.

Get a free RunAPI key, paste the prompt into Hermes Agent, and start generating.