Alibaba · Image

Hermes Agent x Qwen 2

Qwen 2 is Alibaba's visual model from the Qwen family, supporting image generation and editing. Through RunAPI, all Qwen 2 endpoints share unified billing and API access.

2 variants from $0.06 / call Commercial OK

Prerequisite: npx runapi mcp install

Prompt

Prompt models

Use qwen-2-edit-image when it matches the task: Targeted region editing from text instructions.

You have access to RunAPI task tools for Qwen 2.

Available Qwen 2 models:
- qwen-2-edit-image: Targeted region editing from text instructions
  endpoints: /api/v1/qwen_2/edit_image
  request fields: model, prompt, source_image_url
- qwen-2-text-to-image: Qwen2 text-to-image with 5 aspect ratios
  endpoints: /api/v1/qwen_2/text_to_image
  request fields: model, prompt

Use the model ID and endpoint that match the user's request.
Example prompt: Generate an isometric illustration of a cozy home office with warm lighting and plants on the desk.
/api/v1/qwen_2/edit_image: Submit the task, poll for its status, then verify the completed output. POST /api/v1/qwen_2/edit_image and save the returned Task id.
GET /api/v1/qwen_2/edit_image/<task-id> until status is completed or failed.
Verify the completed response contains the endpoint-specific output documented in the API reference.
/api/v1/qwen_2/text_to_image: Submit the task, poll for its status, then verify the completed output. POST /api/v1/qwen_2/text_to_image and save the returned Task id.
GET /api/v1/qwen_2/text_to_image/<task-id> until status is completed or failed.
Verify the completed response contains the endpoint-specific output documented in the API reference.

Public Versions and Endpoints

Model ID Endpoints Price Catalog
qwen-2-edit-image
/api/v1/qwen_2/edit_image
$0.06 / call Model detail
qwen-2-text-to-image
/api/v1/qwen_2/text_to_image
$0.06 / call Model detail

Verify

Poll until the task reaches a terminal status

Select <model-id> to generate verification commands.

Configuration

Guide endpoint: <endpoint>

Select <model-id> to generate a request with the endpoint's public input contract.
How it works

Get Started in 3 Steps

  1. Choose a model ID

    Select a public catalog model ID and review its endpoint and current starting price.

  2. Configure RunAPI

    Set RUNAPI_API_KEY before making the endpoint request.

  3. Verify the result

    For asynchronous endpoints, poll the same endpoint until the Task reaches a terminal status.

What to Build with Hermes Agent + Qwen 2

  • Iterative image editing in agent workflows

    Chain several Qwen 2 edits in one Hermes Agent run: generate an image, then apply text-guided changes such as new backgrounds, colors, or elements.

  • Budget-friendly image generation

    Use Qwen 2 Image for high-volume tasks such as 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 campaigns or localized product pages.

Why Use Qwen 2 Through RunAPI + Hermes Agent

  • 2 variants, one API key

    Use one RunAPI connection to choose among the live model variants without changing your integration.

  • Clear usage pricing

    See current catalog pricing before you send a request, with no subscription or minimum spend required.

  • Automatic task workflows

    Submit, poll, and collect asynchronous results through a consistent task workflow without writing manual polling code.

Hermes Agent + Qwen 2 Questions

Can I use Qwen 2 Image in Hermes Agent?

Yes. Hermes Agent supports custom providers. Add RunAPI with your RunAPI API key, then call the Qwen 2 Image endpoint shown on this page.

How does Hermes Agent choose between generation and editing?

Send a text prompt alone to generate a new image, or include a source image with editing instructions to modify it. Each request goes to the matching Qwen 2 endpoint.

How well does Qwen 2 Image handle Chinese prompts?

Qwen 2 Image understands Chinese prompts natively, so they do not need to be translated to English first. This makes it a good fit for Chinese text or bilingual content.

Which model ID should I use?

Choose a public model ID from the version table. Each ID exposes the endpoints shown for that version.

Does this guide configure a chat model?

No. This Model Line uses the endpoint workflow shown here and is not presented as an agent chat model.

Start using Qwen 2 with Hermes Agent

Building with a team?

We're here to help with enterprise setup, integrations, and technical questions.

Contact Us