Loading Accelerated Logic…
GA Release

The Multi-Agent WebGPU Engine & Interactions API are now generally available.

Part 18: Generating Images in Chat with Gemini

Learn how inline image requests work, which provider path the app currently uses, and how to retry a failed request.

Category: Visual Generation • Read Time: 25 min read • Updated: 2026-11-10

1. Inline Image Generation Experience

Accelerated Logic AI generates visual assets directly within assistant message bubbles. Rather than switching to an external tool, images render in-line alongside text and code explanations.

📷 Viewfinder Loading State

While generating, a 100x100px animated viewfinder card displays a scanning laser grid, rotating corner brackets, and centered sparkle icons.

🖼️ Interactive Image Display

Images fade in capped at 50vh height. Hovering presents a resolution badge (e.g. 1024×576) and a 1-click PNG download button.

2. How to Trigger Image Generation

Image generation requires explicit intent in your user prompt to prevent accidental API calls:

Effective Prompts: "Generate an image of a cyberpunk skyline at night", "Create a logo: minimalist coffee shop icon", "Draw a picture of a futuristic dashboard".

Multi-Agent Pipeline Note: In Multi-Agent mode, only the Finalizer agent is permitted to emit the <image_gen prompt="..." /> system tag.

3. Image Models & Aspect Ratios

Image generation currently uses the Google Gemini image-generation route. The Settings page describes image generation but does not currently provide a model picker or a fallback toggle.

Current provider path
  • Image requests use the Google Gemini image-generation endpoint configured by the app.
  • Model availability and requirements depend on the connected Google account and current API support.
  • The current Settings interface does not expose a selector for choosing individual image model IDs.
Aspect Ratios & Auto-Enhance
  • Ratios: 1:1 (Square), 16:9 (Landscape), 9:16 (Portrait), 3:2, 2:3, 4:3, 3:4.
  • Auto-Enhance Prompt: LLM pre-expands short prompts into detailed lighting and composition directives.

4. Optional Pollinations retry

The image error card can offer a user-initiated retry through Pollinations. This is a separate third-party service; its availability, account requirements, and usage limits can change. The automatic fallback setting is disabled by default and is not exposed as a control in the current Settings interface.

Manual retry: If the error card offers Force Retry via Pollinations AI, you can choose to send that image request to the alternate service.

5. Prompting Best Practices & Image Reuse

Detailed Styling Directives: Specify lighting ("cinematic soft lighting"), artistic media ("3D Octane render", "flat vector"), and perspective ("rule of thirds, macro lens").

Vision Model Iteration: Download generated PNGs or paste them directly back into the chat composer to refine visuals with vision-enabled models (e.g. "Use this layout as reference, but change the palette to warm sunset tones").

6. Troubleshooting Image Generation

401 Key Rejected? Verify that your Google AI Studio key starts with valid credentials and has Generative Language API enabled.

Safety Policy Block (400)? Rephrase your prompt to avoid trademarked brand names or restricted content filters.

429 rate limit? Check the connected provider's current quota and retry later. If the error card offers the Pollinations action, it can be tried manually; the app does not promise automatic failover.

7. Anatomy of an Image Prompt That Works

Image models are literal collaborators. The five dials, in order of impact:

  1. Subject first, concretely. "A brass desk compass" beats "an object for navigation" — nouns with material and state carry the most pixels.
  2. Composition and framing. "Centered, rule of thirds", "extreme close-up", "overhead flat-lay", "wide establishing shot at dusk" — pick one; conflicting frames produce mushy framing.
  3. Medium and style. "Isometric 3D render", "flat vector with grain texture", "watercolor", "photorealistic DSLR 35mm" — medium fixes the rendering pipeline's guesses.
  4. Lighting. "Soft window light", "hard noon sun with crisp shadows", "neon rim lighting" — lighting is the single cheapest upgrade to perceived quality.
  5. Palette. "Muted earth tones with one vermillion accent" beats "colorful". Name 2–3 anchor colors.

Worked example: "A matte-black mechanical keyboard on a walnut desk, overhead flat-lay, soft window light from the left, muted warm palette with a single amber accent key, photorealistic, shallow depth of field." — every clause disambiguates a different failure mode.

8. Iterating on What You Got — Surgical Re-Prompts

Reference the image, change one thing. Attach the generated PNG and write "keep everything, but make the accent key cyan instead of amber" — the vision-capable chat model treats it as a targeted edit brief, which beats regenerating from scratch and losing the composition you liked.

When it is 80% right: name the 20% — "composition is right; fix the distorted keyboard legends and replace the mug with a notebook". Specific deltas preserve the good parts of the seed.

When it is 20% right: do not patch incrementally — go back to Structure (Section 7) and re-derive the prompt. Three rounds of delta-prompting on a bad base entrench the base's flaws.

Aspect mismatch: state the ratio in the prompt AND point at the badge — if you downloaded a 1:1 but wanted 16:9, say "regenerate as wide landscape 16:9" rather than cropping after the fact and losing the edges.

Keep the winners: download finals immediately — chat history can be exported, but original PNGs are easiest to lose track of when a thread gets long.

9. What to Do with the Image After Generation

Straight into chat workflows

Re-attach the PNG into the same conversation to ask for alt text, a palette extraction ("give me hex codes"), or a Tailwind translation of the design.

Assets for decks & pages

Download, then reference the file from Decks artboards or the Web Sandbox project — image files place as assets; they are not embedded magic.

Reference boards

Generate 3–4 directions, pin them in one chat, and ask the model to critique its own options — a cheap design review loop before you pick one.

10. When Text-in-Image Fails — and What to Use Instead

Every image model garbles text some fraction of the time, and poster/card use cases live and die by legible typography. Know the escape hatch:

Symptoms: letters that look right at a glance but spell nonsense; taglines re-cased into caps; numbers swapped (3↔8). Always zoom to 100% before shipping an AI-rendered wordmark.

The better tool: if the artifact's job is words you will read, generate it as an HTML artboard in Decks (Part 21) — text stays selectable, editable, correctly spelled, and re-themeable, because it is real text laid out by a browser, not hallucinated glyphs.

Hybrid pattern: generate a textless background/hero image with image gen, then overlay real typography in Decks or the Web Sandbox. You get the atmosphere of a generated visual with the reliability of actual text rendering.

If you must bake text in: keep strings short (≤5 words), request "clean signage with the exact text: 'OPEN DAILY'", and iterate in several generations — short strings succeed far more often than sentences.