الأكاديمية ← ميزات Hermesتوثيق رسمي · إرشاد عربي

توليد الصور

Image Generation

متوسط8 دقائق قراءةالدرس 134 أسئلة✓ 2026-08-18
قبل أن تقرأ

ما هذه الصفحة، وماذا تحتوي.

الأسرار والمفاتيح: كلمات السر ومفاتيح الخدمات التي يحتاجها Hermes ليدخل إلى حساباتك. تُحفظ في مكان واحد محمي، فلا تظهر في المحادثات ولا في الملفات التي تشاركها. ستستعمل هنا hermes tools، والقراءة نحو 8 دقائق. انتبه: لا تكتب مفتاحًا داخل محادثة ولا داخل ملف إعداد تشاركه. استعمل متغيرات البيئة أو مدير أسرار.

10أقسام
9أمثلة برمجية
6جداول
1أوامر
1,332كلمة من المصدر
الوصف الرسمي في سطر

Generate images via FAL.ai — 11 models including FLUX 2, GPT Image (1.5 & 2), Nano Banana Pro, Ideogram, Recraft V4 Pro, Krea 2, and more, selectable via hermes tools.

ماذا ستستطيع بعدها

نتائج مأخوذة من هذه الصفحة، لا من قالب.

  • تعرف ما الأسرار والمفاتيح ولماذا قد تحتاجه.
  • تنفّذ hermes tools وتفهم ما يحدث بعدها.
  • تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
  • تضبط FAL_KEY في المكان الصحيح.
ما ستقابله من أسماء

كما تظهر تمامًا داخل Hermes.

الأوامر
  • hermes tools
متغيرات البيئة
  • FAL_KEY
  • FAL_IMAGE_MODEL
  • IMAGE_TOOLS_DEBUG
  • OPENAI_API_KEY
  • KREA_API_KEY
خريطة الصفحة

انتقل مباشرة إلى ما تحتاجه.

  1. 01Supported Models
  2. 02Setup
  3. 03Usage
  4. 04Image-to-Image / Editing
  5. 05Aspect Ratios
  6. 06Upscaling
  7. 07How It Works Internally
  8. 08Debugging
  9. 09Platform Delivery
  10. 10Limitations
الصفحة الرسمية كاملة

بلا اختصار أو حذف.

النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.

Hermes Agent generates images from text prompts via FAL.ai. Eleven models are supported out of the box, each with different speed, quality, and cost tradeoffs. The active model is user-configurable via hermes tools and persists in config.yaml.

Supported Models

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

ModelSpeedStrengthsPrice
fal-ai/flux-2/klein/9b (default)<1sFast, crisp text$0.006/MP
fal-ai/flux-2-pro~6sStudio photorealism$0.03/MP
fal-ai/z-image/turbo~2sBilingual EN/CN, 6B params$0.005/MP
fal-ai/nano-banana-pro~8sGemini 3 Pro, reasoning depth, text rendering$0.15/image (1K)
fal-ai/gpt-image-1.5~15sPrompt adherence$0.034/image
fal-ai/gpt-image-2~20sSOTA text rendering + CJK, world-aware photorealism$0.04–0.06/image
fal-ai/ideogram/v3~5sBest typography$0.03–0.09/image
fal-ai/recraft/v4/pro/text-to-image~8sDesign, brand systems, production-ready$0.25/image
fal-ai/qwen-image~12sLLM-based, complex text$0.02/MP
fal-ai/krea/v2/medium/text-to-image~15-25sIllustration, anime, painting, expressive/artistic styles$0.030–0.035/image
fal-ai/krea/v2/large/text-to-image~25-60sPhotorealism, raw textured looks (motion blur, grain, film)$0.060–0.065/image

Prices are FAL's pricing at time of writing; check fal.ai ↗ for current numbers.

Setup

خطوات عملية بالترتيب. نفّذ خطوة وتأكد أنها نجحت قبل الانتقال للتالية. الأوامر هنا: hermes tools.

