이미지 생성
Hermes Agent는 FAL.ai를 통해 텍스트 prompt에서 이미지를 생성합니다. 기본으로 9개 모델을 지원하며, 각 모델은 속도, 품질, 비용 tradeoff가 다릅니다. 활성 모델은 hermes tools에서 사용자가 설정할 수 있고, 선택값은 config.yaml에 저장됩니다.
지원 모델
| Model | Speed | Strengths | Price |
|---|---|---|---|
fal-ai/flux-2/klein/9b (default) | <1s | 빠르고 선명한 text | $0.006/MP |
fal-ai/flux-2-pro | ~6s | studio photorealism | $0.03/MP |
fal-ai/z-image/turbo | ~2s | bilingual EN/CN, 6B params | $0.005/MP |
fal-ai/nano-banana-pro | ~8s | Gemini 3 Pro, reasoning depth, text rendering | $0.15/image (1K) |
fal-ai/gpt-image-1.5 | ~15s | prompt adherence | $0.034/image |
fal-ai/gpt-image-2 | ~20s | SOTA text rendering + CJK, world-aware photorealism | $0.04–0.06/image |
fal-ai/ideogram/v3 | ~5s | typography에 가장 강함 | $0.03–0.09/image |
fal-ai/recraft/v4/pro/text-to-image | ~8s | design, brand system, production-ready output | $0.25/image |
fal-ai/qwen-image | ~12s | LLM-based, complex text | $0.02/MP |
가격은 작성 시점의 FAL pricing입니다. 최신 가격은 fal.ai에서 확인하세요.
설정
유료 Nous Portal 구독이 있다면 FAL API key 없이 **Tool Gateway**를 통해 이미지 생성을 사용할 수 있습니다. 모델 선택값은 직접 FAL을 쓰는 경로와 gateway 경로 모두에서 유지됩니다.
managed gateway가 특정 모델에 대해 HTTP 4xx를 반환하면, 그 모델이 아직 portal 쪽에서 proxy되지 않았다는 뜻입니다. agent가 이를 알려 주고 해결 방법도 제시합니다. 직접 접근하려면 FAL_KEY를 설정하거나, 다른 모델을 선택하세요.
FAL API key 받기
- fal.ai에 가입합니다.
- dashboard에서 API key를 생성합니다.
모델 설정 및 선택
tools command를 실행합니다.
hermes tools
🎨 Image Generation으로 이동해 backend(Nous Subscription 또는 FAL.ai)를 고르면, picker가 지원 모델을 column-aligned table로 보여 줍니다. 화살표 키로 이동하고 Enter로 선택합니다.
Model Speed Strengths Price
fal-ai/flux-2/klein/9b <1s Fast, crisp text $0.006/MP ← currently in use
fal-ai/flux-2-pro ~6s Studio photorealism $0.03/MP
fal-ai/z-image/turbo ~2s Bilingual EN/CN, 6B $0.005/MP
...
선택값은 config.yaml에 저장됩니다.
image_gen:
model: fal-ai/flux-2/klein/9b
use_gateway: false # true if using Nous Subscription
GPT-Image 품질
fal-ai/gpt-image-1.5와 fal-ai/gpt-image-2 요청 품질은 medium에 고정되어 있습니다. 1024×1024 기준 약 $0.034–$0.06/image입니다. Nous Portal billing이 모든 사용자에게 예측 가능하도록 low / high tier는 user-facing option으로 노출하지 않습니다. tier 간 비용 차이가 3–22×까지 벌어지기 때문입니다. 더 저렴한 옵션이 필요하면 Klein 9B 또는 Z-Image Turbo를 선택하고, 더 높은 품질이 필요하면 Nano Banana Pro 또는 Recraft V4 Pro를 사용하세요.
사용법
agent-facing schema는 일부러 최소화되어 있습니다. 모델은 사용자가 설정한 값을 그대로 사용합니다.
Generate an image of a serene mountain landscape with cherry blossoms
Create a square portrait of a wise old owl — use the typography model
Make me a futuristic cityscape, landscape orientation
종횡비
agent 관점에서는 모든 모델이 같은 세 가지 aspect ratio를 받습니다. 내부에서는 각 모델의 native size spec이 자동으로 채워집니다.
| Agent input | image_size (flux/z-image/qwen/recraft/ideogram) | aspect_ratio (nano-banana-pro) | image_size (gpt-image-1.5) | image_size (gpt-image-2) |
|---|---|---|---|---|
landscape | landscape_16_9 | 16:9 | 1536x1024 | landscape_4_3 (1024×768) |
square | square_hd | 1:1 | 1024x1024 | square_hd (1024×1024) |
portrait | portrait_16_9 | 9:16 | 1024x1536 | portrait_4_3 (768×1024) |
GPT Image 2는 16:9가 아니라 4:3 preset으로 매핑됩니다. 최소 pixel count가 655,360이기 때문에 landscape_16_9 preset(1024×576 = 589,824)은 거부됩니다.
이 변환은 _build_fal_payload() 안에서 처리됩니다. agent code는 모델별 schema 차이를 알 필요가 없습니다.
자동 업스케일링
FAL의 Clarity Upscaler를 통한 upscaling은 model별로 제한됩니다.
| Model | Upscale? | 이유 |
|---|---|---|
fal-ai/flux-2-pro | ✓ | backward compatibility(이전 picker default였음) |
| 그 외 전체 | ✗ | 빠른 모델은 sub-second value prop을 잃고, hi-res 모델은 upscaling이 필요 없습니다. |
upscaling이 실행되면 다음 설정을 사용합니다.
| Setting | Value |
|---|---|
| Upscale factor | 2× |
| Creativity | 0.35 |
| Resemblance | 0.6 |
| Guidance scale | 4 |
| Inference steps | 18 |
upscaling이 실패하면(network issue, rate limit 등) 원본 이미지가 자동으로 반환됩니다.
내부 동작
- Model resolution -
_resolve_fal_model()이config.yaml의image_gen.model을 읽고, 없으면FAL_IMAGE_MODELenv var, 그다음fal-ai/flux-2/klein/9b로 fallback합니다. - Payload building -
_build_fal_payload()가aspect_ratio를 모델의 native format(preset enum, aspect-ratio enum, GPT literal)으로 변환하고, 모델 default params를 merge한 뒤 caller override를 적용합니다. 마지막으로 모델의supportswhitelist로 filter하여 지원하지 않는 key가 전송되지 않게 합니다. - Submission -
_submit_fal_request()가 직접 FAL credential 또는 managed Nous gateway를 통해 요청을 보냅니다. - Upscaling - 모델 metadata에
upscale: True가 있을 때만 실행됩니다. - Delivery - 최종 image URL을 agent에 반환합니다. agent는
MEDIA:<url>tag를 emit하고, platform adapter가 이를 native media로 변환합니다.
디버깅
debug logging을 활성화합니다.
export IMAGE_TOOLS_DEBUG=true
debug log는 call별 상세 정보(model, parameters, timing, errors)를 포함해 ./logs/image_tools_debug_<session_id>.json에 기록됩니다.
플랫폼별 전달
| Platform | Delivery |
|---|---|
| CLI | image URL을 markdown 로 출력합니다. 클릭해서 열 수 있습니다. |
| Telegram | prompt를 caption으로 넣은 photo message |
| Discord | message에 embed |
| Slack | Slack이 URL을 unfurl |
| media message | |
| Others | plain text URL |
제한 사항
- FAL credential 필요 - 직접
FAL_KEY를 쓰거나 Nous Subscription을 사용해야 합니다. - Text-to-image only - 이 tool은 inpainting, img2img, editing을 지원하지 않습니다.
- Temporary URLs - FAL이 반환하는 hosted URL은 몇 시간 또는 며칠 뒤 만료됩니다. 필요하면 로컬에 저장하세요.
- 모델별 제약 - 일부 모델은
seed,num_inference_steps등을 지원하지 않습니다.supportsfilter가 지원하지 않는 param을 조용히 제거하며, 이는 의도된 동작입니다.