Image Generation¶
GloriaMundo can generate images as part of content workflows. When a workflow includes an image step, such as creating a social media post with a visual, the platform produces the image alongside the rest of the workflow output.
Image generation is part of the Glass Box preview loop. During Virtual Run, you see the generated image before anything publishes. If the image does not suit the post, you can adjust the prompt or regenerate before committing to a live run.
[Screenshot needed: Virtual Run preview showing a generated image alongside a social media post draft]
Enabling Image Generation¶
Image generation is controlled by two settings under AI Models in Settings:
ai_models.image_generation_enabled— a boolean toggle (default: off)ai_models.image_model— the specific model to use (default:"none")
To start generating images, turn on the Image Generation toggle. When you do, the system automatically selects an image model based on your current preset tier (see below). You can also override the model manually after enabling.
To stop generating images, turn the toggle off. This resets the image model to "none".
Preset Tier Sync¶
The image model is tied to your AI model preset. When image generation is enabled, the system keeps the two in sync:
| Preset Tier | Image Model Assigned |
|---|---|
| Economy / Quick | nano_banana (Nano Banana) * |
| Balanced / Smart / Auto | nano_banana (Nano Banana) |
| Ultimate | nano_banana_pro (Nano Banana Pro) |
* The preset grid stores "none" for Economy/Quick, but when a user explicitly enables image generation, _sync_image_model_from_preset() overrides that raw value and falls back to nano_banana rather than leaving images disabled.
This sync happens automatically in three cases:
- Enabling image generation sets the image model to match your current preset.
- Changing your preset while image generation is already enabled updates the image model to match the new tier.
- Disabling image generation resets the image model to
"none".
After the automatic sync, you can still manually change ai_models.image_model to any available model. The next preset change (while image generation is enabled) will override your manual choice.
This logic lives in SettingsService.set() and _sync_image_model_from_preset() in agent_app/services/settings_service.py.
Available Image Models¶
| Setting Value | Label | Description | Approx. Cost | Provider |
|---|---|---|---|---|
none | No Images | Text-only posts (default) | -- | -- |
imagen_fast | Imagen 4 Fast | Good quality, quick (~5s) | $0.04 | Vertex AI |
imagen_ultra | Imagen 4 Ultra | Highest quality (~15s) | $0.12 | Vertex AI |
nano_banana | Nano Banana | Fast & affordable via Gemini | $0.02 | OpenRouter |
nano_banana_pro | Nano Banana Pro | Higher quality Gemini | $0.06 | OpenRouter |
gpt5_image | GPT-5 Image | OpenAI's latest image model | $0.08 | OpenRouter |
gpt5_image_mini | GPT-5 Image Mini | Faster, more affordable | $0.04 | OpenRouter |
nano_banana_2 | Nano Banana 2 | SOTA image gen, Flash speed (Gemini 3.1) | $0.02 | OpenRouter |
seedream | Seedream 4.5 | ByteDance image model | $0.03 | OpenRouter |
flux2_pro | FLUX.2 Pro | Black Forest Labs | $0.10 | OpenRouter |
These are defined in IMAGE_MODEL_OPTIONS in agent_app/routing/model_presets.py. Additional custom models can be added via the custom_image_models database table and will appear alongside the built-in options.
The settings UI resolves available models dynamically at serve-time via get_valid_image_model_keys() in agent_app/virtual_run/image_providers/__init__.py.
How It Works¶
When a workflow includes a content step that benefits from a visual (for example, a LinkedIn post or a tweet), the system generates an image matched to the content. The image prompt is derived from the post text and the target platform.
Platform-aware formatting is built in. The system selects an appropriate aspect ratio for each destination:
- Twitter/X, Slack, Discord: 16:9 (landscape)
- Instagram, Threads: 1:1 (square)
- Instagram Stories, TikTok: 9:16 (portrait)
- LinkedIn, Facebook: 16:9
- Pinterest: 3:4
You do not need to specify aspect ratios manually. The platform handles it.
In Virtual Run¶
During a Virtual Run preview, the live runner reads the image settings via get_image_model_setting() in agent_app/utils/settings_context.py. This returns a (generate_images, image_model) tuple. Both values are stored in the execution context (_generate_images and _image_model) and used by image generation steps.
The flow:
live_runner.pycallsget_image_model_setting(user_id)to get the current toggle state and model.- If the toggle is off or the model is
"none", no images are generated. - If enabled, the workflow generates images using the configured model.
- The image appears inline with the content preview, so you can see exactly what would be posted.
- You can approve, regenerate, or adjust the prompt before executing the workflow for real.
This is consistent with the broader Glass Box principle: you review everything before it reaches the outside world.
Cost¶
Each image generation has a small per-image cost that is included in the workflow's cost estimate. The exact amount depends on the model selected (see the table above). Cost details appear in the Virtual Run cost breakdown alongside other workflow charges.
See Credits and Billing for more on how costs are tracked.