Get a FAL API Key

  1. Sign up at fal.ai ↗
  2. Generate an API key from your dashboard

Configure and Pick a Model

Run the tools command:

Shellسطر واحد
hermes tools

Navigate to 🎨 Image Generation, pick your backend (Nous Subscription or FAL.ai), then the picker shows all supported models in a column-aligned table — arrow keys to navigate, Enter to select:

Text5 أسطر
  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
  ...

Your selection is saved to config.yaml:

YAML4 أسطر
image_gen:
  model: fal-ai/flux-2/klein/9b
  use_gateway: false            # true if using Nous Subscription
  max_parallel_requests: 4      # concurrent images in one tool-call batch

max_parallel_requests defaults to 4. Hermes clamps it to at least one and to the global tool-worker limit, so image providers receive bounded parallel requests without allowing an image batch to bypass the agent's concurrency cap.

GPT-Image Quality

The fal-ai/gpt-image-1.5 and fal-ai/gpt-image-2 request quality is pinned to medium (~$0.034–$0.06/image at 1024×1024). We don't expose the low / high tiers as a user-facing option so that Nous Portal billing stays predictable across all users — the cost spread between tiers is 3–22×. If you want a cheaper option, pick Klein 9B or Z-Image Turbo; if you want higher quality, use Nano Banana Pro or Recraft V4 Pro.

Usage

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: كلمات السر ومفاتيح الخدمات التي يحتاجها Hermes ليدخل إلى حساباتك.

The agent-facing schema is intentionally minimal — the model picks up whatever you've configured:

Textسطر واحد
Generate an image of a serene mountain landscape with cherry blossoms
Textسطر واحد
Create a square portrait of a wise old owl — use the typography model
Textسطر واحد
Make me a futuristic cityscape, landscape orientation

Image-to-Image / Editing

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

The same image_generate tool also edits existing images when the active model supports it — pass a source image and the backend routes to its editing endpoint automatically (mirrors how video_generate handles image-to-video). Omit the source image and it's plain text-to-image.

Textسطر واحد
Take this photo and make it a rainy Tokyo street at night → <image>
Textسطر واحد
Blend these two product shots into one hero image → <image1> <image2>

Two inputs drive the edit:

  • image_url — the primary source image to edit/transform (public URL or local path).
  • reference_image_urls — additional style/composition references (capped per-model).

Which backends support editing

BackendImage-to-imageReference capHow
FAL.ai (edit-capable models below)✓up to 9routes to the model's /edit endpoint
OpenAI (gpt-image-2)✓up to 16images.edit()
xAI (Grok Imagine)✓1/v1/images/edits (grok-imagine-image-quality)
Krea (Krea 2)✓up to 10reference-guided generation (image_style_references)
OpenAI (Codex auth)✓up to 16Codex Responses image_generation tool with input_image content parts

