Hermes Agent에서 Grok Imagine 사용하기.
Grok Imagine은 xAI의 이미지 및 비디오 생성 제품군으로 텍스트-이미지, 이미지-이미지, 텍스트-비디오, 이미지-비디오를 지원합니다. Hermes Agent는 추가 플러그인 없이 채팅에 사용하는 동일한 RunAPI custom provider와 API key로 호출합니다.
Use RunAPI to generate an image with xAI Grok Imagine.
Requirements:
- Use the RunAPI API at https://runapi.ai/v1/text_to_image.
- Read the API key from RUNAPI_API_KEY environment variable.
- Use the custom:runapi provider already configured in Hermes Agent.
- Set the model to "grok-imagine-text-to-image".
- Write a descriptive prompt for the image you want.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the output URL.
curl -X POST https://runapi.ai/v1/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-text-to-image",
"prompt": "a robot hand placing a chess piece on a board, dramatic side lighting, slow motion feel"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "grok-imagine-text-to-image"
}
Hermes Agent에서 Grok Imagine을 세 단계로 사용하기
RunAPI 설정
쉘 프로파일에 RUNAPI_API_KEY 환경 변수를 설정하세요. Hermes Agent에서 채팅용 custom:runapi provider가 이미 설정되어 있다면, 동일한 key가 Grok Imagine에도 사용됩니다 — 추가 설정이 필요 없습니다.
export RUNAPI_API_KEY=runapi_xxx
Grok Imagine 호출
model을 grok-imagine-text-to-image로 설정하여 text_to_image endpoint에 POST 요청을 보내세요. 이미지를 설명하는 프롬프트를 포함하세요. 비디오의 경우 grok-imagine-text-to-video와 함께 text_to_video를 사용하세요.
text_to_image
결과 가져오기
API는 즉시 task_id를 반환합니다. status가 completed로 변경될 때까지 task status endpoint를 폴링한 뒤, 응답에서 출력 이미지 또는 비디오 URL을 가져오세요.
task_id: tsk_abc123
Grok Imagine API 파라미터
| 파라미터 | 유형 | 설명 |
|---|---|---|
model |
string |
필수. 예) grok-imagine-text-to-image, grok-imagine-image-to-video. |
prompt |
string |
원하는 출력물에 대한 텍스트 설명. |
image_url |
string |
이미지-이미지 또는 이미지-비디오를 위한 소스 이미지 URL. |
aspect_ratio |
string |
선택 사항. 출력 종횡비, 예) 16:9, 1:1. |
Hermes Agent의 Grok Imagine이란?
Grok Imagine(Aurora)은 xAI의 이미지·동영상 생성기로 텍스트→이미지·이미지 편집·오디오 동기화 텍스트→동영상을 지원합니다. Hermes Agent는 custom:runapi provider를 통해 호출하며, Grok Imagine 출력물을 다른 RunAPI 모델과 조합하는 멀티 스텝 워크플로를 구축하기 쉽습니다.
Grok Imagine 활용 사례
AI 생성 제품 사진
텍스트 설명으로 이커머스 리스팅·카탈로그·광고 캠페인용 제품 사진을 생성하며, 실물 촬영이 필요 없습니다.
동기화 오디오가 포함된 동영상 클립
텍스트 프롬프트로 매칭된 오디오가 포함된 짧은 동영상을 생성해 소셜 미디어 Reels·제품 티저·콘텐츠 마케팅에 활용합니다.
크리에이티브 프로젝트용 캐릭터 생성
상세한 텍스트 프롬프트로 사실적 또는 애니메이션 스타일의 일관된 캐릭터 디자인을 생성해 게임·스토리·브랜드 프로젝트에 사용합니다.
Grok Imagine + Hermes Agent 자주 묻는 질문
네. Hermes Agent에서 RunAPI가 이미 custom provider(custom:runapi)로 설정되어 있다면, 동일한 API key와 base_url이 Grok Imagine에도 사용됩니다. model을 grok-imagine-text-to-image로 설정하고 text_to_image endpoint를 호출하세요.
아니요. 채팅과 다른 모델에 사용하는 동일한 RUNAPI_API_KEY가 Grok Imagine에도 사용됩니다. 하나의 key로 RunAPI 카탈로그의 113개 이상의 모델을 모두 사용할 수 있습니다.
비동기입니다. API는 즉시 task_id를 반환합니다. task가 완료될 때까지 task status endpoint를 폴링하세요. RunAPI SDK와 CLI는 폴링을 자동으로 처리합니다.
Grok Imagine은 RunAPI를 통해 task당 청구됩니다. 현재 요금은 RunAPI 가격 페이지에서 확인하세요. 실패한 생성에는 요금이 부과되지 않습니다.
지금 Hermes Agent에서 Grok Imagine을 사용해보세요.
무료 RunAPI key를 발급받고, custom:runapi provider를 설정한 뒤 xAI Grok Imagine으로 이미지와 비디오를 생성해보세요.