Hermes Agent에서 Imagen 4 사용하기.
Imagen 4는 정확한 텍스트 렌더링과 높은 프롬프트 충실도를 갖춘 Google DeepMind의 이미지 생성 모델입니다. Hermes Agent는 채팅에 사용하는 동일한 RunAPI custom provider endpoint를 통해 호출합니다 — ComfyUI나 GPU 설정이 필요 없습니다.
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"
}
Hermes Agent에서 Imagen 4를 세 단계로 사용하기
RunAPI 설정
RUNAPI_API_KEY 환경 변수를 설정하세요. 이미 Hermes Agent에서 채팅용 custom:runapi provider로 RunAPI를 설정했다면, 동일한 key와 base_url이 이미지 생성에도 사용됩니다.
export RUNAPI_API_KEY=runapi_xxx
Imagen 4 호출
model을 imagen-4로 설정하여 text_to_image endpoint에 POST 요청을 보내세요. 설명적인 프롬프트를 포함하세요. 필요에 따라 aspect_ratio나 negative_prompt를 추가하세요.
POST /v1/text_to_image
결과 가져오기
응답에는 task_id가 포함됩니다. status가 completed로 변경될 때까지 task status endpoint를 폴링하세요. 완료된 응답에는 생성된 이미지 URL이 포함됩니다.
task_id: tsk_abc123
Imagen 4 API 파라미터
| 파라미터 | 유형 | 설명 |
|---|---|---|
model |
string |
필수. imagen-4, imagen-4-fast, 또는 imagen-4-ultra. |
prompt |
string |
원하는 이미지에 대한 텍스트 설명. |
aspect_ratio |
string |
선택 사항. 예) 1:1, 16:9, 9:16. |
negative_prompt |
string |
선택 사항. 생성된 이미지에서 피해야 할 것. |
Hermes Agent의 Imagen 4란?
Google DeepMind의 Imagen 4는 교차 비교에서 상위권을 차지하며, 텍스트 렌더링이 더 선명하고 대부분의 경쟁 제품보다 프롬프트 준수율이 높습니다. 3단계 시스템(Fast·Standard·Ultra)으로 이미지별 비용과 품질 트레이드오프를 선택할 수 있습니다. Hermes Agent는 RunAPI custom provider를 통해 호출하며, Vertex AI 프로젝트나 GCP 계정이 필요 없습니다.
Imagen 4 활용 사례
팀 친화적인 이미지 생성
Imagen 4의 높은 프롬프트 준수율 덕분에 비기술 팀원이 프롬프트를 조정해 사용 가능한 이미지를 생성할 수 있으며, 프롬프트 엔지니어링 전문 지식이 필요 없습니다.
모험적·편집용 사진
정확한 조명·피사계 심도·자연스러운 색조 그레이딩으로 편집 품질의 사진——풍경·음식·건축·라이프스타일——을 생성합니다.
비용 최적화된 일괄 생성
단일 워크플로에서 티어를 혼합해 사용합니다——초안 단계는 Fast(장당 $0.02), 최종 선택은 Ultra——최종 출력 품질을 희생하지 않고 일괄 비용을 절감합니다.
Imagen 4 + Hermes Agent 자주 묻는 질문
네. Hermes Agent는 RunAPI text_to_image endpoint를 통해 Imagen 4를 호출합니다. model 필드를 imagen-4로 설정하고, custom:runapi provider에 설정한 동일한 RUNAPI_API_KEY로 요청을 보내세요. ComfyUI나 GPU 임대가 필요 없습니다.
아니요. 동일한 RUNAPI_API_KEY로 채팅, 이미지, 비디오, 음악 등 113개 이상의 모든 모델을 사용할 수 있습니다. 하나의 key, 하나의 결제 계정입니다.
Imagen 4는 비동기입니다. 초기 요청은 status pending으로 task_id를 반환합니다. task가 완료될 때까지 task status endpoint를 폴링한 뒤, 응답에서 이미지 URL을 가져오세요. RunAPI SDK는 폴링을 자동으로 처리합니다.
Imagen 4 가격은 월 최소 요금 없이 사용한 만큼 청구됩니다. 티어에 따라 비용이 다릅니다: imagen-4-fast가 가장 저렴하고, imagen-4가 표준이며, imagen-4-ultra가 최고 품질입니다. 현재 이미지당 요금은 RunAPI 가격 페이지에서 확인하세요.
지금 Hermes Agent에서 Imagen 4를 사용해보세요.
무료 RunAPI key를 발급받고, custom:runapi provider를 설정한 뒤 Google Imagen 4로 이미지를 생성해보세요.