Hermes Agent에서 Qwen 2 Image 사용하기.
Qwen 2 Image는 Alibaba의 이미지 생성 및 편집 모델입니다. Hermes Agent는 채팅에 사용하는 동일한 RunAPI custom provider endpoint를 통해 호출합니다 — 프롬프트를 보내면 이미지 URL을 받습니다. 세 가지 모델 변형으로 텍스트-이미지, 이미지 편집, 이미지 리믹싱을 지원합니다.
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"
}
Hermes Agent에서 Qwen 2 Image를 세 단계로 사용하기
RunAPI 설정
RunAPI API key를 환경 변수로 설정하세요. Hermes Agent custom provider를 아직 추가하지 않았다면 Hermes Agent 설정 가이드를 따라 base_url을 https://runapi.ai/v1로 설정하여 custom:runapi를 추가하세요.
export RUNAPI_API_KEY=runapi_xxx
Qwen 2 Image 호출
프롬프트를 Hermes Agent에 붙여넣거나 text_to_image endpoint를 직접 호출하세요. 생성은 qwen-2-text-to-image, 편집은 qwen-2-edit-image, 리믹스는 qwen-2-remix-image로 model 필드를 설정하세요.
text_to_image
결과 가져오기
endpoint는 task ID를 반환합니다. status가 completed로 변경될 때까지 task status endpoint를 폴링한 뒤, 출력에서 이미지 URL을 읽으세요. RunAPI SDK는 폴링을 자동으로 처리합니다.
task_id: tsk_abc123
Qwen 2 Image API 파라미터
| 파라미터 | 유형 | 설명 |
|---|---|---|
model |
string |
필수. qwen-2-text-to-image, qwen-2-edit-image, 또는 qwen-2-remix-image. |
prompt |
string |
텍스트 설명 또는 편집 지시문. |
image_url |
string |
편집 또는 리믹스 모드를 위한 소스 이미지. |
size |
string |
선택 사항. 출력 크기. |
Hermes Agent의 Qwen 2 Image란?
Qwen 2 Image는 Alibaba의 이미지 모델로 단일 API에서 생성·편집·리믹스 세 가지 모드를 제공합니다. Hermes Agent는 custom:runapi provider를 통해 호출합니다. 복잡한 멀티 객체 장면을 처리하며 중국어·영어·혼합 언어 프롬프트를 네이티브로 이해해 다국어 콘텐츠 파이프라인에 특히 유용합니다.
Qwen 2 Image 활용 사례
agent 워크플로에서 반복적 이미지 편집
단일 Hermes Agent 실행에서 여러 Qwen 2 편집 단계를 연결합니다——초기 이미지를 생성한 후 배경 교체·색상 조정·요소 추가 등의 텍스트 가이드 변경을 순서대로 적용합니다.
스타트업을 위한 비용 효율적 이미지 생성
Qwen 2 Image를 제품 목업·SNS 콘텐츠·개발 중 플레이스홀더 아트 등의 대량 이미지 생성 작업에 대한 비용 효율적인 선택지로 활용합니다.
이중 언어 콘텐츠 제작
번역 없이 중국어·영어 프롬프트에서 이미지를 생성해 단일 워크플로에서 이중 언어 마케팅 캠페인 또는 현지화된 제품 페이지의 비주얼을 제작합니다.
Qwen 2 Image + Hermes Agent 자주 묻는 질문
네. Hermes Agent는 custom OpenAI 호환 provider를 지원합니다. base_url을 https://runapi.ai/v1로, key_env를 RUNAPI_API_KEY로, api_mode를 chat_completions으로 설정하여 RunAPI를 custom:runapi로 추가하세요. 그런 다음 model을 qwen-2-text-to-image로 설정하여 text_to_image endpoint를 호출하세요.
아니요. 채팅 모델에 사용하는 동일한 RUNAPI_API_KEY로 Qwen 2 Image와 RunAPI 카탈로그의 다른 모든 모델을 호출할 수 있습니다. 하나의 key, 하나의 잔액, 하나의 대시보드입니다.
비동기입니다. endpoint는 즉시 task ID를 반환합니다. 이미지가 준비되면 task status endpoint를 폴링하거나 webhook callback을 사용하세요. RunAPI SDK와 CLI는 폴링을 자동으로 처리합니다.
Qwen 2 Image는 task당 청구됩니다. 현재 요금은 RunAPI 가격 페이지에서 확인하세요. 월 구독이나 최소 지출이 없으며 완료된 생성에 대해서만 비용을 지불합니다.
지금 Hermes Agent에서 Qwen 2 Image를 사용해보세요.
무료 RunAPI key를 발급받고, Hermes Agent에 프롬프트를 붙여넣어 바로 생성을 시작하세요.