FAL models with an editing endpoint: flux-2/klein/9b, flux-2-pro, nano-banana-pro, gpt-image-1.5, gpt-image-2, ideogram/v3, and qwen-image. Pure text-to-image FAL models (z-image/turbo, recraft, krea/*) reject image inputs with a clear error pointing you at an edit-capable model.

The active model's editing capability is surfaced in the tool description at runtime, so the agent knows whether image_url will be honored before it calls the tool.

Aspect Ratios

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Every model accepts the same three aspect ratios from the agent's perspective. Internally, each model's native size spec is filled in automatically:

Agent inputimage_size (flux/z-image/qwen/recraft/ideogram)aspect_ratio (nano-banana-pro)image_size (gpt-image-1.5)image_size (gpt-image-2)
landscapelandscape_16_916:91536x1024landscape_4_3 (1024×768)
squaresquare_hd1:11024x1024square_hd (1024×1024)
portraitportrait_16_99:161024x1536portrait_4_3 (768×1024)

GPT Image 2 maps to 4:3 presets rather than 16:9 because its minimum pixel count is 655,360 — the landscape_16_9 preset (1024×576 = 589,824) would be rejected.

This translation happens in _build_fal_payload() — agent code never has to know about per-model schema differences.

Upscaling

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Opt-in only

No model upscales by default. Modern image models emit their best quality natively, and the available upscalers are creative enhancers (diffusion passes) that can subtly redraw content — degrading rendered text, faces, and fine detail. Upscaling only runs when the agent explicitly requests it.

The upscale parameter (per-call opt-in)

  • upscale: true — chain a high-resolution pass after generation:
BackendUpscaler
FAL.aiClarity Upscaler (2×, +$0.03/MP)
KreaKrea Enhance (2×, up to 8K ceiling)
Other backendsno upscaler; native resolution returned
  • upscale: false / omitted — native resolution (the default)

video_generate also accepts upscale: true on the FAL backend, chaining ByteDance's SeedVR2 video upscaler (2×, $0.001/MP of output video) after generation.

When the FAL image pass runs, it uses these settings:

SettingValue
Upscale factor2×
Creativity0.35
Resemblance0.6
Guidance scale4
Inference steps18

If upscaling fails (network issue, rate limit), the original image is returned automatically. The response reports upscaled: true/false so the agent knows which resolution it got.

How It Works Internally

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. تضبط FAL_IMAGE_MODEL خارج المحادثة، في بيئة التشغيل.

  1. Model resolution — _resolve_fal_model() reads image_gen.model from config.yaml, falls back to the FAL_IMAGE_MODEL env var, then to fal-ai/flux-2/klein/9b.
  2. Payload building — _build_fal_payload() translates your aspect_ratio into the model's native format (preset enum, aspect-ratio enum, or GPT literal), merges the model's default params, applies any caller overrides, then filters to the model's supports whitelist so unsupported keys are never sent.
  3. Submission — _submit_fal_request() routes via direct FAL credentials or the managed Nous gateway.
  4. Upscaling — runs only when the agent passed upscale: true; every model's catalog default is off.
  5. Delivery — final image URL returned to the agent, which emits a MEDIA:<url> tag that platform adapters convert to native media.

Debugging

قسم لحل المشكلات. ابحث فيه عن العطل الذي يشبه حالتك بدل قراءته كاملًا.

Enable debug logging:

Shellسطر واحد
export IMAGE_TOOLS_DEBUG=true

Debug logs go to ./logs/image_tools_debug_<session_id>.json with per-call details (model, parameters, timing, errors).

Platform Delivery

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

PlatformDelivery
CLIImage URL printed as markdown ![](https://hermes-agent.nousresearch.com/docs/url) — click to open
TelegramPhoto message with the prompt as caption
DiscordEmbedded in a message
SlackURL unfurled by Slack
WhatsAppMedia message
OthersURL in plain text

Limitations

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. تضبط FAL_KEY، OPENAI_API_KEY خارج المحادثة، في بيئة التشغيل.

  • Requires credentials for the active backend (FAL FAL_KEY / Nous Subscription, OPENAI_API_KEY, xAI OAuth, KREA_API_KEY)
  • Editing is model-dependent — image-to-image works only on edit-capable models (see the table above); text-to-image-only models reject image inputs with a clear error
  • Temporary URLs — backends return hosted URLs that expire after hours/days; Hermes materializes them to the local cache so delivery still works after expiry
  • Per-model constraints — some models don't support seed, num_inference_steps, etc. The supports / edit_supports filter silently drops unsupported params; this is expected behavior
اختبار الفهم

4 أسئلة إجاباتها كلها في هذه الصفحة.

كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.

1. في جدول هذا الدرس، ما «Speed» المقابل لـ«fal-ai/qwen-image»؟
2. أي متغير بيئة من التالي يظهر فعليًا في هذا الدرس؟
3. أي عنوان من التالي لا يظهر في هذا الدرس؟
4. أي مفتاح إعداد يظهر في أمثلة هذا الدرس؟